Running a backup of the Analytics database

Deploy the analyticsbackup_cr.yaml CR to initiate a backup of the IBM® API Connect Analytics database on Kubernetes.

Before you begin

Configure backup settings for Analytics.

About this task

A backup is triggered by creating the analyticsbackup_cr.yaml CR. The new CR is detected by the ibm-apiconnect operator, which requests a new backup.


  1. Create the AnalyticsBackup CR for your deployment in a file called analyticsbackup_cr.yaml.

    The following code shows the sample analyticsbackup_cr.yaml, which is stored in the helper_files directory:

    kind: AnalyticsBackup
      generateName: a7s-bup-
      crType: create
      comment: "test comment"
      - ui
      enableIgnoreUnavailable: true
  2. In your copy of the CR, update the following settings:
    • crType - Use create to trigger a backup process. When the backup is created, the operator generates another backup CR with crType: record, which represents the stored backup that you can use for a restore operation.

    • Optional: commentYou can use this field to describe the back up for later reference.

    • Optional: indices - A list of index names or keywords, indicating which indices you want to back up. If no indices are specified, then all indices are backed up. The following supported keywords are mapped to indices or aliases in Elasticsearch:
      • all - Backup all data. This is equivalent to listing all of the remaining keywords (apievents, ui, config).
      • apievents - Backup all analytics data.
      • ui - Backup all UI visualizations and dashboards.
      • config - Backup all configuration information, such as the retention period.
    • Optional: enableIgnoreUnavailable - Default value is false. If set to false, the backup fails if a specified index is not present. If set to true, missing indices are skipped and the backup continues.
  3. Deploy your CR by running the following command to create it in the namespace for your Analytics subsystem:
    kubectl create -f analyticsbackup_cr.yaml -n namespace

    where namespace is the name of the Analytics namespace.

    The backup's name and ID are generated when the backup operation runs.

  4. To get a list of available backups, run the following command:
    kubectl get analyticsbackup -n namespace

    The response looks like the following example:

    NAME              STATUS     ID                                        AGE
    a7s-bup-gb6s5     Complete                                             47h
  5. Display the details for a particular backup by running the following command:

    Use the backup name from the results in step 4.

    kubectl get analyticsbackup backup_NAME -n namespace -o yaml

    The result looks like the following example:

    kind: AnalyticsBackup
      creationTimestamp: "2020-05-20T16:18:05Z"
      generateName: a7s-bup-
      generation: 1
      name: a7s-bup-gb6s5
      namespace: my-namespace
      resourceVersion: "867329"
      selfLink: /apis/
      uid: f43b8400-733d-411a-9e9a-de2166bbfb0a
      - ui
      - lastTransitionTime: "2020-05-20T16:18:24Z"
        message: SUCCESS
        status: Complete
        type: Ready
      details: |
      id: my-backup-id