Skip to content

Backup and restore

Canvus Connect server provides a command-line interface for backing up and restoring server instances. The backup creates a folder that contains the database and all assets on each canvas.

You can restore a backup to exactly the same or newer version of Canvus server on which it was created.

The default backup settings are stored in the server configuration file for automatic backup creation on upgrade. The application returns an exit code indicating success or failure after executing a task. Additional information may be printed to stdout/stderr.

Warning

Canvus Connect server does not backup any configuration files, TLS keys and certificates, or system files. Read about server-backup-configuration-files.

Backup

The Canvus server backup can be configured using the server configuration file. The backup procedure is controlled by the server application binary.

Note

A backup of the server data can be made while the server is running.

Configuration

The location of the backup can be set in the mt-canvus-server.ini file as defined below. :

[backup]

; Default path to store automatic server backups. Set to empty to disable
; automatic backup on software update.
; DEFAULT (Linux): /var/lib/mt-canvus-server/backups
; DEFAULT (Windows): <ProgramData>\\MultiTaction\\canvus\\backups
; root=/var/lib/mt-canvus-server/backups

Procedure

Backup procedure is controlled by mt-canvus-server application. The following command line arguments control the backup process:

--backup

: Starts the backup process. Will block until the process is completed and returns an exit code to indicate if the operation succeeded or failed.

--backup-path

: (Optional) Specifies the folder where the backup is written to. If specified, the backup is written directly to the given folder. If not specified, a new subfolder is created in backup/root folder specified in the configuration and the backup is written to the subfolder. The subfolder name follows the format: \<unix epoch time>_\<year>_\<month>_\<day>_\<canvus version>_canvus_backup. For example, 1525264099_2018_05_02_2.0.1_canvus_backup

--backup-skip \<list>

: (Optional) can be used to exclude parts of the data from the backup process. \<list> can be a comma-separated list of following tokens:

> -   db
> -   assets
>
> If db is specified to be skipped, only assets are backed up. If assets are specified, only db is backed up.

--backup-delete

: Will delete all files and folders in the backup-path prior to writing the new backup in there.

Hint

Typically you would use the following commands to create a manual backup of the Canvus Connect server to the configured backup path:

Ubuntu:

sudo -H -u mt-canvus-server /opt/mt-canvus-server/bin/mt-canvus-server --backup

Windows (as administrator):

"C:\Program Files\MT Canvus Server\bin\mt-canvus-server" --backup

The backup procedure will generate the following files (unless skipped) in the specified backup path:

  • db_dump.sql - dump of the PSQL database
  • assets - folder containing all assets as is
  • mt-canvus-backup-metadata.json - metadata about the backup, like software version number, indication this is a server backup, and time stamp of the backup

Canvus will attempt to use file system hard-links when creating backups of the asset files to conserve disk space. If hard-links can\'t be used (for example when creating a backup on a different volume), Canvus will make copies of the files instead and issue a warning. The backup will still be complete, it just consumes more disk space.

Automatic Backup

Unless disabled from the server configuration file, when the Canvus Server is upgraded, the installation process automatically calls the backup process of existing installation to create a backup of the existing data. This backup also includes the assets in the canvases, like pictures, videos, etc.

Storing configuration files

The backup command does not store your configuration file, log files, or license files. You may also want to backup any TLS keys and certificates, if you have to perform a full machine restore.

The backup does not include any system configuration files, such as your database account.

Restore

To restore a server backup, you need a working Canvus server installation.

Warning

The server must not be running while restoring a backup.

Procedure

Restore procedure is controlled by mt-canvus-server application. The following command line arguments control the restore process:

--restore

: Starts the restore process. Will block until the process is completed and returns an exit code to indicate if the operation succeeded or failed.

--backup-path

: Specifies the folder from where the backup is read from. If path is not specified the command will fail.

First the process will verify the mt-canvus-backup-metadata.json to determine if it can proceed with the restore operation. For example, early exit can happen if the backup has been made with a newer software version than that which is current running.

If the validation passes, the procedure will continue as follows:

  • If the metadata specifies a database dump (db_dump.sql): The restore process will drop all tables in the configured Canvus database and restore the database dump from the file.
  • If the metadata specifies assets: The restore process will remove all existing assets and restore the ones from the backup.

Hint

Typically you would use the following commands to restore a backup of the Canvus Connect server:

Ubuntu:

sudo -H -u mt-canvus-server /opt/mt-canvus-server/bin/mt-canvus-server --restore --backup-path /var/lib/mt-canvus-server/backups/

Windows (as administrator):

"C:\Program Files\MT Canvus Server\bin\mt-canvus-server" --restore --backup-path "C:\ProgramData\MultiTaction\canvus\backups\