How can I manually backup/restore an entire WHM/cPanel account?
February 17, 2011 10:54 AM Subscribe
I'm looking for a manual alternative to the WHM's built in "Copy an account..." function.
I'm wondering how to manually carry out the WHM "Copy an account from another server" function. I'm decent with the command line and am comfortable (though admittedly n00bish) writing a script to do this. My purpose is to avoid having to rely upon WHM's black box and know how to perform this type of backup/restore myself. (I'm also not 100% sure that this black box function will backup/restore *everything*.)
What I'd like to do is make complete backups of a small server (CentOS) that I have, so that if it ever dies, I can restore said backups onto another CentOS server (if the server burns to the ground, the built-in WHM option won't be much use, heh). I'd love to just be able to copy/paste files from the backup to the new server, but I know I'll have to do some permissions tweaking. What I'd like to do is get the tweaking down to a minimum so that I can restore the server as quickly as possible if worst comes to worst.
The account I want to back up has several users attached to it, custom software installed under it (which I can re-install if need be) and a fairly complicated permissions system setup for a data repository that said users utilize on a daily basis. It also has several mySQL databases, and I've already got cron scripts that back up the raw data and mySQL databases to a location offsite from the server, but I really want to get something more complete in place so that I'm not scurrying around trying to re-create user accounts and such if I ever need to perform a restoration.
Another thing I have set up is an rsync between a server that is an exact duplicate of the original one, so that all of the raw data is synced up between the two servers under the same user account. I set up the second server identically to the first one, created the same user accounts under the main WHM account, installed the custom software, then just set up an rsync to mirror the primary server's data to the secondary server. Whenever I visit the secondary server to check up on it, everything functions on it just like it does on the primary server. What I don't want to have to do in an emergency (unless I absolutely have to) is go through a long process of replicating the exact user account setup on a brand new server, then copying in the data from a backup. I'd rather have all of the settings and user accounts and data in a tarball and then be able to dump that tarball on the new server, restart a few services and be up and running. I know it'll be more complex than that, but I really just want to minimize my downtime in an emergency.
I've tried googling, but my google-fu has failed me so far in finding manual alternatives to the built-in WHM solution. Step-by-step instructions (even if slightly simplified) would be perfect, but I'll take anything I can get.