Defining Objects for Restoration

Defining objects for restoration includes the following:

  1. Specifying a source backup file.
  2. Defining the level of restored objects.
  3. Applying a filter on the specified level.

Generally speaking, the data that can be restored with one call of the pleskrestore utility are represented by any cell in the following table.

 

Restoration levels specified with the -level option

Server

Resellers

Customers

Subscriptions

 

 

Selected with the -filter option

 

Selected with the -filter option

 

Selected with the -filter option

Backup file

<server>.xml | zip | tar

Full restoration

All reseller accounts

Selected reseller accounts

All customer accounts belonging to administrator

Selected customer accounts belonging to administrator

All subscriptions belonging to administrator

Selected subscriptions belonging to administrator

<reseller>.xml | zip | tar

 

Full restoration of a reseller account

 

All customer accounts belonging to reseller

Selected customer accounts belonging to reseller

All subscriptions belonging to reseller

Selected subscriptions belonging to reseller

<customer>.xml | zip | tar

 

 

 

Full restoration of a customer account

 

All subscriptions belonging to customer

Selected subscriptions belonging to customer

<subscription>.xml | zip | tar

 

 

 

 

 

Full restoration of a subscription

 

Specifying a source backup file

The source backup file defined for restoration can be of one of the following types:

  • <info>.xml - backup metadata file, when restoring from backup located in Plesk's storage.
  • <backup>.<zip|tar> - archived backup file, when restoring from an exported backup.

For example, to restore the whole server backup, you choose a <backup storage root>/<server>.xml file, or an exported server backup file. To restore a client belonging to a reseller, you choose a <backup storage root>/resellers/<reseller ID>/clients/<client ID>/<client>.xml file.

Defining the Level of Restored Objects

Defining the level of restored objects allows you to narrow the amount of restored data according to your needs. For example, you may want to restore only subscriptions which belong to a customer or a reseller, skipping all other data not related to subscriptions.

To define the level of restored objects, use the -level option with an appropriate value. The option is required, so in cases when you do not need any narrowing but just wish to restore all data from a backup, define the level equal to the level of the file.

To restore the entire server:

pleskrestore restore <backup storage root>/<server>.xml -level server

Note: When the whole server backup is restored, license keys are not restored by default. To restore license keys along with other server content, use the -license option in your restore command.

To restore the entire server with license keys:

pleskrestore --restore <backup storage root>/<server>.xml -level server -license

 

To restore all domains belonging to a reseller:

pleskrestore --restore <backup storage root>/resellers/<reseller ID>/<reseller>.xml -level domains

   

To restore all reseller accounts:

pleskrestore --restore <backup storage root>/<server>.xml -level resellers
Applying filter to the specified level

To perform a more selective restore, use a filter (the -filter option) which selects particular objects of the specified level (resellers, customers, subscriptions) to be restored. The objects are specified by their names, which are domain names for subscriptions, and usernames for resellers and customers. The specification can be done as follows:

  • Command line specification. The restore command takes object identifiers as values of the -filter option defined in the following string: list:<item1>,<item2>,...,<itemN>.
  • File specification. The restore command takes the objects identifiers from the file specified as an argument of the -filter option. The file must be in plain text format, and object identifiers are separated by line breaks (that is, one identifier per line).

To restore two resellers from a server backup:

pleskrestore --restore <backup storage root>/<server>.xml -level resellers -filter list:JohnDoe,JaneDoe

or

pleskrestore --restore <upload directory>/<server backup name>.zip -level resellers -filter list:JohnDoe,JaneDoe

 

To restore two subscriptions owned by the server administrator:

pleskrestore --restore <backup storage root>/<server>.xml -level domains -filter list:example.com,sample.org

 

To restore several subscriptions of a customer defined in a file:

pleskrestore --restore <backup storage root>/resellers/SandyLee/clients/JaneDow/<client>.xml -level domains -filter <path to the file>/restore-domains.txt

Next in this section:

Backup File Structure