Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
cpanel:restore-from-crash-or-hack [2011-09-16 04:11:21]
garrett.plasky Approved
cpanel:restore-from-crash-or-hack [2015-01-20 02:00:56]
rory.blanchard
Line 14: Line 14:
 Let's begin by syncing over important /etc/ configuration files: Let's begin by syncing over important /etc/ configuration files:
  
-<sxh plain>cd /olddrive/etc/ && rsync -avHz user* trueuser* domainips secondarymx domainalias valiases +<sxh plain> 
-vfilters exim* backupmxhosts proftpd* pure-ftpd* logrotate.conf passwd* group* *domain* *named* wwwacct.conf +cd /olddrive/etc/ 
-cpbackup.conf cpupdate.conf quota.conf shadow* *rndc* ips* ipaddrpool* ssl hosts spammer* +rsync -avHz user* trueuser* domainips secondarymx domainalias valiases vfiltersexim* backupmxhosts proftpd* pure-ftpd* logrotate.conf passwd* group* *domain* *named* wwwacct.conf cpbackup.conf cpupdate.conf quota.conf shadow* *rndc* ips* ipaddrpool* ssl hosts spammer* skipsmtpcheckhosts relay* localdomains remotedomains my.cnf /etc 
-skipsmtpcheckhosts relay* localdomains remotedomains my.cnf /etc</sxh>+</sxh> 
 <note tip>You may also want to copy <c>/etc/crontab</c> and <c>/etc/cron.d/</c> if you have custom cron scripts.</note> <note tip>You may also want to copy <c>/etc/crontab</c> and <c>/etc/cron.d/</c> if you have custom cron scripts.</note>
  
Line 81: Line 82:
  
 Since this is a "new" install of cPanel, you'll have to run through the WHM Setup Wizard once again upon first login. Just enter the settings as you prefer them/as they were before. If you do not recall some of your previous settings such as nameservers, hostname, or contact email, they can all be found in /etc/wwwacct.conf. Since this is a "new" install of cPanel, you'll have to run through the WHM Setup Wizard once again upon first login. Just enter the settings as you prefer them/as they were before. If you do not recall some of your previous settings such as nameservers, hostname, or contact email, they can all be found in /etc/wwwacct.conf.
 +
 +===== Mail Sync =====
 +
 +If you have recovered from a recent backup or otherwise have a stale copy of your data and want to synchronize mail from another server, you can do so over the network with the following command:
 +
 +<code>
 +for i in  `cat /etc/trueuserdomains|awk '{print $2}'`;do rsync -avHz -e "ssh" --progress /home/$i/mail/* ip.ip.ip.ip:/home/$i/mail;done
 +</code>
 +
 +In the example above the command is run from the source machine where ip.ip.ip.ip is the destination machine. Since this loops through all the users, it's going to ask you for a password each time. To avoid this authenticate the source machine using an ssh key before running the command:
 +
 +<code>
 +ssh-keygen –t rsa
 +ssh-copy-id root@ip.ip.ip.ip
 +</code>
 +\\
 +\\
  
 ===== Notes ===== ===== Notes =====