Mirroring a cpanel account

bleachga

Member
Nov 14, 2003
11
0
151
I have two servers running WHM/cpanel. The second server is supposed to function as a backup server for the first one, in case the first one crashes or otherwise becomes unavailable.

I'm using rsync to mirror the website nightly, and mysqldump to backup the critical databases. I can't use the cpanel export/import method; the website is simply too large to transfer every night; rsync solves that problem nicely.

My question: is there a guide somewhere on how I can move things like email accounts, forwarders, mailing lists, protected web directories, etc.? Or, is there an easy way to accomplish what I'm trying to accomplish?
 

madaboutlinux

Well-Known Member
Jan 24, 2005
1,051
2
168
Earth
Do you want the second server as the exact replica of the first one OR you are just looking to create backups on the second server and then extract it whenever needed? If you are looking to setup the second server as it is, rsync the following directories from the first server:

/home
/var/lib/mysql
/usr/local/apache/conf
/var/named
/etc/*named*
/etc/rndc.conf
/etc/rndc.key
/usr/local/cpanel/3rdparty/mailman
/var/log/bandwidth
/var/spool/cron
/var/cpanel
/var/cpanel/cpanel.config
/usr/local/cpanel/etc/cpanel.config
/etc/remotedomains
/etc/ssldomains
/etc/userdomains
/etc/localdomains
/etc/domainusers
/etc/valiases
/etc/vfilters
/etc/proftpd*
/etc/pure-ftpd*
/etc/passwd
/etc/group
/etc/shadow
/etc/cpupdate.conf
/etc/ssl
/etc/true*
/etc/wwwacct.conf
 

Rick C

Member
Aug 19, 2007
8
0
51
Hi I am looking to do this
so this would mirror the whole cpanel server?

So what is the best way to go about this?

I have 1 cpanel server, do i just setup a 2nd server install cpanel then rsync the above and it will pull all the accounts over or do i need to copy them over?

can i rsync the whole lot in one command?

Would this do databases also?

Thanks

Rick
 
Last edited:

bleachga

Member
Nov 14, 2003
11
0
151
madaboutlinux:

I'm not trying to replicate the whole server, just one or two domains. Your answer did give me what I was looking for: the "magic" locations where the Linux and WHM/cpanel config files live.

Thanks!

Do you want the second server as the exact replica of the first one OR you are just looking to create backups on the second server and then extract it whenever needed? If you are looking to setup the second server as it is, rsync the following directories from the first server:

/home
/var/lib/mysql
/usr/local/apache/conf
/var/named
/etc/*named*
/etc/rndc.conf
/etc/rndc.key
/usr/local/cpanel/3rdparty/mailman
/var/log/bandwidth
/var/spool/cron
/var/cpanel
/var/cpanel/cpanel.config
/usr/local/cpanel/etc/cpanel.config
/etc/remotedomains
/etc/ssldomains
/etc/userdomains
/etc/localdomains
/etc/domainusers
/etc/valiases
/etc/vfilters
/etc/proftpd*
/etc/pure-ftpd*
/etc/passwd
/etc/group
/etc/shadow
/etc/cpupdate.conf
/etc/ssl
/etc/true*
/etc/wwwacct.conf