This section covers the InterWorx Control Panel backup system and how to restore backups of your SiteWorx accounts, both from the NodeWorx interface and the SiteWorx interface. From within NodeWorx you can restore full backups of multiple SiteWorx accounts. From within SiteWorx, you can only create a backup of that particular account, but you will be able to create partial and full backups.
If you prefer to use the web interface, follow the steps below:
Click the SiteWorx menu item if it is not already open.
Click the Backup / Restore menu item.
You will see a list of all the SiteWorx accounts on the server, with a checkbox next to each. If you are logged in with a NodeWorx Reseller account, you will only see the SiteWorx accounts that belong to you.
Mark the checkboxes for the SiteWorx accounts you wish to backup. You may also click the [ Check All ] link at the bottom of the list to quickly check all SiteWorx accounts.
Mark the labeled E-mail status to checkbox and enter your email address if you want an email sent to you when the backup process finishes. When the backup completes, you will receive an email that indicates if the backup completed successfully or not, as well as where to find the backup file.
Choose the Backup option in the dropdown labeled with selected:
You have now successfully initiated a backup from NodeWorx.
The command line backup interface is less user-friendly, but you have a lot more options at your disposal. Using the command line interface is most useful when you want to automate (e.g., via CRON) the creation of SiteWorx account backups.
SSH into the server
su to the iworx system user. You may need to switch to the root user first (if you're not already logged in as the root user) and then switch to the iworx user.
The command you will be running is, as the iworx user:
Space-seperated list of SiteWorx account domains to backup. Simple regular expressions are also allowed here (see examples below).
--domains all
Backup ALL domains on the server.
Backup Type Options (Optional)
Parameter
Description
--backup-options backup options
A space separated list of what should be included in this backup. Valid options are:
all - Create a full SiteWorx backup, which includes all SiteWorx account related data. If --backup-options is not set, this is the default.
web - Backup website data
mail - Backup email mailboxes
db - Backup database data
no-logs - By default, site log files are included in a full SiteWorx backup. This option, used along with the "all" option above, indicates the backup should not include site log files.
no-stats - By default, site stats files are included in a full SiteWorx backup. This option, used along with the "all" option above, indicates the backup should not include stats log files.
--structure-only
Indicates that a "structure-only" SiteWorx backup should be created. A "structure-only" backup contains only SiteWorx related data that isn't stored in user-accessible locations (for example, email users and passwords which are stored in the internal InterWorx database). Actual files, such as website files, actual emails, and database tables, are not included in "structure-only" backups. Because of this, "structure-only" backups are very small and are created very quickly. They are especially useful for SiteWorx accounts that have large amounts of data files, as a regular full backup could take a considerable amount of time and resources. In a "structure-only" backup, data files such as website, email, and database data are up to the user to backup on their own.
--web
DEPRECATED. Backup web data. This option is deprecated, and --backup-options web should be used instead. This option is here for backwards compatibility, and will be removed in a future release.
--mail
DEPRECATED. Backup mail data. This option is deprecated, and --backup-options mail should be used instead. This option is here for backwards compatibility, and will be removed in a future release.
--databases
DEPRECATED. Backup database data. This option is deprecated, and --backup-options db should be used instead. This option is here for backwards compatibility, and will be removed in a future release.
--all
DEPRECATED. Backup all account data (includes all the above). This option is deprecated, and --backup-options all should be used instead. This option is here for backwards compatibility, and will be removed in a future release.
Backup Location Options (Optional)
Parameter
Description
--output-dir path
Alternate path to save backups to. If this option is omitted, the default path is each SiteWorx account's backups directory (/home/uniqname/domain.com/iworx-backup).
--tmp-dir path
The temporary directory where the backup will be created before it is moved to the final location. If this option is omitted, the default path is set in the iworx.ini, under the [iworx.dir][tmp] setting.
--file-path=path
DEPRECATED. Alternate path to save backups to. This option is deprecated, and --output-dir should be used instead. This is here for backwards compatibility, and will be removed in a future release.
Backup Remote Transfer Options (Optional)
Parameter
Description
--xfer-method method
Sets the transfer method type. Valid options are:
ftp - Indicates the backup file should be transferred to a remote server via FTP, based on settings in the specified transfer.ini file.
scp - Indicates the backup should be transferred to a remote server via SCP/SSH, based on settings in the specified transfer.ini file.
If a transfer.ini file is not specified with the --xfer-ini option, the script will look in the default location for the transfer.ini file (/home/uniqname/var/domain.com/.backup.transfer.ini). If the default transfer.ini file is missing, the backup file will be stored in the default local location (/home/uniqname/domain.com/iworx-backup).
--xfer-ini /path/to/xfer.ini
Full path of the transfer.ini file that will be used during the backup transfer process.
Note: If this option is used with multiple SiteWorx accounts, all the backups will be transferred using this single transfer.ini file.
--ftp
DEPRECATED. Indicates the backup file should be transferred via FTP. This option is deprecated, and --xfer-method ftp should be used instead. This is here for backwards compatibility, and will be removed in a future release.
--transfer-ini=/path/to/xfer.ini
DEPRECATED. Indicates the path to transfer.ini file which contains information on where to transfer the backup files. This option is deprecated, and --xfer-method ftp should be used instead. This is here for backwards compatibility, and will be removed in a future release.
Other Options (Optional)
Parameter
Description
--reseller-id reseller-id
Limits the list of possible backup domains to the domains belonging to the reseller-id. If --domains parameter is not set, but --reseller-id is set, all domains under the given reseller are backed up. If --domains parameter is also set, the list will only match domains belonging to the given reseller.
--compression 1-9
Set the compression level for the final backup file. This option is identical to the gzip compression paramater, where 1 is the "quickest" and 9 is the "slowest". If not set, it defaults to the gzip default compression level.
--quiet
Causes the script to run silently, and not print any text to the screen. Useful for cron jobs.
--email email
Email address to send backup results to.
--filename-format format-string
Sets the format of the final backup filename given the format-string provided. If this option is omitted, the default format used is set in the iworx.ini, under the [iworx.backup][filename_format] setting (default %D-%t-%b.%d.%Y-%H.%M.%S).
Note that the text [scp] or [ftp] must be the first line in the file. The [scp] section is used for SCP/SSH remote transfers, and the [ftp] section is used for FTP remote transfers.
Option
Description
username
Username used to login to the remote server
password
Password used to login to the remote server
hostname
Hostname or IP address of the remote server
remotepath
The backup will be saved in that directory with the default InterWorx naming scheme.
port
OPTIONAL. The port that the service (FTP or SSH) runs on. If not set, the port will default to the standard port for that service.
If you prefer to use the web interface, follow the steps below.
Click the SiteWorx menu item if it is not already open.
Click the Backup / Restore menu item.
You will see a list of all the SiteWorx accounts on the server, with a checkbox next to each. If you are logged in with a NodeWorx Reseller account, you will only see the SiteWorx accounts that belong to you.
If the SiteWorx account currently has no backups, you will see No Backups in the Status column.
If the SiteWorx account does have backups you will see a [ Manage ] link in the Status column. Click the [ Manage ] link corresponding to the SiteWorx account you would like to restore.
You will see a list of all the backup files for that SiteWorx account with [ Restore ] link corresponding the the backup file you would like to restore.
Because a restore will overwrite existing data in the SiteWorx account, you will be asked to confirm. Click the button to restore the account.
Restoring from the CLI is the same process as importing a SiteWorx account backup from another InterWorx server via CLI except you would want to --force the import to overwrite the existing SiteWorx instance. Please refer to the import documentation for further details.
Click the SiteWorx menu item if it is not already open.
Click the Backup / Restore menu item.
You will see a list of all the SiteWorx accounts on the server, with a checkbox next to each. If you are logged in with a NodeWorx Reseller account, you will only see the SiteWorx accounts that belong to you.
If the SiteWorx account currently has no backups, you will see No Backups in the Status column.
If the SiteWorx account does have backups you will see a [ Manage ] link in the Status column. Click the [ Manage ] link corresponding to the SiteWorx account you would like to restore.
You will see a list of all the backup files for that SiteWorx account with a checkbox next to each backup file. Mark the checkboxes for the files you wish to delete. You may also click the [ Check All ] link at the bottom of the list to quickly check all the backup files.
In the dropdown labeled with selected:, choose the Delete… option.
You will be asked to confirm the deletion of the backup files. Click the button to finish.
Backup / Restore
This section covers the InterWorx Control Panel backup system and how to restore backups of your SiteWorx accounts, both from the NodeWorx interface and the SiteWorx interface. From within NodeWorx you can restore full backups of multiple SiteWorx accounts. From within SiteWorx, you can only create a backup of that particular account, but you will be able to create partial and full backups.
How-To:
Backup
Create a SiteWorx Backup in NodeWorx
If you prefer to use the web interface, follow the steps below:
Create a SiteWorx Backup via CLI
The command line backup interface is less user-friendly, but you have a lot more options at your disposal. Using the command line interface is most useful when you want to automate (e.g., via CRON) the creation of SiteWorx account backups.
suto theiworxsystem user. You may need to switch to therootuser first (if you're not already logged in as therootuser) and then switch to theiworxuser.The command you will be running is, as the
iworxuser:backup.pexhas several command line parameters:--domains domain list--domains all--backup-options backup options--structure-only--web--backup-options webshould be used instead. This option is here for backwards compatibility, and will be removed in a future release.--mail--backup-options mailshould be used instead. This option is here for backwards compatibility, and will be removed in a future release.--databases--backup-options dbshould be used instead. This option is here for backwards compatibility, and will be removed in a future release.--all--backup-options allshould be used instead. This option is here for backwards compatibility, and will be removed in a future release.--output-dir pathbackupsdirectory (/home/uniqname/domain.com/iworx-backup).--tmp-dir path[iworx.dir][tmp]setting.--file-path=path--output-dirshould be used instead. This is here for backwards compatibility, and will be removed in a future release.--xfer-method methodIf a transfer.ini file is not specified with the --xfer-ini option, the script will look in the default location for the transfer.ini file (/home/uniqname/var/domain.com/.backup.transfer.ini). If the default transfer.ini file is missing, the backup file will be stored in the default local location (/home/uniqname/domain.com/iworx-backup).
--xfer-ini /path/to/xfer.iniNote: If this option is used with multiple SiteWorx accounts, all the backups will be transferred using this single transfer.ini file.
--ftp--xfer-method ftpshould be used instead. This is here for backwards compatibility, and will be removed in a future release.--transfer-ini=/path/to/xfer.ini--xfer-method ftpshould be used instead. This is here for backwards compatibility, and will be removed in a future release.--reseller-id reseller-id--compression 1-9--quiet--email email--filename-format format-string[iworx.backup][filename_format]setting (default%D-%t-%b.%d.%Y-%H.%M.%S).Command Line Interface Examples
In its simplest form, you can create a full backup of a single SiteWorx account and have it stored in the default location (
/home/uniqname/backups):To create full backups of a SiteWorx account and send a status email to joe@user.com:
To create a partial backup of web and database data of a single SiteWorx account and have it stored in the default location (
/home/uniqname/backups):[iworx@test-box ~]$ /home/interworx/bin/backup.pex \ --domains domain1.com \ --web --databasesTo create full backups of multiple SiteWorx accounts with each backup saved in their respective backup directories:
[iworx@test-box ~]$ /home/interworx/bin/backup.pex \ --domains domain1.com domain2.comTo create full backups of multiple SiteWorx accounts with each backup saved in
/tmp:[iworx@test-box ~]$ /home/interworx/bin/backup.pex \ --domains domain1.com domain2.com \ --file-path /tmpTo create a full backup of multiple SiteWorx accounts and have them transferred to a server specified in
/root/transfer.inivia FTP:[iworx@test-box ~]$ /home/interworx/bin/backup.pex \ --domains domain1.com \ --ftp \ --transfer-ini /root/transfer.iniCreate an .ini For Remote Transfers
The following is the proper format for the transfer.ini files used by the InterWorx backup system.
OR
Note that the text
[scp]or[ftp]must be the first line in the file. The[scp]section is used for SCP/SSH remote transfers, and the[ftp]section is used for FTP remote transfers.usernamepasswordhostnameremotepathportRestore
Restore From NodeWorx
If you prefer to use the web interface, follow the steps below.
Restore From CLI
Restoring from the CLI is the same process as importing a SiteWorx account backup from another InterWorx server via CLI except you would want to
--forcethe import to overwrite the existing SiteWorx instance. Please refer to the import documentation for further details.Delete a SiteWorx Account Backup