Since the actual list of files and folders to rsync hasn't been noted, I'll provide a list of the files and folders I've used personally for cPanel rsyncs in the past:
/etc/passwd
/etc/shadow
/etc/sudoers
/etc/quota.conf
/etc/group
/etc/domainips
/etc/exim/
/etc/exim.key
/etc/exim.crt
/etc/exim.pl.local
/etc/exim.conf
/etc/ips
/etc/localdomains
/etc/proftpd/
/etc/my.cnf
/etc/rc.local
/etc/resolv.conf
/etc/trueuserdomains
/etc/userdomains
/etc/valiases/
/etc/vfilters/
/etc/vdomainaliases/
/etc/vmail/
/etc/wwwacct.conf
/root/.my.cnf
/usr/java/
/usr/local/apache/conf/
/usr/local/apache/htdocs/
/usr/local/cpanel/3rdparty/mailman/archives/
/usr/local/cpanel/3rdparty/mailman/lists/
/usr/local/cpanel/base/frontend/lp/
/usr/share/ssl/
/var/lib/pgsql/
/var/spool/cpcpan/
/var/cpanel/
/var/spool/cron/
/var/lib/mysql/
/var/named/
/home
After rsyncing, if your machines are on different OS or architectures, please remove the following file on the new server:
Code:
/var/cpanel/sysinfo.config
That file contains data on the old server's OS and architecture and is not interchangeable between systems.
If the old server IPs will be used for the new server, you might well want these files (be careful copying these otherwise as they'll change your main server IP to the old server's IP and should only be copied if you intend to switch to the new server shortly after a reboot with the old IP becoming the main IP on that new server):
Code:
/etc/sysconfig/network
/etc/sysconfig/network-scripts/ifcfg-eth0
After you copy over these files and folders, then you would want to rebuild Apache. The above files should include all the user data you need.
Normally, I would then create a file in /tmp on the new server called movelist and include the files and folders, then I would run the following command on the new server:
Code:
for file in `cat /tmp/movelist` ;do rsync --archive --verbose --rsh=ssh oldserverIP:$file $file --exclude '/var/cpanel/sysinfo.config' ;done
Replacing
oldserverIP with the IP for the old server.
Please note that you cannot use cpmove or cPanel restore files when using this method as the two methods are not interchangeable. It is either cPanel backups and restores or rsyncs. This is because the cPanel backups when being restored on a system presume the account doesn't have files or folders already existing for the data. If the account exists in any fashion (the username in /etc/passwd, /home/user/ exists, and so on), then the cPanel backup cannot restore via WHM on that system, although you can force a restore in root SSH using the --force flag.
I also would highly suggest using dumps for MySQL data instead of this method if you have InnoDB MySQL database tables. If MySQL is running when you do an rsync like this for backups, the /var/lib/mysql/ibdata1 file might corrupt. A corrupted InnoDB table or tables can cause MySQL to not start, so you are risking MySQL not working by using an rsync. It's better to get a dump of the databases on top of the rsync for MySQL.