Complete Re-Install: Disaster Recovery Example

niatech

Well-Known Member
Feb 20, 2005
121
0
166
Hello all,

Last night I decided to upgrade one of our server's OS to CentOS 4.4 from Fedora Core 2. I thought I would post what I did to complete this task and hopefully it will help someone out.

I called the post Disaster Recovery Example, because, basically these are the tasks we would need to do if a server crashed, assuming we had good backups ;)!

Anyhow, here are the tasks we performed. Please feel free to comment/update.

0. Document any additional software installed on the server as well as any
special bash scripts or cronjobs you had created. Also, backup any non-CPanel
accounts (as they are not backed up via cpbackup). Backup your Apache/PHP configuration.
1. Ensure the max load on the server is set high (for increased backup speed) in
WHM->Tweak Settings
2. Shut down all services using CPanel service manager
3. Shut down chkservd using console
4. Ensure your backup is configured for a COMPLETE backup, not incremental,
Ensure you are backing up the whole MySQL directory as well as per account.
5. Run /scripts/cpbackup from console
6. Copy backups to a location off of the server (we had a backup box)
7. Restart the server and re-install your OS (in our case, CentOS 4.4)
8. After OS install, run yum update
9. After update, install CPanel
10. Restore /dirs/_var_cpanel.tar.gz
12. Delete all the files in /var/cpanel/users/*
13. Restore /files/_etc_ips.gz
(watch out here, these files are not tarred, just gzipped, use gunzip)
14. Perform a Multi-Restore in WHM for all the user accounts
(just select the whole left column, leave the rest of the checkboxes, as default,
here is where your IP configuration per domain is restored).
15. Rebuild apache and php as you had them before
16. Restore /dirs/_usr_share_ssl.tar.gz (for any SSL sites you had)
17. Restore /dirs/_usr_local_frontpage.tar.gz (for any frontpage sites)
16. Restore /files/_usr_local_apache_conf_apache_conf.gz
(Another gzipped file, use gunzip)
17. Restart Apache
(!! If apache does not restart, then goto Addon Modules and uninstall and re-install
any apache addon modules you had installed, ie: modbandwidth, modsecurity, pro
<includes leechprotect>, then restart Apache again)
18. Restore /dirs/_var_named.tar.gz
19. Restore /files/_etc_named_conf.gz
(Another gzipped file, use gunzip)
20. Restart named
21. Restart your server (I had IP configuration issues)
22. Configure your server mail settings (I was not receiving root's mail until I did this)
in WHM->Change System Mail Preferences
23. Install any additional software you had installed using yum, pear or perl, etc.

That is all we've done so far and the server seems to be running fine, with a few minor glitch's (ZendOptimizer not installed, etc).

Total time for install (until the time I left, and I took my time and traversed carefully), 4hrs.

Thanks goes to Chirpy, for his original post which I worked from:
http://forums.cpanel.net/showthread.php?p=253694#post253694
 

PacoSS

Member
Jan 21, 2004
21
0
151
I'm restoring a hacked server from the secondary (backup) harddisk with daily, weekly and monthly full backup done.
I see all the required data wroten in this post perfectly, the backup isn't gzip'ed (the home dirs, mysql backups, /dirs and /files, ...).

In the step 14, no users or account appears in the screen, so I can't restore any account. Restore program see the /backup (configured previously in backup options) directory perfectly, cause it ask me for daily, weekly or monthly (if do not mount the disk, a error is given).

So I have 300 customers burning my phone, I'm desperated.
 

niatech

Well-Known Member
Feb 20, 2005
121
0
166
Click on "daily" (or monthly, etc, depending on which backup you wish to use) then you should see the list of accounts that you wish to restore.

And you are correct about the gzipped part. The user's home directories and system dirs are all tarred and gzipped (depending on configuration?) and just the configuration files are gzipped and not tarred.

Ciao
 

PacoSS

Member
Jan 21, 2004
21
0
151
Click on "daily" (or monthly, etc, depending on which backup you wish to use) then you should see the list of accounts that you wish to restore.
No.

I see the new screen, with all the options up (user, select columns, ...) with NO users or data at all.

None of the backup files are gziped, I supossed that it was choosen so in the backup parameters.
But ALL the data is there, I can see all perfectly, but Cpanel doesn't see any user or domain to restore.
 

niatech

Well-Known Member
Feb 20, 2005
121
0
166
In your backup configuration now, do you have it setup the same as you had before? (ie: same options as well as same location?, If so, have you copied your backups to this location?)
 

PacoSS

Member
Jan 21, 2004
21
0
151
Thanks, niatech, that was.

All the backup options must be the same, including some of ftp backup (that I never used).
The location & type of backup was perfectly.
Now, I can see the accounts and i'm restoring ... and breadthing