How to Migrate cPanel Accounts/Backups using SSH
Sometimes it’s not enough to have the inbuilt options inside cPanel to migrate accounts. For example, accounts over 5GB sometimes won’t transfer correctly and a manual transfer will need to be done. In this article, we are going to migrate a cPanel account using SSH to another High Availability cPanel VPS Server. We will then restore the cPanel backup.
To get started login via SSH On the Source Server (where the account to be migrated is currently) and then let’s package the account up.
Run the below command replacing the bit after /scripts/pkgaccct with the cPanel user to be packed up, In this example it’s demo.
/scripts/pkgacct demo
Migrate cPanel Backup
Next, Let’s log in to the Destination server via SSH. The server you are moving the account too.
We will copy the account from the source server by running one of the below commands;
scp -P 22 /home/cpmove-demo.tar.gz root@dedtinationserverip:/home/
For larger migrations, it’s best to use RSYNC.
rsync -avz -e "ssh -p 22" root@destinationserverip:/home/cpmove-demo.tar.gz* /home/
The -P symbol represents the port to connect to via SSH.
Restore cPanel Backup
On the destination server, you now should have your backup located in the /home directory. The last thing to do is to restore that cPanel backup to your destination server. Issue the command and include the username of the backup account. It’s in the backup name after cpmove.
/scripts/restorepkg demo
You will now have your account migrated to the new cPanel Server. You should now update the name servers on the domain name to point to your new cPanel Server. The restorepkg script takes care of modifying the DNS record of your cPanel account. But you can inspect the DNS Zone Record and make changes to the record from WHM by using the Edit DNS Zone link.