Restoring backup to another server issue

quanin

Well-Known Member
Aug 18, 2011
117
3
68
cPanel Access Level
Root Administrator
I was testing my backups as I do every so often, which meant spinning up a new server instance, installing CPanel, transferring the backup files, and restoring them to the test server. Previously, I was able to upload the backup files to either /home or /root and have CPanel pick them up. This time, however, CPanel behaved as though they weren't there. Has something changed in the update to 80? Both the live server and the test instance were running 80.4.
 

GOT

Get Proactive!
PartnerNOC
Apr 8, 2003
1,542
207
343
Chesapeake, VA
cPanel Access Level
DataCenter Provider
Are they .gz compressed or are you using incremental? If incremental you need to stick them in their own folder and then set up backups on the new server to point there before they are read.

You can also use the /scripts/restorepkg /path/to/backup/username
 

quanin

Well-Known Member
Aug 18, 2011
117
3
68
cPanel Access Level
Root Administrator
They're .gz compressed. They worked when last I did it, though that was using 76.

FWIW, I ran the backup/restore script on the live server and it picked them up without issue in their respective backup folders, but just sticking the files themselves in /home appears broken.
 

quanin

Well-Known Member
Aug 18, 2011
117
3
68
cPanel Access Level
Root Administrator
That's what I figured, hence the thread. Not worth a support ticket just at the minute, as the server's only alive as long as I need it for testing.
 

quanin

Well-Known Member
Aug 18, 2011
117
3
68
cPanel Access Level
Root Administrator
Additional info:
I was able to reproduce this on the live server, now that I've got a minute at work. Backup restoration does appear broken in 80.4. I created a test user, "debug", on the live server. Logged into that user, and downloaded a full backup. I uploaded that backup to /home, then deleted the test user. I attempted to restore that user, CPanel couldn't find the backup. When I copied the tarball to within my backup directory structure, CPanel found it without issue. For kicks, I copied it into the directory that was created for today's backup. I deleted the tarball from my backup folder, kept the copy in /home, and CPanel forgot the backup existed.

Result: Previously working behaviour (backup files located in /home being restorable within WHM) no longer working. This applies equally to /root, and presumedly other directory structures as well though I haven't tested /home2, /web etc.
 

quanin

Well-Known Member
Aug 18, 2011
117
3
68
cPanel Access Level
Root Administrator
@cPanelMichael: So if I understand correctly, you can no longer do the following as of at least CPanel 76. Please tell me if that information is incorrect.

1: Spin up a clean CPanel server, IE: to recover from an OS drive failure
2: Upload the backups from the old server to either /home or /root on the new server
3: Restore multiple of those backups at once to the new, working server

If this is correct, this should be interpreted as a bug, IMO. I don't necessarily want to go through the restore a full backup/cpmove file interface for every single account I have a backup for. What is the logic for requiring I do so?
 

cPanelMichael

Technical Support Community Manager
Staff member
Apr 11, 2011
47,911
2,233
363
cPanel Access Level
DataCenter Provider
Twitter
Hello @quanin,

You can still perform this task, however we recommend using the command line to do this since the command line is the most common method used to transfer the backup archives to the new server. You'd follow the steps listed under "Step 6" on the document linked below instead of using WHM >> Backup Restoration:

Full Disaster Recovery - cPanel Knowledge Base - cPanel Documentation

Here's the specific command you'd use to restore multiple accounts:

Code:
cd BACKUPDIRECTORY/TYPE/DATE/accounts/
for archive in `ls`; do /scripts/restorepkg $archive; done
Note you can still use WHM >> Backup Restoration if you prefer, however to use this feature you must first enable account backups and the Retain Backups in the Default Backup Directory setting in WHM's Backup Configuration (WHM >> Home >> Backup >> Backup Configuration) interface. Then, once you've moved the backups to the correct location and restored them, open WHM >> Backup Configuration and enable/disable your preferred settings.

Thank you.