1. Backup and Restore¶
MT Canvus provides a simple command line interface to create and restore backups from local disks, network shares and cloud drives. The storage device should be mounted locally on the host computer to use this feature. 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.
The MT Canvus server backup can be configured using the server configuration file. The backup procedure is controlled by the server application binary.
A backup of the server data can be made while the server is running.
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
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:
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.
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
1.1.3. Automatic Backup¶
Unless disabled from the server configuration file, when the MT 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.
To restore a server backup, you need a working MT Canvus server installation.
The server must not be running while restoring a backup.
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 MT 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.