SOLVED Restoring System Files from Backup

Alastair S

Registered
Aug 5, 2016
4
0
1
Auckland
cPanel Access Level
Root Administrator
Hi team,

Could someone please advise me on how to restore the system files backup I got from my server.

I have found the file, I would FTP it back to the server for the most up to date. But I am unsure on where I tell it to restore.

Thanks in advance everyone!
 

Macs R We

Member
Mar 17, 2015
15
2
53
Arizona
cPanel Access Level
Root Administrator
I don't really find the responses here at all helpful. They boil down to:

1. System backup files are restored manually.
2. We don't recommend you actually do it (we don't provide a rationale or an alternative).
3. See this link, which provides only the guidance already given in 1.

I am forced to go through a system backup / restore cycle because my hosting provider must upgrade the OS on my VM due to an upcoming end-of-life on support.

I take backups religiously, but nobody at the hosting provider can tell me whether simply restoring one on the new version OS will give me turnkey restoration, or whether I will have to do additional things by hand (and if so, what).

I have found plenty of CPanel/WHM documentation that says, "cPanel & WHM does not include an interface to restore system backup files. To restore content from system backup files, you must perform the restoration manually," but none that provides any reference to HOW to perform it manually. Since the command to make the backups is "/usr/local/cpanel/bin/backup" (a cpanel command) I am thinking that the restoration command would also be specific to cpanel, yet I can't find any documentation for one. In that directory, I see backup_restore_manager and restorepkg, but they both seem to be for account level restoration.

I am used to systems where you can upgrade OS levels without entirely wiping the system back to day zero, and it's terrifying to be forced stumbling into this morass, where I don't know what isn't going to work until it's too late to fix it.

How do I achieve what I need to achieve here?
 

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
2,280
303
213
cPanel Access Level
Root Administrator
Hey there, @Macs R We

When it says that cPanel doesn't include any tools to perform the system file restores it means *any* tools, command line, script, or interface. For example, if you wanted to restore the MySQL configuration, you would need to extract the backup file from your backup at /backup/weekly/2020-11-22/system/files/_etc_my.cnf.gz and then copy that over to the /etc/my.cnf location.

Unfortunately the CentOS upgrade tools aren't quite that robust, so reinstalling the entire OS is the best way to get that working to ensure a positive experience with all the server tools.

Let me know if that helps to clear things up!
 

Macs R We

Member
Mar 17, 2015
15
2
53
Arizona
cPanel Access Level
Root Administrator
Ugh, no, it just deepens the pit in my stomach.

Are you telling me that there is no tool -- not even a native tool on CentOS -- that will take the backups generated via WHM and just slam everything back to where it was before? That's terrifying! I have no clue how to disassemble a backup by hand and place all of its items wherever they are supposed to go. That's one of the things we supposedly use computers to do for us, no?

I don't have a very complicated configuration. One account, several websites, no SQL, a dozen or so mailboxes, a few dozen forwarders. The more I pursue this issue, the more i'm hearing that what should be a simple OS version upgrade is going to turn into a gigantic manual ditch-digging project.

Seriously, how do the rest of you guys approach this?
 

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
2,280
303
213
cPanel Access Level
Root Administrator
You just have one account to move with no databases? The only reason you'd need to move anything that is not included in an account backup, is the EasyApache 4 profile settings. If you can create an EasyApache profile and download that locally (details on how to do that can be found here: EasyApache 4 Interface | cPanel & WHM Documentation) then the account backup itself will have all your data, and the EA4 profile file will get your PHP versions and modules setup on the system.

We also have a really nice page here that gives a more thorough outline of moving systems, if you haven't already read that over: How to Move All cPanel Accounts from One Server to Another | cPanel & WHM Documentation
 

Macs R We

Member
Mar 17, 2015
15
2
53
Arizona
cPanel Access Level
Root Administrator
Thanks for your help.

