From time to time we need to upgrade or downgrade to different server depending our usage so today i will explain to you how to transfer whole cpanel server websites to another cpanel server with the best way to do that .
Let's follow my instructions :
1) If you need to suspend your websites to prevent new data being missed during the transfer process connect to your server shell and do the following command to suspend all accounts :
for i in `ls /var/cpanel/users`; do /scripts/suspendacct $i ; done
2) Now we can create an new fresh backup of all accounts using the following command :
for i in `ls /var/cpanel/users`; do /scripts/pkgacct --no-compress $i ; done
The attribute "--no-compress" tells the backup script not to compress the backup to get them a lot faster than compressing them but take in your consideration this is consume more disk space .
3) After the new backups are ready we will transfer them to the new cpanel server, replace x.x.x.x with your new server ip in this command :
scp /home/*.tar email@example.com:/home/
Close shell connection to your old server we don't need to do any thing more on it from now .
Then you will be asked for the destined server shell password .
4) After backups transfer has been completed we will restore them, now connect to your new cpanel server shell and do the following command to start this process :
for i in `ls /home/*.tar`; do /scripts/restorepkg --force $i ; done
5) Unsuspend all accounts on new server using the following command :
for i in `ls /var/cpanel/users`; do /scripts/unsuspendacct $i ; done
6) Now you need to set your main domain name servers ip address to your new server and wait to be fully stable during 24 hour .
7) Check all your websites data if every thing is good you can now delete all backups in home doing the following command :
That's all .