Restore home directory backup from account root?

sch

Member
Jan 10, 2008
20
0
51
Is it possible to restore a home directory backup [created in cPanel backups] in root of an account that was sent remotely to a new server?
 

JeffP.

Well-Known Member
Sep 28, 2010
164
15
68
Hi sch,

The home directory backup will contain all data under /home/${USER}/ for a cPanel user. It is possible to restore such a backup for an account on another server. To do this, I would place the file in the root of the account as you mentioned, where the root of the account would be "/home/${USER}/".

Next, I would change the permissions of the backup file to that of the user:

Code:
# chown ${USER}:${USER} ${BACKUP_FILE}
Then I would log in as that user:

Code:
# /bin/su -s /bin/bash ${USER}
and finally, I would extract the file:

Code:
$ tar zxvf backup-${DATE}_${USER}.tar.gz
You may want to test this with a test account first, just to be sure that these commands do what you would expect them to.

If you run into any issues, just let us know.

Thanks!
 

sch

Member
Jan 10, 2008
20
0
51
Ok, that would have worked, but appears to be an error somewhere. It got up to one of the databases ad then got this:

tar: Skipping to next header
tar: Exiting with failure status due to previous errors

Is it safe to assume the error is with the last database it was attempting to import? I know that database is quite large and when attempting to import via phpMyAdmin, one of the tables had an error.

If that is the case, can a home directory backup be created minus the database(s)?
 

JeffP.

Well-Known Member
Sep 28, 2010
164
15
68
In my testing, home directory backups don't contain databases. Can you please confirm that the backup you're working with was created via cPanel >> Backups >> Download a Home Directory Backup? Note that there is a separate section below that for downloading database backups: Download a MySQL Database Backup.
 

sch

Member
Jan 10, 2008
20
0
51
Your right. Although I planned on it and didn't, I was thinking I had created and uploaded a home directory backup. I guess the reason for that is when attempting to restore a full backup, I kept getting errors like:

"Sorry, we were unable to transfer the account. Information about zerish's primary domain is either missing or corrupt"

Seems like I can't win for losing.
 

JeffP.

Well-Known Member
Sep 28, 2010
164
15
68
"Sorry, we were unable to transfer the account. Information about zerish's primary domain is either missing or corrupt"
That can happen if the backup was not able to be created properly. For example, if the server ran out of disk space while the backup was being created, that could prevent all data from being written to the backup file.

Do you have root access on the server where the backup for zerish was made? If you'd like, please open a ticket (see my signature) and we'll be happy to take a look.