Importing Complete, Reseller, Site, or User's Data from a Backup

To import complete, reseller, site, or user's data from a backup, use the vhimport script.

Syntax

/usr/local/bin/vhimport
  -r|--role=appliance
  reseller:<reseller name or id>
  siteadmin:<domain name or site id>
  siteuser:<user@domain or user@site id>
  [-t|--target=<reseller name or id>]
   [-t|--target=<domain name or site id>]
   [-t|--target=<user@domain or user@site id>]
   [--restore-user-configs] [--restore-site-configs]
   [--restore-reseller-configs] [--overwrite-data]
   [-U|--URL=<source URL>] [-R|--recurse]
   [-f|--url-info-file=<file>]
   [-S|--services service1,...]
   [-d|--decrypt] [-A|--algo=<algorithm>] [-k|--key-from-
fd=<fd>]

If the role argument is not appliance, you must specify additional information to identify the reseller, site administrator, or site user on whose behalf the import is being performed.

If only importing a single file, you may specify the intended target of the import. For example, if the role was set to appliance or reseller, the user would be able to import a backup made from site A into an existing site B, by specifying site B as the target. Targets may only be specified for imports where the imported entity has fewer privileges than the importing role, and the importing role must control the intended target. That is, an appliance may specify any target for reseller, site, or user imports, whereas a reseller may only specify a target for site or user imports, and the target must be a site or user under his or her control.

If a target is not specified, the target will either be assumed from the role argument or from the import data. For example, if the role was set to reseller and the import file was a reseller backup, then the target would be the reseller given with the role identifier. If the import file had been a site backup, then the target would be the domain described by the import file, and will be allowed as long as the specified reseller owns that site, or the site does not exist.

The --overwrite-data option signifies that the import should overwrite existing data. If not specified, only data present in the import but not in the target will be restored. Note that this flag does not affect reseller, site, or user configurations.

The --restore-user-configs option signifies that if any user imports are encountered, and the user currently exists, then the user's configuration will be set to the configuration saved in the archive. Without this option, an existing user's configuration will not be changed.

The --restore-site-configs option signifies that if any site imports are encountered, and the site currently exists, then the site's configuration will be set to the configuration saved in the archive. Without this option, an existing site's configuration will not be changed.

The --restore-reseller-configs option signifies that if any reseller imports are encountered, and the reseller currently exists, then the reseller's configuration will be set to the configuration saved in the archive. Without this option, an existing reseller's configuration will not be changed.

The --restore-all-configs option is equivalent to specifying --restore-user-configs --restore-site-configs --restore-reseller-configs together.

The --recurse option will cause any imports made at the same time as one of the imports specified on the command line to be imported as well. For example, if a user exported everything on the server (complete, resellers, sites) in a single invocation of vhexport, then all the user would have to do to completely recover the system is import the complete backup by specifying the --recurse option.

-f|--url-info-file specifies a file that contains additional information to be used with any URLs specified. It is generally not safe to include a password on the command line; you can use this option to point to a file that contains the password information. Note that if you choose to do this, you should make sure that the file is readable only by you. The file may contain two or three bits of information; host and user are mandatory, and pass is optional. An example file might contain:

-c|--crypt specifies that the import data is encrypted and must be decrypted before being restored. If the -k|--key-from-fd option is not specified, you will be prompted to enter a passphrase. -k|--key-from-fd may be used to specify a file descriptor from which the passphrase may be read. If set to 0, this will be equivalent to reading from standard in. -a|--algo allows you to change the cipher algorithm used (this option is not currently supported; that is, there is only a single type of cipher). Note that you must use the -U|--URL argument to specify the import source if you don't use the -k|--key-from-fd option, or if you set the -k|--key-from-fd option to 0.