How to restore Cpanel account backup.

imran_khan

Well-Known Member
Jun 10, 2013
154
1
16
cPanel Access Level
Root Administrator
Hello,

I have deleted user “xyz” from the WHM. Now I want to restore it.
This account has been deleted on 2nd July 2013 and this account showing in daily, weekly and monthly backup.
Daily backup updated today, monthly and weekly backup updated on 5 July 13. Now I have two queries.

1). Is this correct backup of “xyz” account because account deleted on 2nd July 2013.
2). If it is OK. Then how to restore it. Is below procedure is OK?

# /scripts/restorepkg xyz

Thanks,
Imran Khan.
 

24x7server

Well-Known Member
Apr 17, 2013
1,907
95
78
India
cPanel Access Level
Root Administrator
Hello,

Yes, you have correct backup in your daily, weekly and monthly folder because cpanel backup system is not deleting the backups from daily, weekly and monthly directory if the account is not present on the server as cpanel backup system is just overwrite the current user backups which are present on your server

And you can restore the cpanel backup through command line and WHM, If you want to restore it through command line use the following command

/scripts/restorepkg /YOUR/BACKUP/FILE/PATH

Ex

/scripts/restorepkg /backup/cpbackup/daily/xyz.gz
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,913
2,201
363
Hello :)

If you are using cPanel 11.38, the option to restore legacy backups is available at:

"WHM Home » Backup » Legacy Restore Backups"

Or, you can restore it through the command line:

Code:
/scripts/restorepkg /backup/cpbackup/daily/username.tar.gz
Thank you.
 

imran_khan

Well-Known Member
Jun 10, 2013
154
1
16
cPanel Access Level
Root Administrator
Hello,

Thanks guys. I have copied the xyz.tar.gz backup file in /home/ directory and run the below command and restored backup successfully.

#/scripts/restorepkg xyz

Thanks,
Imran khan.
 

24x7server

Well-Known Member
Apr 17, 2013
1,907
95
78
India
cPanel Access Level
Root Administrator
Yes, When you try to restore the account with user name, cPanel account restore script is checking the user backup file in following directory

Code:
/home
/home2
/home3
/root
/usr
/usr/home
/web