Here's a great way to transfer all of your cPanel accounts, from one server to the other. Like you've mentioned previously, root access is an requirement.
Firstly, we'll generate a ssh-key, that way we don't need to type the password too many times. Just hit enter a few times until you're back to the normal shell prompt, we want no password and default values.
# ssh-keygen -t dsa
Let's set the new server's IP address for ease of use:
Let's copy the sshkey we created to the server... (the password it's asking for is the root password of the remote server, type that in.)
# scp /root/.ssh/id_dsa.pub $NEWSERVER:/root/.ssh/authorized_keys
This is the easy part -- just run this command, and it will package up each individual cPanel account, transfer it to the remote server, and restore it. This is actually two seperate commands, the first one will run in the background and log everything to a file, and you can view the logfile by running the last command,
# for acct in `ls -1 /var/cpanel/users/`; do echo Transferring $acct; /scripts/pkgacct $acct; scp /home/cpmove-$acct.tar.gz $NEWSERVER:/home/; ssh $NEWSERVER "/scripts/restorepkg $acct; rm -rf /home/cpmove-$acct.tar.gz";rm -fr /home/cpmove-$acct.tar.gz; done > /tmp/transfer.log 2>&1 &
# tail -f /tmp/transfer.log
If you want to remove the sshkey after you've finished the account transfer, here's the command for that:
# ssh $NEWSERVER rm /root/.ssh/authorized_keys