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
Revision as of 14:26, 20 April 2012 (edit) (undo)
Cwadmin (Talk | contribs)

Next diff →
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
 +
 +# 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
 +
[[Category:Control Panel]] [[Category:Control Panel]]

Revision as of 14:26, 20 April 2012

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

  1. rsync -vrplogDtH /mnt/oldprimary/usr/local/apache/conf /usr/local/apache
  2. rsync -vrplogDtH /mnt/oldprimary/var/named /var
  3. rsync -vrplogDtH /mnt/oldprimary/home/* /home
  4. rsync -vrplogDtH /mnt/oldprimary/usr/local/cpanel /usr/local
  5. rsync -vrplogDtH /mnt/oldprimary/var/lib/mysql /var/lib
  6. rsync -vrplogDtH /mnt/oldprimary/var/cpanel /var
  7. rsync -vrplogDtH /mnt/oldprimary/usr/share/ssl /usr/share
  8. rsync -vrplogDtH /mnt/oldprimary/var/ssl /var
  9. rsync -vrplogDtH /mnt/oldprimary/usr/local/cpanel/3rdparty/mailman /usr/local/cpanel/3rdparty
  10. rsync -vrplogDtH /mnt/oldprimary/var/log/bandwidth /var/log
  11. rsync -vrplogDtH /mnt/oldprimary/usr/local/frontpage /usr/local
  12. rsync -vrplogDtH /mnt/oldprimary/var/spool/cron /var/spool
  13. rsync -vrplogDtH /mnt/oldprimary/root/.my.cnf /root
  14. rsync -vrplogDtH /mnt/oldprimary/etc/httpd/conf/httpd.conf /etc/httpd/conf
  15. rsync -vrplogDtH /mnt/oldprimary/etc/sysconfig/network /etc/sysconfig

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

  1. cd /mnt/oldprimary/etc
  2. 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