Backing up and restoring

Back up and restore Instana backend and agent data, persistent volumes (PVs), persistent volume claims (PVCs), and Instana configurations.

You must install stanctl version 1.5.0 or later to use the commands that are mentioned in this backup and restore procedure. Be sure to use the same stanctl version during the backup procedure and the restore procedure.

Preparing for backup

Before you start backing up the data, identify a new host on which you can restore the data from the current host.

Complete these steps on the new host:

  1. Prepare your new host by completing the steps in the following sections:

  2. Add Instana repository.

  3. Install stanctl command-line tool.

  4. Stop the current cluster by running the following command on the current host.

    stanctl down
    

Backing up the cluster data store

Back up the cluster by using the following command. In a multi-node cluster, you must run this command on node0 (instana-0). The command creates a stanctl-backup-<timestamp>.tar.gz file in the current directory. To specify another location, use the --output-dir flag with the command.

stanctl cluster backup

Creating a snapshot of the disks

Take snapshots of all the disks that you mounted on the current host.

For more information about how to take snapshots, refer to the documentation of your storage system or cloud provider.

Restoring data to a new Instana host

Complete these steps on your new host:

  1. Create disks from the snapshots and mount them to the new host. Create one disk at a time from the snapshots to be sure to restore and mount the correct disk to the correct file system.

  2. Copy the stanctl-backup-<timestamp>.tar.gz archive file to the new host. In a multi-node cluster, you must copy the archive file to node0 (instana-0).

  3. Restore data from the stanctl-backup-<timestamp>.tar.gz to the new host.

    • For a single-node cluster, run the following command:
      stanctl cluster restore -f <path/to/stanctl-backup-<timestamp>.tar.gz>
      
    • For a multi-node cluster, run the following command on node0 (instana-0):
      stanctl cluster restore --multi-node-enable --multi-node-ips=<node0IPaddress,node1IPaddress,node2IPaddress> -f <path/to/stanctl-backup-<timestamp>.tar.gz>
      
  4. In the DNS settings configuration, be sure to replace the public IP address of your host with the public IP address of the new host.

  5. Install the Instana backend and data stores by using the stanctl up command. The command uses existing configurations that are located in the $HOME/.stanctl/instana.yaml file for the installation.

    stanctl up