Skip to content

Backing up and Restoring Anyware Manager Data

The following sections outline the steps to backup the data stored using in-cluster data storage applications, and used by Anyware Manager. It also outlines how to restore this data from the created archive, as well as how to then migrate this data to another virtual machine.

Backing up Anyware Manager Data

The following section outlines how to back up the data stored and used by Anyware Manager, by creating an encrypted archive of the data.

Backup Command for In-Cluster Storage Only

The backup command can only be run if Anyware Manager is using in-cluster data storage for both Vault and MongoDB. This command does not work if Anyware Manager is using an external Vault or MongoDB.

To backup the data run the following command in an SSH terminal:

sudo /usr/local/bin/anyware-manager backup

This creates an encrypted archive of the Vault and MongoDB data used by Anyware Manager. If successful, the backup archive file and decryption key file locations are displayed in the terminal.

The backup archive file is stored in the /opt/teradici/casm/backups/ directory. The decryption key is stored in the /opt/teradici/casm/.private/backup.key. Anyware Manager only creates a new decryption key if one does not already exist. If there is an existing decryption key then it continues to use it.

Once the file and key has been created, you need to change the ownership of the file to the SSH user using the chown command. You can move the files to a specific directory, change the owner, and the correct permissions are assigned. The following script is an example of this command:

ssh user1@machine1
sudo mv /opt/teradici/casm/backups/<archive_name> ~/backup.tar
sudo chown user1:user1 ~/backup.tar
exit

ssh user2@machine2
scp user1@machine1:~/backup.tar .

You need to copy the decryption key and change its ownership. The following script is an example of this command:

ssh user1@machine1
sudo cp /opt/teradici/casm/.private/backup.key ~/
sudo chown user1:user1 ~/backup.key
exit

ssh user@machine2
scp user1@machine1:~/backup.key .

Restoring Anyware Manager Data

Once you have backed up the data to the encrypted archive, you need to restore this data. If the restore command fails, Anyware Manager attempts to try and restore using a backup archive that is automatically created right after the restore command has been run. If this is successful, Anyware Manager has the same data as before the restore was attempted. To skip the rollback feature, add --skip-rollback to the arguments of the restore function.

Restore Command for In-Cluster Storage Only

The restore command can only be run if Anyware Manager is using in-cluster data storage for both Vault and MongoDB. This command does not work if Anyware Manager is using an external Vault or MongoDB.

To restore the data run the following command in an SSH terminal:

sudo /usr/local/bin/cas-manager restore --archive <path to archive file>  --key <path to key file>

If you do not specify a key, Anyware Manager attempts to restore using the key found at /opt/teradici/casm/.private/backup.key.

Moving Anyware Manager Data

It is possible to backup data on one Anyware Manager virtual machine, and then restore the resulting archive on a separate Anyware Manager virtual machine. Once you have backed up the data successfully on the first Anyware Manager virtual machine, you can move the encrypted archive to another virtual machine.

You must ensure you have a machine that has SSH access to the virtual machines that host each of the Anyware Manager instances. You must first copy the encrypted archive and decryption key to this machine, then you can move the data from this intermediary machine to the new Anyware Manager virtual machine.

The following steps outline how to move Anyware Manager data:

  1. Run the following command to copy the encrypted archive to a machine that has SSH access to the Anyware Manager instance:
    scp <username>@<manager1_URL>:/opt/teradici/casm/backups/<archive_name> <path on machine that contains manager backups>
    
  2. Run the following command to copy the decryption key to the same machine that has SSH access to the Anyware Manager instance:
    scp <username>@<manager1_URL>:/opt/teradici/casm/.private/backup.key <path on machine that contains manager backup keys>
    
  3. Run the following command to move the encrypted archive file from the machine to the host of the new Anyware Manager virtual machine:
    scp <path on machine that contains manager backups>/<archive_name> <username>@<manager2_URL>:<path on manager2 host that contains backups>
    
  4. Run the following command to move the decryption key file from the machine to the host of the new Anyware Manager virtual machine:
    scp <path on machine that contains manager backup keys>/backup.key <username>@<manager2_URL>:<path on manager2 host that contains backup keys>