I've converted my current EasyApache 4 config to a transfer profile as you suggested, and copied it to an offhost location. The contents seem well-formed. I've also copied over the /etc/ssl folder just in case I need it.

It sounds like the steps needed are to get cPanel/WHM on the new VM (the hosting provider will do that, and I suspect it will be a current version, NOT v86.0.3 which I am running now); transfer and load the EasyApache 4 config; transfer and restore the single account; test mail in and out and see if I need to restore /etc/ssl or not; and then hopefully Bob's Your Uncle.

A few questions remain:
  1. The transfer instructions you gave me say it is important that "The replacement cPanel & WHM server should contain identical software to the original server." I don't believe that's under my control. How much trouble am I going to be in if it isn't?

  2. If I end up needing to restore /etc/ssl, do I have to ping the configuration somehow, restart the VM, or do something else to get it picked up and used, or will it just get picked up when it shows up?

  3. The EasyApache control page in WHM warned me that I had PHP 5.4, 5.6, 7.0, and 7.1 installed and that I shouldn't continue to use EOL software. There are no newer PHPs in the config, I suspect because they belong to the cPanel/WHM suite that isn't supported on CentOS 6.10 and has been failing to update. I don't think any PHP I have is version-dependent, but if so that is an upgrade problem I would expect to eat. What I need to know beforehand is that when the hosting provider gives me the new VM running CentOS 7, and those "obsolete versions" of PHP (maybe) aren't present, will attempting to load my transfer profile blow up and fail? (I'm assuming this might be possible due to the answer to question #1.)
 

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
2,280
303
213
cPanel Access Level
Root Administrator
1 - It depends. You'll want the same PHP version for sure if at all possible, which you'll get when you restore that EA4 profile.
2 - That shouldn't matter at all. SSL certs for your domain(s) will be included in the backup, and you'll get an entirely new hostname certificate through AutoSSL. In all the migrations I've done I've never had to move that area.
3 - You can still install those older versions on the new system, we just recommend that people seriously consider working with their clients to get their software updated to more modern versions at this point.
 

Macs R We

Member
Mar 17, 2015
15
2
53
Arizona
cPanel Access Level
Root Administrator
Thanks.

As for #3, there's no positive reason I "want" those older versions there -- it's just that they are there now (for whatever reason entirely devoid of any request of mine) and I would hate to have my upgrade restoration fail because they weren't present on the new machine.

It looks like I'll have to get a concession from the hosting provider about installing my current version of cPanel/WHM on the new image -- assuming they even know how to do that, assuming the old version is available somewhere for them to obtain, and assuming I get agreement from them and then their techs don't just go ahead and do what they damn well please regardless.
 

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
2,280
303
213
cPanel Access Level
Root Administrator
In general, there isn't a way to install older versions of cPanel. However, version 86 is in the Long-Term Support tier right now, so that can be installed. Details on how to do that can be found here, so you could provide this to them for when they perform the initial server setup:


As far as the PHP versions, those will get put in place when you restore the EA4 profile, so those will all still be there and work as you expect.
 

Macs R We

Member
Mar 17, 2015
15
2
53
Arizona
cPanel Access Level
Root Administrator
I'm not conversant with the differences between WHM and cPanel release numbers. My current cPanel is 11.86.0.32 (and it won't upgrade further on CentOS 6). I don't know what version is "current" now. Is the current version still in the compatibility range to accept an account reload from 11.86.0.32, or will I have to specify they load a specific cPanel in the new VM?
 

ffeingol

Well-Known Member
PartnerNOC
Nov 9, 2001
494
144
343
cPanel Access Level
DataCenter Provider
11.86.0.32 is the LTS version. The cPanel/WHM 'verson" is the 2nd set of number (86). Per the doc that @cPRex gave it's easy to install the LTS. We do it all the time for customers. You just have set one value in one file before installing cPanel/WHM.
 
  • Like
Reactions: cPRex