Manual Migration from slaved drive to new one

The following guide was taken from Cpanel support forum. This information is when you need to migrate Cpanel account information from one drive or to another.

Manually moving Cpanel

These commands will allow you to manually migrate all customer data and configs from an old primary drive installed as a slave.

source drive should be mounted to /mnt/slave1

run chkrootkit to make sure you don’t copy back infected files.. chkrootkit — locally checks for signs of a rootkit

now we can start copying back data from the old drive

Run these rSync commands to move everything over:


# rsync -vrplogDtH /slave1/usr/local/apache/conf /usr/local/apache
# rsync -vrplogDtH /slave1/var/named /var
# rsync -vrplogDtH /slave1/home/* /home
# rsync -vrplogDtH /slave1/usr/local/cpanel /usr/local
# rsync -vrplogDtH /slave1/var/lib/mysql /var/lib
# rsync -vrplogDtH /slave1/var/cpanel /var
# rsync -vrplogDtH /slave1/usr/share/ssl /usr/share
# rsync -vrplogDtH /slave1/var/ssl /var
# rsync -vrplogDtH /slave1/usr/local/cpanel/3rdparty/mailman /usr/local/cpanel/3rdparty
# rsync -vrplogDtH /slave1/var/log/bandwidth /var/log
# rsync -vrplogDtH /slave1/usr/local/frontpage /usr/local
# rsync -vrplogDtH /slave1/var/spool/cron /var/spool
# rsync -vrplogDtH /slave1/root/.my.cnf /root
# rsync -vrplogDtH /slave1/etc/httpd/conf/httpd.conf /etc/httpd/conf

* rsync options
-v, –verbose increase verbosity
-r, –recursive recurse into directories
-p, –perms preserve permissions
-l, –links copy symlinks as symlinks
-o, –owner preserve owner (super-user only)
-g, –group preserve group
-D same as –devices –specials
-t, –times preserve modification times
-H, –hard-links preserve hard links

See a list of all the options –

cd to the old etc directory:


#cd /slave1/etc

And copy some files from here:


# rsync -vrplogDtH secondarymx domainalias valiases vfilters exim* proftpd* pure-ftpd* passwd* group* *domain* *named* wwwacct.conf cpupdate.conf quota.conf shadow* *rndc* ips* ipaddrpool* ssl hosts /etc 

Update cpanel afterwards


# /scripts/upcp
# /scripts/updatenow
# /scripts/sysup
# /scripts/fixeverything
# /scripts/exim4
# /scripts/easyapache
# /scripts/securetmp 

Restarting services


# /scripts/restartsrv httpd
# /scripts/restartsrv cpanel
# /scripts/restartsrv mysql
# /scripts/restartsrv named
# /scripts/restartsrv exim 

Source: http://forums.cpanel.net/f49/help-moving-cpanel-accounts-damaged-disk-163734.html

Leave a Comment