How to restore cPanel backup using ssh
cPanel allows you to backup accounts so you can move them between servers. We’ve covered how to backup a cPanel account using ssh so now we’re going to look at how you restore an account using ssh. Usually, you would use the WHM interface and “restore a full backup” link on the left-hand side but sometimes this isn’t the best way to restore a site. As a default, if you place a backup into any of the following folders on a cPanel server the interface will find the backup and add it as an option to restore.
Restore cPanel backup
Issue the below command swapping the required fields for the characteristics of the backup. In our example, the backup is called cpmove-first2host.tar.gz and we’re not using any of the arguments available. If you wanted to force the backup to deploy you would add –force to the end of the example below.
/scripts/restorepkg cpmove-first2host.tar.gz --$parameter
File formats and backup locations
The filename of the backup must use one of the following formats:
The restore package script searches for the archive in the following locations:
Restore cPanel backup using arguments
The table below lists the arguments that the
/scripts/restorepkg script accepts.
||This argument forces the restore package script to restore the account regardless of any errors or warnings. When the system restores the account, any existing data remains intact on the server.|
||This argument allows the script to restore reseller privileges.|
||This argument specifies which IP address you will use to restore the account.|
||This argument allows you to change the username for the account that you restore.
||This argument allows you to restore a package for an existing account with the same username as another existing account.|
||This argument was deprecated in cPanel & WHM version 11.44. If your legacy script uses this argument, it will perform the opposite of the
||This argument was deprecated in cPanel & WHM version 11.44. If you wish to use override scripts, create them in the
||This option uses the next available IP address in the IP Address Pool to restore the account. If none are available, the script uses the shared IP address.|
||This option uses the shared IP address to restore the account.|
||This option uses the specified IP address to restore the account. If that IP address is not available, the script uses the shared IP address.|
For example, the following command will restore the
file to the IP address:
How was this article?