Are you having trouble migrating multiple cPanel domains? Don’t worry, here is the official – “cPanel to cPanel Migration – Multiple Domains” guide. Let’s start.
Assume “S” is our source server and “D” is our remote server.
1) Make sure you don’t have any cPanel backups under the “/home” directory in either the “S” or “D” server. If you have, then move it to some other folder.
2) Login to the server “D.”
3) Run the below command.
cat /etc/trueuserdomains | awk '{print $2}' > /home/usrlist
Here what is happening is, you will get all cPanel account names in file “/home/usrlist”.
4) Start a new screen session by running the below command.
screen
( Always use the screen to do long-running tasks. Even if the connection close, it won’t affect the screen session )
5) Run the below command to backup all domains in your system.
for x in $(cat /home/usrlist); do /scripts/pkgacct $x; done
( The above command will take backup of all your domains and put it under the “/home” directory. )
6) Run the below command to move all backups and “usrlist” files to the directory “/home/bck”
cd /home&& mkdir /home/bck&& mv *.tar.gz usrlist /home/bck
7) Use “scp” to move the files under “/home/bck” to the “S” machine. ( It could be a long process. So make sure to run this under “screen” session )
scp -r /home/bck/* root@S machine IP/Hostname:/home
8) After completing the “scp” file transfer, login to the “S” machine
9) Start a “screen” session and run the below command to restore all the backups.
for x in $(cat /home/usrlist); do /scripts/restorepkg $x; done
That’s it!! You have migrated all the domains from the “D” machine to your “S” machine.