Backing up cpanel and clients

pixelstore

Member
Jun 6, 2012
17
0
51
cPanel Access Level
Root Administrator
Hey! I just moved from Plesk to CPanel and need some help to get started with CPanel. I hope I can find a nice solution here!

So I have a server running CentOS 6 with WHM 11.32.3 (build 19) where I host all my clients. If this server crashes I would like to have an identical backup of the http-files and MySQL on an offsite server. So if the server crashes I can just change the A-record of the domains and then the websites are back on.

I started to read about the clustering functionality within CPanel, but as I understand this is only for DNS, it doesn't copy any files or mysql between servers? Right now I'm using an external nameserver (Anycast DNS) and would probably like to continue with that if you guys don't have another recommendation...

The server is just running web (no mail).

Thank you in advance
 

cPanelTristan

Quality Assurance Analyst
Staff member
Oct 2, 2010
7,607
44
348
somewhere over the rainbow
cPanel Access Level
Root Administrator
Hello,

If you wish to have off server backups using the current implementation, we have FTP backups you can run to a remote machine. Those backups are packaged copies of the accounts, though, and it sounds like you want to clone the server rather than back it up. Is that what you are wanting to do, clone it?

Otherwise, are you wanting instead to load balance it via clustering, which also differs from cloning or backing up a machine. Since all concepts differ in what they do and all three were mentioned, could you please indicate which it is precisely you are wanting? Right now, only backing it up is possible, but we do have various discussions that have already occurred on how to try to clone and how to try to cluster various services.

Thanks!
 

pixelstore

Member
Jun 6, 2012
17
0
51
cPanel Access Level
Root Administrator
Hello,

If you wish to have off server backups using the current implementation, we have FTP backups you can run to a remote machine. Those backups are packaged copies of the accounts, though, and it sounds like you want to clone the server rather than back it up. Is that what you are wanting to do, clone it?

Otherwise, are you wanting instead to load balance it via clustering, which also differs from cloning or backing up a machine. Since all concepts differ in what they do and all three were mentioned, could you please indicate which it is precisely you are wanting? Right now, only backing it up is possible, but we do have various discussions that have already occurred on how to try to clone and how to try to cluster various services.

Thanks!
I want to clone the public_html files and MySQL databases, and maybe also the whole server if that's necessary. If the server goes down I want to be able to quickly change the A-records of the sites to the cloned server. In this way, as I see it, I have both backups and a mirror.

Load balancing is not something I'm looking for, but I'm open for all kind of solutions if you have any ideas.
 

pixelstore

Member
Jun 6, 2012
17
0
51
cPanel Access Level
Root Administrator
Hello,

If you wish to have off server backups using the current implementation, we have FTP backups you can run to a remote machine. Those backups are packaged copies of the accounts, though, and it sounds like you want to clone the server rather than back it up. Is that what you are wanting to do, clone it?

Otherwise, are you wanting instead to load balance it via clustering, which also differs from cloning or backing up a machine. Since all concepts differ in what they do and all three were mentioned, could you please indicate which it is precisely you are wanting? Right now, only backing it up is possible, but we do have various discussions that have already occurred on how to try to clone and how to try to cluster various services.

Thanks!

Did you have any solution for me?
 

cPanelTristan

Quality Assurance Analyst
Staff member
Oct 2, 2010
7,607
44
348
somewhere over the rainbow
cPanel Access Level
Root Administrator
If you want to clone the server, the first step would be to create backups of all the accounts you already have using cPanel and then transfer and extract those accounts onto the new machine. If the new machine has cPanel, you could use WHM > Transfers area to copy all of those accounts.

Once you've done that, the next step would be to rsync the data over. You could use the suggestions in this post to accomplish that task:

http://forums.cpanel.net/f5/rsync-backups-160054.html#post671150

Next, for the cPanel configuration files for WHM, EasyApache and so on, you'd want to copy these files:

http://forums.cpanel.net/f5/process-moving-whm-cpanel-server-new-hardware-184192.html#post831162

For these rsyncs, you'd want to then cron them to periodically run every so often. Otherwise, you would look into something like lsyncd for faster, non-cron based syncing:

lsyncd - Lsyncd (Live Syncing Daemon) synchronizes local directories with a remote targets - Google Project Hosting

For MySQL, I would suggest only using MyISAM for this method rather than InnoDB. You cannot live copy flat files when InnoDB is being used. You could end up corrupting MySQL data if you do that. If you do choose to use InnoDB tables, you'll need to mysqldump the databases to save them rather than relying on flat file syncing or transfers.

Thanks!
 

pixelstore

Member
Jun 6, 2012
17
0
51
cPanel Access Level
Root Administrator
If you want to clone the server, the first step would be to create backups of all the accounts you already have using cPanel and then transfer and extract those accounts onto the new machine. If the new machine has cPanel, you could use WHM > Transfers area to copy all of those accounts.

Once you've done that, the next step would be to rsync the data over. You could use the suggestions in this post to accomplish that task:

http://forums.cpanel.net/f5/rsync-backups-160054.html#post671150

Next, for the cPanel configuration files for WHM, EasyApache and so on, you'd want to copy these files:

http://forums.cpanel.net/f5/process-moving-whm-cpanel-server-new-hardware-184192.html#post831162

For these rsyncs, you'd want to then cron them to periodically run every so often. Otherwise, you would look into something like lsyncd for faster, non-cron based syncing:

lsyncd - Lsyncd (Live Syncing Daemon) synchronizes local directories with a remote targets - Google Project Hosting

For MySQL, I would suggest only using MyISAM for this method rather than InnoDB. You cannot live copy flat files when InnoDB is being used. You could end up corrupting MySQL data if you do that. If you do choose to use InnoDB tables, you'll need to mysqldump the databases to save them rather than relying on flat file syncing or transfers.

Thanks!
Thanks alot!

When I create a new user on the live server, do I have to backup that account and restore it on the backup machine or is that also coming automatically with rsync?

Has anyone tried Unison to sync files?