Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm using CrashPlan backup my VPS and I need to know what folders would be essential if I needed to restore my server to a new box? And what files can definitely be excluded?

share|improve this question
add comment

1 Answer

Source here.

Since the actual list of files and folders to rsync hasn't been noted, I'll provide a list of the files and folders I've used personally for cPanel rsyncs in the past:

/etc/domainips
/etc/exim.conf
/etc/exim.crt
/etc/exim.key
/etc/exim.pl.local
/etc/exim/
/etc/group
/etc/ips
/etc/localdomains
/etc/my.cnf
/etc/passwd
/etc/proftpd/
/etc/quota.conf
/etc/rc.local
/etc/resolv.conf
/etc/shadow
/etc/sudoers
/etc/trueuserdomains
/etc/userdomains
/etc/valiases/
/etc/vdomainaliases/
/etc/vfilters/
/etc/vmail/
/etc/wwwacct.conf
/home
/root/.my.cnf
/usr/java/
/usr/local/apache/conf/
/usr/local/apache/htdocs/
/usr/local/cpanel/3rdparty/mailman/archives/
/usr/local/cpanel/3rdparty/mailman/lists/
/usr/local/cpanel/base/frontend/lp/
/usr/local/cpanel/cpanel.lisc
/usr/share/ssl/
/var/cpanel/
/var/lib/mysql/
/var/lib/pgsql/
/var/named/
/var/spool/cpcpan/
/var/spool/cron/

After rsyncing, if your machines are on different OS or architectures, please remove the following file on the new server:

Code:
/var/cpanel/sysinfo.config
That file contains data on the old server's OS and architecture and is not interchangeable between systems.

If the old server IPs will be used for the new server, you might well want these files (be careful copying these otherwise as they'll change your main server IP to the old server's IP and should only be copied if you intend to switch to the new server shortly after a reboot with the old IP becoming the main IP on that new server):

Code:

/etc/sysconfig/network
/etc/sysconfig/network-scripts/ifcfg-eth0
After you copy over these files and folders, then you would want to rebuild Apache. The above files should include all the user data you need.

Normally, I would then create a file in /tmp on the new server called movelist and include the files and folders, then I would run the following command on the new server:

Code:

for file in cat /tmp/movelist ;do rsync --archive --verbose --rsh=ssh oldserverIP:$file
$file --exclude '/var/cpanel/sysinfo.config' ;done

Replacing oldserverIP with the IP for the old server.

Please note that you cannot use cpmove or cPanel restore files when using this method as the two methods are not interchangeable. It is either cPanel backups and restores or rsyncs. This is because the cPanel backups when being restored on a system presume the account doesn't have files or folders already existing for the data. If the account exists in any fashion (the username in /etc/passwd, /home/user/ exists, and so on), then the cPanel backup cannot restore via WHM on that system, although you can force a restore in root SSH using the --force flag.

I also would highly suggest using dumps for MySQL data instead of this method if you have InnoDB MySQL database tables. If MySQL is running when you do an rsync like this for backups, the /var/lib/mysql/ibdata1 file might corrupt. A corrupted InnoDB table or tables can cause MySQL to not start, so you are risking MySQL not working by using an rsync. It's better to get a dump of the databases on top of the rsync for MySQL.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.