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 will 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 will create an encrypted archive of the Vault and MongoDB data used by Anyware Manager. If successful, the backup archive file and decryption key file locations will be displayed in the terminal.

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

Once the file and key has been created, you will 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 will be 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 will also 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 will attempt 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 will have 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 will 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 will attempt 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>@<casm1_URL>:/opt/teradici/casm/backups/<archive_name> <path on machine that contains casm 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>@<casm1_URL>:/opt/teradici/casm/.private/backup.key <path on machine that contains casm 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 casm backups>/<archive_name> <username>@<casm2_URL>:<path on casm2 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 casm backup keys>/backup.key <username>@<casm2_URL>:<path on casm2 host that contains backup keys>