Skip to main content
Version: 1.18.1

Backup and restore

note

Backup and restore is currently available as a preview feature and under development. See Preview features.

If you use backup and restore, and have feedback to share, contact WANdisco.
You must enable this feature in the application properties file to use it.

This preview version can only be used through the REST API.

LiveData Migrator allows you to backup all of your configured migrations, exclusions, and settings with the CLI. Restore this backup at any time to revert your LiveData Migrator instance to its prior state. This will not undo file transfers that have already been completed.

The backup will save the following:

  • Migrations
  • Targets
  • Source configuration
  • Path mappings
  • Bandwidth settings
  • Exclusions
  • Secure keys for accessing filesystems*

* These are masked by default, unless the mask=false property is supplied in the backup request.

Backups are stored by default in /opt/wandisco/livedata-migrator/db/backup.

API Commands#

The backup and restore feature makes use of a REST API to send backup and restore requests. Below are some examples using curl commands.

Create a backup#

Use the following command to write a backup to a file on the host machine:

Save a masked backup
curl -X POST http://myldmhost:18080/preview/backups
Save an unmasked backup
curl -X POST http://myldmhost:18080/preview/backups?mask=false

In the above example, myldmhost should be replaced with the IP address or domain name of the server hosting LiveData Migrator.

By default, the backup file will be stored in /opt/wandisco/livedata-migrator/db/backup with a filename following the pattern backup.dateTtime, such as backup.2021-04-22T12/59/19.

The mask parameter, which is true by default, means secure keys - such as those used to access filesystems - will be masked for security purposes. This means you need to enter them again with the correct values after recovery. If the mask=false parameter is supplied, the backup stores these properties as plain text. It will therefore not be necessary to resupply them.

Use the following command to write the backup to a specified file (in this case, backup.json):

Write the backup to a specific file
curl -X POST http://myldmhost:18080/preview/backups?mask=false > backup.json

Restore from backup#

warning

Before restoring LiveData Migrator from a backup, you should delete the default-db file to ensure there are no setting conflicts. By default, the folder is in the following directory:

/opt/wandisco/livedata-migrator/db/default-db

The restoration process will still reinstate your previously backed up settings, meaning you will not lose them.

Restore LiveData Migrator from a backup by using the following curl command:

Restore from backup
curl -X POST -H "Content-Type: application/json" -d @backup.json http://myldmhost:18080/preview/backups/restore --verbose

In this example, the backup file is named backup.json and the file is located in the user's current working directory.

Periodic backup#

LiveData Migrator automatically creates a backup every sixty minutes regardless of whether the backup and restore feature is enabled.

Example:

-rw------- 1 ldm ldmadmin  9642 Mar 16 10:16 backup.2022-03-16T10:16:34.767  -rw------- 1 ldm ldmadmin  1309 Mar 16 11:16 backup.2022-03-16T11:16:34.753  -rw------- 1 ldm ldmadmin  1309 Mar 16 11:16 backup.2022-03-16T11:16:58.268  -rw------- 1 ldm ldmadmin  1309 Mar 16 12:16 backup.2022-03-16T12:16:58.262

Add backup.scheduled.collection.period to application.properties to modify the time interval in minutes.

Example:

backup.scheduled.collection.period=360
note

To restore from periodic backups, enable the preview feature.

If you try to restore from a periodic backup without enabling the preview feature, you'll get an error message like this:

"error" : 13001,"status" : 404,"title" : "Preview endpoint not found","message" : "/preview/backups/restore not found. Check Preview Feature availability at /preview"

You can check if the feature is enabled by running the following command in the CLI:

preview feature list