jethrodesign

Well-Known Member
Feb 17, 2012
67
2
58
cPanel Access Level
Root Administrator
Hi, we are seeking some guidance here on specific steps or things to be aware of when trying to restore cPanel accounts after a major server crash.

We manage about 25 sites (individual cPanel accounts each) on a server that was setup on a virtual machine instance. It looks like the VM volume that the server was setup under has become completely corrupt and may not be recoverable. We are under the assumption that any WHM automated account backups are most likely also on that same VM volume, or a separate sub-volume. It is unclear whether any of these individual cPanel backups can be recovered either.

So we have manual backups we created from each cPanel account (separate Home dir + Database), though they unfortunately are 6 months old. But it may be all we have to work with.

I believe the nameserver for this old system was mirrored (or may have been a slave) of 2 other nameservers. So I 'believe' the DNS records for these sites may still exist.


- What would be the steps to take to start recreating these accounts from our manual backups if on a completely different & new server and WHM install?


We would just welcome any and all guidance and/or potential issues to watch for when recreating these sites. It will be enough work to restore them all and then try to redo any updates made in the last 6 months.
 

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
12,499
1,971
363
cPanel Access Level
Root Administrator
Hey there! I'm sorry to hear about the issues with the system. The easiest method would be to do this and see if that takes care of everything you need:

-install the OS
-install cPanel
-upload the backup files to /home on the new machine
-use the WHM >> Backup Restoration interface to restore the data
-add the server to the DNS cluster

That's a general outline, but it should get you where you need to go!
 

jethrodesign

Well-Known Member
Feb 17, 2012
67
2
58
cPanel Access Level
Root Administrator
OK, so just a few follow-up questions to make sure we have a good plan.

- Will uploading both the Home directory .tar.gz file and the corresponding database .gz file for each account backup we have cause the Backup Restoration interface in WHM to 'see' the accounts that they are associated with, even though these accounts were never setup on this new server and/or its Backup Configuration?

- And to clarify, the Backup Restoration process will create the cPanel accounts for each backup during the process of restoration? Does it just use whatever the default settings are for new accounts (e.g., disk quota, bandwidth, etc.)?

- If we do this method, would we be able to restore multiple accounts at one time?

Just trying to understand the difference between this and a more manual method of creating the cPanel accounts, then restoring the Home dir and Database files from within each cPanel account.

Thanks!
 

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
12,499
1,971
363
cPanel Access Level
Root Administrator
-Yes, to the accounts, no to the databases. If the databases are completely separate, you'll likely need to restore those manually. (create the database in cPanel, unzip the .gz file, import the database)

-Yes, if these are full account backups, you don't need to create the account first. The backup restore process will take care of that.

-Yes - you'll be able to add multiple accounts to the restore queue and run it all at once.
 

jethrodesign

Well-Known Member
Feb 17, 2012
67
2
58
cPanel Access Level
Root Administrator
Thanks for the continued support here!

-Yes, if these are full account backups, you don't need to create the account first. The backup restore process will take care of that.
OK, that's I think where I'm unclear. We made these backups from each individual cPanel account's BACKUP interface using 'Download a Home Directory Backup' and 'Download a MySQL Database Backup'.

- These aren't considered 'Full Account Backups', correct?

- And if not, does this change the process we have to take to recreate & restore the accounts on this new server?

Thanks again!
 

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
12,499
1,971
363
cPanel Access Level
Root Administrator
Thanks for that information. If it's *just* the home directory backup you'd need to create the cPanel account first and then restore the home directory backup from cPanel, as the WHM tools won't handle that.

Does that help clear things up?
 

jethrodesign

Well-Known Member
Feb 17, 2012
67
2
58
cPanel Access Level
Root Administrator
Thanks for that information. If it's *just* the home directory backup you'd need to create the cPanel account first and then restore the home directory backup from cPanel, as the WHM tools won't handle that.
OK, thanks for clarifying. Yes, I certainly wish we could recover the full account backups that are made by WHM, but it looks like those are long gone...

We'll start creating the new accounts & restoring the Home dir & MySQL backups manually.

