How to restore from your old drive in cpanel with rsync

This article will explain how to copy your old data using rsync from a failing drive to a fresh reload of cPanel on a new drive.

WARNING!!!

If you had to reload the system for permission issues or because of a Hacked system STOP Now, all you are going to do is break the clean system with these commands as rsync is going to copy everything including the hacked or infected files as well as the broken permissions.

 

Check your mount points and update the lines to how you mounted the drive in the new server.

 

rsync -vrplogDtH /olddrive/usr/local/apache/conf /usr/local/apache | tee -a /migratelog.txt

rsync -vrplogDtH /olddrive/var/named /var | tee -a /migratelog.txt

rsync -vrplogDtH /olddrive/home/* /home | tee -a /migratelog.txt

rsync -vrplogDtH /olddrive/usr/local/cpanel /usr/local | tee -a /migratelog.txt

rsync -vrplogDtH /olddrive/var/lib/mysql /var/lib | tee -a /migratelog.txt

rsync -vrplogDtH /olddrive/var/cpanel /var | tee -a /migratelog.txt

rsync -vrplogDtH /olddrive/usr/share/ssl /usr/share | tee -a /migratelog.txt

rsync -vrplogDtH /olddrive/var/ssl /var | tee -a /migratelog.txt

rsync -vrplogDtH /olddrive/usr/local/cpanel/3rdparty/mailman /usr/local/cpanel/3rdparty | tee -a /migratelog.txt

rsync -vrplogDtH /olddrive/var/log/bandwidth /var/log | tee -a /migratelog.txt

rsync -vrplogDtH /olddrive/usr/local/frontpage /usr/local | tee -a /migratelog.txt

rsync -vrplogDtH /olddrive/var/s***l/cron /var/s***l | tee -a /migratelog.txt

rsync -vrplogDtH /olddrive/root/.my.cnf / | tee -a /migratelog.txt

rsync -vrplogDtH /olddrive/etc/httpd/conf/httpd.conf /etc/httpd/conf | tee -a /migratelog.txt

rsync -vrplogDtH /old/etc/sysconfig/network /etc/sysconfig | tee -a /migratelog.txt

 

cd /olddrive/etc

rsync -vrplogDtH secondarymx domainalias valiases vfilters exim* proftpd* pure-ftpd* passwd* group* *domain* *named* wwwacct.conf cpupdate.conf quota.conf shadow* *rndc* ips* ipaddr***l* ssl hosts /etc | tee -a /migratelog.txt

If you are still having issues and require assistance please submit a support ticket.

kbadmin has written 146 articles

Loading Facebook Comments ...

This site uses Akismet to reduce spam. Learn how your comment data is processed.