Skip to content

API Connect Backup Configuration

Backup and restore for API Connect subsystems are daily tasks that you have to manage to keep the systems healthy.

API Connect v10 uses Kubernetes operators to backup and restore databases of the subsystems.

Type of the backups are manuel and scheduled.

Manuel backups

For the subsystems, custom resources(CR) are used for the backup configuration.

Therefore, you create a backup custom resource(CR) manually.

An example for management subsystem in OpenShift:

  1. Check the subsystem is healthy in OpenShift:
oc get <subsystem-name> 
  1. Create a backup custom resource(CR) in a backup.yaml file:

1
2
3
4
5
6
7
8
apiVersion: management.apiconnect.ibm.com/v1beta1
kind: ManagementBackup
metadata:
  generateName:<mnagement-subsystem-name>
spec:
  type: full
  crType: create
  clusterName: management
3. Create custom resource in OpenShift in a yaml file:

oc create -f backup.yaml -n <management-namaspace>
  1. List backups by using OpenShift cli:
oc get managementbackup -n <management-namespace>

Scheduled backups

In order to trigger backups whenever you would like to, you create a cron schedule and configure backup configurations

in the management custom resource(CR).

An example for management subsystem in OpenShift:

  1. Create backup secret in OpenShift to provide credentials that is used in sftp connection:
oc create secret generic <management-backup-secret-name> --from-literal=username='<username>' --from-literal=password='<password>' -n <management-namespace>
  1. Edit management subsystem custom resource(CR).
oc edit <management-custom-resource-name>
  1. Add scheduled backup configuration to management custom resource yaml file:
spec:
  management:
    databaseBackup:
      protocol: sftp
      host: <sftp-host-name>
      port: <sftp-port>
      path: <backup-location>
      retries: 0
      credentials: <management-backup-secret-name>
      schedule: "30 11 * * *"

4) Check the backup location if the scheduled backup configuration works as expected:

Troubleshooting the backup problems

  1. Find the pod name that includes string backrest-shared-repo in OpenShift.

If you are not sure about the namespace, you can use -A option to search for all namespaces.

oc get po -n <management-namespace> | grep backrest-shared-repo
  1. Open a remote shell to pod:
oc rsh <backrest-shared-repo-pod-name>
  1. Create a tmp file in /tmp:
touch tmp_file
  1. SFTP to sftp server:
sftp -P 22 <username>@<sftp-server-name>
  1. Change directory to the backup location that we configured in custom resource file:
cd <backup-location>
  1. Transfer tmp file to the sftp server backup location:

put tmp_file
7. Check if the file is transferred successfully:

ls -l

Steps to check if you face a problem during sftp connection:

  1. Check the user has write access to the backup location that you configured.

  2. Check if the sftp daemon is running or not on the sftp server.