DNS:
Regarding DNS, we do want to be sure that existing DNS records are retained so that there is at minimum no disruption in the email for these accounts (which do appear to still be working). The ultimate goal, however, would be that this new server would be the master so that any updates made to DNS records/settings here would take affect and then propagate to other nameservers.

I don't believe the alternate nameservers, which currently retain the existing DNS records, were setup as a DNS cluster or could be, though. More a traditional DNS master & slave setup.

- If this new server was setup as the master for the domains, would the process of creating the accounts cause all DNS settings to become whatever the default is when creating the accounts, thereby overwriting the current/existing DNS records on the alternate nameservers?

- How would we best prevent any potential issues or disruptions here?


Thanks again for the prompt support here! We have 25+ clients waiting patiently to get their website back, we just don't want to risk any further disruptions...
 

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
12,499
1,971
363
cPanel Access Level
Root Administrator
It really depends on how the DNS cluster is configured, and I'm not sure I have enough information to answer that part. If the nameservers for the domains that you'll be restoring already point to an active DNS server where things used to work well, you don't need to worry about anything because any DNS zones that get created on the new WHM will not be used.

If that's how things are setup, I wouldn't worry about trying to configure a cluster until the restore process has been completed. Get the sites up and online, and then worry about the cluster relationship later.
 

jethrodesign

Well-Known Member
Feb 17, 2012
67
2
58
cPanel Access Level
Root Administrator
OK, thank you. We will ask that the existing nameservers, which would traditionally be the slave nameservers, could continue to function for now as we're restoring things.

And again, I don't believe these alternate nameservers will be configured as a true DNS cluster. They weren't with the previous server - they were just DNS slaves with the previous server as master.

- Anyone have any ideas on how we can obtain all DNS records that are currently cached on the alt nameservers?

- There's no way these existing cached records can 'overwrite' the DNS records that are created by default on the new server when setting up the accounts, is there?!?

As we would eventually want this new server to be the DNS master, we will need to update all DNS zone files to match what they are currently, with the obvious exception of this server being set as the SOA and its IP address set for A records.

- Will we just have to manually update each zone file from some sort of master list we can compile?

Thanks for any insight or direction here. This just sounds tedious and risky, as we don't want any disruption to any services the sites currently have, including email, any domain validation done via TXT records, etc.
 

jethrodesign

Well-Known Member
Feb 17, 2012
67
2
58
cPanel Access Level
Root Administrator
Sorry, one more add-on question:

- If we do have to manually update all of the DNS records on the new server, is there any way to have certain common custom records be generated when initially creating the cPanel accounts?

Most of these sites use Google Workspaces for email, calendars, etc. So these will typically have 5 MX records, 5-6 CNAME records, and 1 or more TXT records. Having to manually enter all of these again in the DNS Zone editor would just be very tedious & time consuming...

Thanks!
 

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
12,499
1,971
363
cPanel Access Level
Root Administrator
Without knowing more specifics about your DNS configuration, I'm not able to answer those. DNS slaves and master don't mean much to me.

You can use the WHM >> Edit Zone Templates tool to specify records that get added to each DNS zone you create.
 

jethrodesign

Well-Known Member
Feb 17, 2012
67
2
58
cPanel Access Level
Root Administrator
OK, thank you. I was able to edit a Zone Template and cut back significantly on the manual efforts of adding all of those records.

- There's not a way in WHM to have more than 1 Zone Template to choose from when creating accounts, is there?
What we did here would only be relevant for sites using Google Workspaces for email & other features. But not all new sites will be doing that.

SSL
So far we are just creating the cPanel accounts (no restoration yet). But a lot of the AutoSSL certificates were failing originally. Forcing them to recheck usually fixes it eventually.

- Will restoring the Home directories on these accounts from backups made on another server 6 months ago affect anything in regards to the SSL certificates?

Just wasn't sure if any files that might get restored and/or overwrite default contents may cause issues. Want to make sure we prevent that so sites don't give warning when trying to open.

Thanks again for the assistance here! This is going to be a long process...
 

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
12,499
1,971
363
cPanel Access Level
Root Administrator
-No, you can only have the one zone template at this time. Although having an option to choose from certain zone templates sounds like it could be a good feature request if you'd like to submit one using the link in my signature.

-No, the SSLs will also work fine. If there is any temporary confusion, a new one would be issued quickly.