Transfer sites from command line

rajuru

Active Member
Nov 13, 2005
25
0
151
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 [email protected]_SERVER_IP username --express


thanks
 

SB-Nick

Well-Known Member
Aug 26, 2008
175
9
68
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.
 

rajuru

Active Member
Nov 13, 2005
25
0
151
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.
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
 

SB-Nick

Well-Known Member
Aug 26, 2008
175
9
68
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).
 

SB-Nick

Well-Known Member
Aug 26, 2008
175
9
68
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.
 

Spiral

BANNED
Jun 24, 2005
2,020
8
193
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.