Introduction
Restorepkg is the command-line utility used to restore cPanel backups. Knowing how to use the restorepkg script allows you to restore cPanel backups without logging into WHM.
Procedure
Restorepkg can restore a WHM-generated backup using either a username or a path to a backup file.
/scripts/restorepkg $CPANELUSER
/scripts/restorepkg /path/to/backup/cpmove-$CPANELUSER.tar.gz
If you do not use the path to the backup file, a cPanel-generated backup must be located in one of the following directories:
- /home
- /home2
- /home3
- /root
- /usr
- /usr/home
- /web
Restorepkg will search the directories listed above for files matching the following patterns:
- cpmove-{USER}
- cpmove-{USER}.tar
- cpmove-{USER}.tar.gz
- {USER}.tar
- {USER}.tar.gz
- backup-{MM.DD.YYYY}{HH-MM-SS}{USER}.tar
- backup-{MM.DD.YYYY}{HH-MM-SS}{USER}.tar.gz
Additional information regarding this script can be found in the WHM documentation: