The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Transfer sites from command line

Discussion in 'General Discussion' started by rajuru, Jun 17, 2009.

  1. rajuru

    rajuru Active Member

    Joined:
    Nov 13, 2005
    Messages:
    25
    Likes Received:
    0
    Trophy Points:
    1
    hello,
    i need help in transferring a lots of sites. i need to transfer (suppose) 500 sites out of total 1000 accounts in a server. it is not possible to find & check 500 sites and check the express transfer box. its so bad that there is not option to check all for express mode option.

    thats why i am planning to write a script. i can handle the script part. but i need to know how to transfer the site in command line.

    i have a list of domains/username in a text file. using the script i will transfer each site.
    how can I do it?


    anything to do it like:
    restorepkg root@OLD_SERVER_IP username --express


    thanks
     
  2. SB-Nick

    SB-Nick Well-Known Member

    Joined:
    Aug 26, 2008
    Messages:
    134
    Likes Received:
    0
    Trophy Points:
    16
    cPanel Access Level:
    Root Administrator
    Hey,

    You can use rsync to transfer all the cpanel backups from one server to the other, you have to pack each account using "/scripts/pkgacct" from command line and then restore each account using "/scripts/restorepkg"

    This is a extremely easy thing to automatize with a small shell script and rsync with SSH public/private keys.
     
  3. rajuru

    rajuru Active Member

    Joined:
    Nov 13, 2005
    Messages:
    25
    Likes Received:
    0
    Trophy Points:
    1
    thanks first for ur kind reply.

    problem of rsync is the express transfer. cpanel's express transfer nicely suspends the site in the remote server, point all A records to new server etc. how can I do that using rsync?

    thanks
     
  4. rajuru

    rajuru Active Member

    Joined:
    Nov 13, 2005
    Messages:
    25
    Likes Received:
    0
    Trophy Points:
    1
  5. SB-Nick

    SB-Nick Well-Known Member

    Joined:
    Aug 26, 2008
    Messages:
    134
    Likes Received:
    0
    Trophy Points:
    16
    cPanel Access Level:
    Root Administrator
    A quick solution would be to use '/scripts/suspendacct' script after each successfully account restore on the new server and to update the A record for the zone located in /var/named/ for the given domain using a stream editor (ie: sed).
     
  6. SB-Nick

    SB-Nick Well-Known Member

    Joined:
    Aug 26, 2008
    Messages:
    134
    Likes Received:
    0
    Trophy Points:
    16
    cPanel Access Level:
    Root Administrator
    Sorry, I did not note your last reply.

    I believe /scripts/getremotecpmove prompts for the account password every time you run it so I doubt you can automatize the migration process with it.
     
  7. rajuru

    rajuru Active Member

    Joined:
    Nov 13, 2005
    Messages:
    25
    Likes Received:
    0
    Trophy Points:
    1
    thanks for your efforts.

    i find it easier to check the accounts. but i will appreciate if cpanel makes it easier to select 'express transfer' option for many domains.
     
  8. Spiral

    Spiral BANNED

    Joined:
    Jun 24, 2005
    Messages:
    2,023
    Likes Received:
    7
    Trophy Points:
    0
    The IP should be reassigned automatically when you restore the cpmove
    file on the new server (usually to the shared default IP for that server)
    but you can also individually and mass change IPs easy enough.

    The only thing I recommend is that before transferring, you duplicate
    the settings, features, and package plans on the new server to be
    the same as the old server before transferring accounts and it will
    make your life much easier and things should sync up nicely.
     
Loading...

Share This Page