Migrating cPanel Accounts without homedir – The SSH Way

Step 1: Generate backups without the homedir and sync them one by one removing each backup after the transfer

Code:
for x in `\ls -A1 /var/cpanel/users/`; do /scripts/pkgacct --skiphomedir ${x} ; rsync -aP /home/cpmove-${x}.tar.gz -e ssh root@NEW-SERVER-IP:/home/ ; rm -f /home/cpmove-${x}.tar.gz ; done

Step 2: Restore all accounts on the new server

Code:
for x in `ls -A1 /home/cpmove*` ; do /scripts/restorepkg /home/${x} ; done

Step 3: Sync /home from old server to new server

Code:
 rsync -aP /home/ -e ssh root@NEW-SERVER-IP:/home/

 

[del.icio.us] [Digg] [Reddit] [Slashdot] [StumbleUpon] [Technorati] [Windows Live] [Yahoo!]