Procedure
Restorepkg can restore a WHM-generated backup using either a username or a path to a backup file. This script must be run as the root user via the command line. The script can simply accept a file path:
/scripts/restorepkg /path/to/uploaded/backup/file/cpmove-$CPANELUSER.tar.gz (Ex: /scripts/restorepkg /home/foodfatima/public_html/backup-2.3.2025_21-12-37_generich.tar.gz)
Or, if a username is provided:
/scripts/restorepkg $CPANELUSER
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: