Page tree
Skip to end of metadata
Go to start of metadata

This document is for a previous release of cPanel & WHM. To view our latest documentation, visit our Home page.

For cPanel & WHM 11.46

Overview

The /scripts/restorepkg script restores a backup archive for a specified account.

Note:

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.

 

ArgumentDescriptionInput Type
--forceThis 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_resellerThis argument allows the script to restore reseller privileges.N/A
--ipThis 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:

  • The new account name cannot already exist on the server.
  • The username must be 16 characters or less, and the first eight characters must be unique on the server.
string
--skipaccountThis argument allows you to restore a package for an existing account with the same username as another existing account.N/A
--skipresThis 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
--overrideThis 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:

OptionDescription
=yThis 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.
=nThis 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 cpmove-testaccount.tar.gz file to the IP address 192.0.30.10:

/scripts/restorepkg --ip=192.0.30.10 cpmove-testaccount.tar.gz