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 VMware.

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. Connect to the management subsystem using SSH:
    1. Run the following command to connect as the API Connect administrator.
      ssh ip_address -l apicadm
    2. When prompted, select Yes to continue connecting.
    3. Get the necessary credentials:
      sudo -i
  2. 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
  3. In your copy of the CR, update the following settings:
    • crType - se 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: 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.
  4. 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.

  5. 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                                     CR TYPE   INDICES                 AGE   COMMENT
    a7s-bup-266p8         Ready                                           create    [all]                   20h   y
    a7s-bup-pffdh         Ready                                           create    [all]                   34h   y
    analytics-bup-kxwq5   Ready    analytics-all-2020-09-07t03:49:15utc   record    [ui apievents config]   34h
    analytics-bup-p29z8   Ready    analytics-all-2020-09-07t18:04:03utc   record    [ui apievents config]   20h
  6. 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