Exporting Complete, Reseller, Site, or User's Data

To export complete, reseller, site, or user's data, use the vhexport script.

Syntax

/usr/local/bin/vhexport
  -h|--help
  -a|--appliance-info
  -r|--reseller reseller1[,info][,site1,site2,...,site< n>]
  -s|--sites site1,site2,...,site< n>
  -u|--users site1,user1,user2,...,user< n> ...
  -u|--users user1@domain.com,user2@domain.net,... ...
  [-U|--URL <destination URL>] [-f|--url-info-file=<file>]
  [-t|--split-threshold <size>]
  [-z|--compressed]
  [-c|--crypt] [-A|--algo=<algorithm>] [-k|--key-from-fd=<fd>]

Note: Individual exports will be made for each reseller, site, and user specified. Note that site exports include the necessary information to recreate users when imported. When specifying a <destination URL>, the proper '.tar.gz' or '.tar' ending will automatically be added to the end of the URL, based on whether compression is set or not, respectively.

The <destination URL> may also contain format specifiers for the purpose of automatically generating URLs when one or more exports are being made with a single invocation.

The following time-related format specifiers are allowed (these are the format specifiers as understood by the server's C library strftime() function; see the strftime() manual reference for more information):

In addition, the following format specifiers allow you to include information about the type of export being made:

For example, the command:

vhexport -u joe@mydomain.com,bob@yourdomain.net -U file:///tmp/%H_%t_%N_%Y_%B_%

on the server examples1.ensim.com will result in the following exports being created (assuming the date is December 23, 2002):

/tmp/examples1.ensim.com_user_joe@mydomain.com_2002_December_23.tar

/tmp/examples1.ensim.com_user_bob@yourdomain.net_2002_December_23.tar

If the -z option was specified, the resulting exports would be as follows:

/tmp/examples1.ensim.com_user_joe@mydomain.com_2002_December_23.tar.gz

/tmp/examples1.ensim.com_user_bob@yourdomain.net_2002_December_23.tar.gz

-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; pass is optional.

An example file might contain:

-t|--split-threshold-size determines how large each output file is allowed to grow before another output file is started, and may only be specified if the -U|--URL argument is specified too. The argument must be a number optionally followed by a unit; the unit may be any one of b (1), kd (1000), k (1024), md (1,000,000), m (1,024,768), gd (1,000,000,000) or g (1,073,741,824), and defaults to "m". This option is useful when exporting a large site or user, and the target server cannot handle files that are larger than a certain size.

For example, assume the site example.com would consume 3 GB of space, but the destination server cannot handle files larger than 1 GB. The command:

vhexport --sites example.com -U ftp://mybackupserver.com/%t_%N -t 1g

will result in the following files being created:

When importing, only the first URL in the above list should be specified. The import process will automatically attempt to retrieve the other files.

-c|--crypt specifies that the resulting export data should be encrypted before being written to the destination. A symmetric cipher is used. 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 export destination if you don't use the -k|--key-from-fd option.