For cPanel & WHM 11.46
Overview
The /scripts/restorepkg
script restores a backup archive for a specified account.
Note:
- You can also restore a backup with WHM's Restore a Full Backup cpmove File interface (Home >> Backup >> Restore a Full Backup/cpmove File).
- This Script restores suspended accounts in an unsuspended state. Use WHM's Manage Account Suspension interface (Home >> Account Functions >> Manage Account Suspension) or call the WHM API 1 Functions - suspendacct function to suspend the account again.
How to call the script
To run the restore package script at the command line, run the following command as the root
user:
/scripts/restorepkg [arguments] [input] [filename]
Note:
Replace argument
with one or more arguments from the /scripts/restorepkg
script's list of arguments.
File formats and archive locations
The filename of the backup must use one of the following formats:
cpmove-{USER}
cpmove-{USER}.tar
cpmove-{USER}.tar.gz
{USER}.tar
{USER}.tar.gz
backup-{BACKUP-DATE_TIME}_{USER}.tar
backup-{BACKUP-DATE_TIME}_{USER}.tar.gz
Important:
Incremental backup files must use the cpmove-{USER}
format.
The restore package script searches for the archive in the following locations:
/home
/home2
/home3
/root
/usr
/usr/home
/web
After the script locates the correct archive, it will attempt to restore the account with the shared IP address.
Available arguments
The table below lists the arguments that the /scripts/restorepkg
scrips accepts.
Argument | Description | Input Type |
---|---|---|
--force | 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. | N/A |
--allow_reseller | This argument allows the script to restore reseller privileges. | N/A |
--ip | This argument specifies which IP address you will use to restore the account. | string (See below for usage instructions) |
--newuser | This argument allows you to change the username for the account that you restore. Note:
| string |
--skipaccount | This argument allows you to restore a package for an existing account with the same username as another existing account. | N/A |
--skipres | This argument was deprecated in cPanel & WHM version 11.44. If your legacy script uses this argument, it will perform the opposite of the --allow_reseller argument. | N/A |
--override | This argument was deprecated in cPanel & WHM version 11.44. If you wish to use override scripts, create them in the /var/cpanel/perl/Whostmgr/Transfers/Systems/ directory. |
Use the --ip argument
The --ip
argument takes one of the following options:
Option | Description |
---|---|
=y | 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. |
=n | This option uses the shared IP address to restore the account. |
A specified IP address | 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 cpmove-
testaccount.tar.gz192.0.30.10
:
/scripts/restorepkg --ip=192.0.30.10 cpmove-testaccount.tar.gz