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 client 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 client backup can be configured using the client configuration file. The backup procedure is controlled by the client application binary.
A backup of the client data can be made while the client is running.
The location of the backup can be set in the mt-canvus.ini file as defined below.
[backup] ; Default path to store automatic client backups. Set to empty to disable ; automatic backup on software update. ; DEFAULT (Linux): ~/MultiTaction/canvus/backups ; DEFAULT (Windows): <LOCAL APP DATA>\\MultiTaction\\canvus\\backups ; root=/home/multi/MultiTaction/canvus/backups
Backup procedure is controlled by mt-canvus-app 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. The process is mostly atomic, meaning the canvas meta data (JSON) files are locked during the backup process. The lock should be shared with data migration.
–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:
- documents - path containing the local database JSON files, similar to how the client data is stored within the client
- assets - folder containing all assets without additional uncompression
- mt-canvus-backup-metadata.json - metadata about the backup, like software version number, indication this is a client backup, and time stamp of the backup
1.1.3. Automatic Backup¶
When MT Canvus client will perform migration of data from old format to new, it will create an automatic backup of the existing data before the import. This backup also includes the assets in the canvases, like pictures, videos, etc.
To restore a client backup, you need a working MT Canvus client installation.
The client must not be running while restoring a backup.
Restore procedure is controlled by mt-canvus-app 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 documents: The restore process will remove the current local documents and restore them from the backup.
- If the metadata specifies assets: The restore process will remove all existing assets and restore the ones from the backup.