Migrating Cpanel account data after drive failure

From CyberWurx Customer Wiki

(Difference between revisions)
Jump to: navigation, search
Revision as of 14:13, 20 April 2012 (edit)
Cwadmin (Talk | contribs)
(New page: Category:Control Panel)
← Previous diff
Current revision (14:27, 20 April 2012) (edit) (undo)
Cwadmin (Talk | contribs)

 
(2 intermediate revisions not shown.)
Line 1: Line 1:
 +The following guide was taken from Cpanel support forums and explains the steps necessary to migrate account data and information from one drive to another. This information can be useful any time you need to migrate Cpanel account information from one drive or installation of Cpanel 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/oldprimary
 +* 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
 +<pre>
 +# rsync -vrplogDtH /mnt/oldprimary/usr/local/apache/conf /usr/local/apache
 +# rsync -vrplogDtH /mnt/oldprimary/var/named /var
 +# rsync -vrplogDtH /mnt/oldprimary/home/* /home
 +# rsync -vrplogDtH /mnt/oldprimary/usr/local/cpanel /usr/local
 +# rsync -vrplogDtH /mnt/oldprimary/var/lib/mysql /var/lib
 +# rsync -vrplogDtH /mnt/oldprimary/var/cpanel /var
 +# rsync -vrplogDtH /mnt/oldprimary/usr/share/ssl /usr/share
 +# rsync -vrplogDtH /mnt/oldprimary/var/ssl /var
 +# rsync -vrplogDtH /mnt/oldprimary/usr/local/cpanel/3rdparty/mailman /usr/local/cpanel/3rdparty
 +# rsync -vrplogDtH /mnt/oldprimary/var/log/bandwidth /var/log
 +# rsync -vrplogDtH /mnt/oldprimary/usr/local/frontpage /usr/local
 +# rsync -vrplogDtH /mnt/oldprimary/var/spool/cron /var/spool
 +# rsync -vrplogDtH /mnt/oldprimary/root/.my.cnf /root
 +# rsync -vrplogDtH /mnt/oldprimary/etc/httpd/conf/httpd.conf /etc/httpd/conf
 +# rsync -vrplogDtH /mnt/oldprimary/etc/sysconfig/network /etc/sysconfig
 +</pre>
 +then change to the old etc, and execute all on one line ...
 +<pre>
 +# cd /mnt/oldprimary/etc
 +# 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
 +</pre>
 +Update cpanel afterwards
 +/scripts/upcp
 +/scripts/updatenow
 +/scripts/sysup
 +/scripts/fixeverything
 +
 +original source for this information is found here: http://forums.cpanel.net/f49/help-moving-cpanel-accounts-damaged-disk-163734.html
 +
[[Category:Control Panel]] [[Category:Control Panel]]

Current revision

The following guide was taken from Cpanel support forums and explains the steps necessary to migrate account data and information from one drive to another. This information can be useful any time you need to migrate Cpanel account information from one drive or installation of Cpanel 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/oldprimary
  • 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

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

then change to the old etc, and execute all on one line ...

# cd /mnt/oldprimary/etc
# 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

original source for this information is found here: http://forums.cpanel.net/f49/help-moving-cpanel-accounts-damaged-disk-163734.html

Personal tools