Backing up and restoring data on different clusters
Learn how to back up the WebSphere Automation data from one cluster and restore it to another cluster. In this procedure, which can be used for offline disaster recovery, you use Red Hat® OpenShift® APIs for Data Protection (OADP) with IBM Cloud® Object Storage to back up data in a cloud storage that another cluster can access later.
Before you begin
- Set up a backup storage with IBM Cloud Object Storage.
To integrate your backup PVC with IBM Cloud Object Storage, you need to make sure that you have an IBM Cloud account with an instance of IBM Cloud Object Storage. Follow these steps:
- Create an instance of IBM Cloud Object Storage in IBM Cloud. This step requires an IBM Cloud account.
- Create a bucket in IBM Cloud Object Storage.
-
Log in to IBM Cloud, and in the menu, click Resource list.
- If you do not have an instance of IBM Cloud Object Storage, create one by accessing the Catalog in the dashboard.
- Locate your IBM Cloud Object Storage instance. In the menu, click , then click Create.
- Click Customize your bucket. Specify a
unique bucket name. Select the type ofResiliency,Location, and type ofStorage class, then click Create bucket.
- Select the bucket that you created and click
. In the panel, select
Service IDfor and for , selectWriter. Click Create access policy. If you do not have a Service ID, click the Create service ID in the Access policies panel to create one.
- To establish a connection with IBM Cloud Object Storage, a bucket endpoint
name is needed. Click Configuration, then click
Endpoints. Scroll to the Endpoints panel and locate
the endpoint name that suits your requirements. Copy the endpoint name to a location where you can
retrieve it later.

- Authentication with IBM Cloud Object Storage requires an
access keyandsecret key. From the IBM Cloud Navigation menu, click and click your Cloud Object Storage instance under . Click the tab. If you have not created a service credential yet, do so by using the tab and enabling the toggle switch. Save thecos_hmac_keysblock from your credential, which contains theaccess keyandsecret keyfor later use.
-
- Install the Red Hat OpenShift API for Data Protection (OADP)
operator and create a
DataProtectionApplicationcustom resource.To implement data protection for your applications across both source and target clusters, follow these steps:
- Install the OADP Operator in the
openshift-adpproject from the Red Hat OpenShift OperatorHub. -
Create a cloud-credentials secret within the
openshift-adpproject.- Create a cloud-credentials secret within the
openshift-adpproject by using credentials sourced from the IBM Cloud Object Storage bucket. This secret facilitates secure access to the storage resources needed for backup and restoration operations. To create the cloud-credentials secret, go to the Red Hat OpenShift web console and access from the menu.
Click Create within the Secrets window and select Key/value secret from the drop down list.
Specify the required details including Secret name, Key, and corresponding cloud access credentials.Specify the following values in the Create key/value secret panel: Secret name: cloud-credentials Key: cloud Value: [Enter the access key and secret key that you created previously.] [default] aws_access_key_id=<KEY_ID_VALUE> aws_secret_access_key=<SECRET_ACCESS_KEY_VALUE>
Note: Do not use quotation marks or brackets in the key values.-
To finalize the creation of the cloud-credentials secret, click Create.
- Create a cloud-credentials secret within the
- Create
DataProtectionApplicationcustom resource.-
Access the Red Hat OpenShift web console and go to from the menu.
-
Select the and proceed to configure the
DataProtectionApplicationresource. -
Click and opt to configure via the YAML view.
-
Update the fields with the provided specifications for the
DataProtectionApplicationcustom resource.For
spec.backupLocations.objectStorage.bucket, use the bucket name you added in a previous step. Forspec.backupLocations.config.s3Url, use the bucket endpoint desired, that you added in a previous step.kind: DataProtectionApplication apiVersion: oadp.openshift.io/v1alpha1 metadata: name: velero-dpa namespace: openshift-adp spec: backupLocations: - velero: config: profile: default region: ams03 s3Url: https://s3.ams03.cloud-object-storage.appdomain.cloud insecureSkipTLSVerify: "true" s3ForcePathStyle: "true" credential: key: cloud name: cloud-credentials default: true objectStorage: bucket: wsabucket prefix: velero provider: aws configuration: restic: enable: true velero: defaultPlugins: - openshift - csi - aws - kubevirt featureFlags: - EnableCSI snapshotLocations: - velero: config: profile: default region: ams03 provider: awsNote: If you enable your cluster to run pods on the primary nodes, use the following YAML section forspec.configuration.spec: ... configuration: nodeAgent: enable: true uploaderType: restic velero: ...Note: The object storage that is used is s3-compatible storage that is provided by the IBM Cloud Object Storage instance. The custom s3Url capability from the aws velero plugin is used to access the IBM Cloud Object Storage endpoint in Velero. -
To finalize the creation process, click
Create. -
From the menu, select All instances. Verify that the status of
DataProtectionApplicationis Condition: Reconciled and the status ofBackupStorageLocationis Phase: Available.
-
-
Update
VolumeSnapshotClassDeletion Policy.
When thedeletionPolicyattribute of theVolumeSnapshotClassis set toDelete, the associated storage snapshot is removed concurrently with theVolumeSnapshotContentobject. To maintain the integrity of volume snapshots within the storage system during the Velero backup lifecycle, consider updating the deletion policy toRetain. This adjustment makes sure that the preservation of volume snapshots, even in scenarios such as namespace loss during a disaster event.The OADP/Velero CSI plug-in autonomously selects the appropriate
VolumeSnapshotClasswithin the cluster, matching both the driver name and the value ofvelero.io/csi-volumesnapshot-class, which must be set totrue.To update theVolumeSnapshotClassdeletion policy:- In the Red Hat OpenShift web console, goto .
-
Click
csi-cephfsplugin-snapclass, and switch to the YAML tab. -
Update the
deletionPolicyvalues and add relevant labels in the metadata section with the following values:apiVersion: snapshot.storage.k8s.io/v1 deletionPolicy: Retain driver: rook-ceph.cephfs.csi.ceph.com kind: VolumeSnapshotClass metadata: labels: velero.io/csi-volumesnapshot-class: 'true' ......
- Install the OADP Operator in the
- Verify the default storage class.
-
To verify the default storage class configuration, in the Red Hat OpenShift web console menu, go to .
-
Confirm that
rook-cephfsis designated as the default storage class for both the source and target clusters. - Or run the following command to verify the default storage
class.
oc get StorageClassesThe output resembles the following:NAME PROVISIONER RECLAIMPOLICY VOLUMEBINDINGMODE ALLOWVOLUMEEXPANSION AGE rook-ceph-block rook-ceph.rbd.csi.ceph.com Delete Immediate true 18d rook-cephfs (default) rook-ceph.cephfs.csi.ceph.com Delete Immediate true 18d
-
- Download and install the IBM Catalog Management Plug-in for IBM Cloud Paks.
To download and install IBM Catalog Management Plug-in for IBM Cloud Paks, see Backing up and restoring data.
Ensure that you download and install the plug-in on both the source and target clusters. This configuration enables the integration of the plug-in into your infrastructure and facilitates efficient management and backup processes across your environment.
Steps
- Back up the WebSphere Automation data to a PVC using the ibm-pak launch backup command
- Back up the PVC from a source cluster to IBM Cloud Storage using OADP Application Backup
- Restore the PVC from IBM Cloud Object Storage to a target cluster using OADP Application Restore
- Restore the WebSphere Automation data in the PVC to the target cluster using the ibm-pak launch restore command
- Replace the usage metering API key
Back up the WebSphere Automation data to a PVC using the ibm-pak launch backup command
To back up the WebSphere Automation data to a PVC by using the
ibm-pak launch backup command, run the following steps:
-
Set the environment variables for the IBM WebSphere Automation case.
export CASE_NAME=ibm-websphere-automation export CASE_VERSION=1.8.1 - Run the ibm-pak launch command to start the backup
process.
oc ibm-pak launch $CASE_NAME \ --version $CASE_VERSION \ --inventory automationOperator \ --action backup \ --namespace instance_namespaceBy default, the data is stored in a PVC named
wsa-backup. For more information on backing up data, see Backing up and restoring data. - Ensure the backup is created successfully by verifying its presence in the backup list. Initiate
a job to list available backups by using the following
command.
oc ibm-pak launch $CASE_NAME \ --version $CASE_VERSION \ --inventory automationOperator \ --action restore \ --namespace instance_namespaceRun the
oc logcommand as indicated in the restore command output to list the available backups and make sure that the backup you created is listed with its timestamp.
Back up the PVC from a source cluster to IBM Cloud Storage using OADP Application Backup
To run the backup of a PVC from a source cluster to IBM Cloud Object Storage using OADP (Red Hat OpenShift API for Data Protection) Application Backup, do the following steps.
- Add a label to the
was-backupPVC.In the Red Hat OpenShift web console, . Locate and click the PVC named
was-backupwithin the project where WebSphere Automation is installed. In the section, add the following label.labels: wsa.ibm.com: wsa - Create a pod that references the PVC. Generate a YAML file named
pod.yamlwith the following content. Use the namespace where you deployed the WebSphere Automation instances.apiVersion: vl kind: Pod metadata: name: dummy-pod namespace: wasautomation labels: wsa.ibm.com: wsa spec: containers: - name: dummy-container image: nginx:latest volumeMounts: - name: data-volume mountPath: / data volumes: - name: data-volume persistentVolumeClaim: claimName: wsa-backupRun the following command to create the pod.
oc apply -f node.yaml - Backup the pod that is created and the
was-backupPVC to IBM Cloud Storage. Create a YAML file namedbackup-oadp.yamlwith the following content.apiVersion: velero.io/v1 kind: Backup metadata: name: my-backup namespace: openshift-adp spec: defaultVolumesToRestic: true storageLocation: velero-dpa-1 includeClusterResources: true includedNamespaces: - wasautomation orLabelSelectors: - matchExpressions: - key: wsa.ibm.com operator: In values: - wsaRun the following command to perform the backup operation with OADP.
oc apply -f backup-oadp.yaml - Validate the completion of the backup operation.
In the Red Hat OpenShift web console, , within the
openshift-adpproject. Choose the tab to confirm the backup process.
Restore the PVC from IBM Cloud Object Storage to a target cluster using OADP Application Restore
To restore the PVC from IBM Cloud Object Storage to a designated target cluster, employing OADP (Red Hat OpenShift API for Data Protection) Application Restore, do the following steps.
- Set up the WebSphere Automation operator on the target cluster, making sure parity in versions between the source and target clusters. Then, deploy the WebSphere Automation instances on the target cluster, mirroring the configuration of the source cluster, including project names.
- Install the OADP operator by following the procedures outlined in the Install the Red Hat OpenShift API for Data Protection (OADP) operator and Create a
DataProtectionApplicationcustom resource section that is provided in the preceding prerequisites. - Run the restoration of the PVC, along with the associated pod, from IBM Cloud Storage to the
target cluster. Create a YAML file named
restore-oadp.yamlwith the following content.apiVersion: velero.io/v1 kind: Restore metadata: name: my-restore namespace: openshift-adp spec: backupName: my-backup excludedResources : - nodes - events - events.events.k8s.io - backups.velero.io - restores.velero.io - resticrepositories.velero.io hooks: {} includedNamespaces: - '*' labelSelector: matchLabels: wsa.ibm.com: wsaRun the following command to initiate the restore operation with OADP.
oc apply -f restore-oadp.yaml - Confirm the successful completion of the restore operation.
In the Red Hat OpenShift web console, , within the
openshift-adpproject. Choose the tab to validate the restoration process.
- Verify the restoration of the
wsa-backupPVC within the project where the WebSphere Automation instances were deployed.Run the following command.
oc get pvc wsa-backupThe expected output is as follows.
NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS AGE wsa-backup Bound pvc-ef135cd1-3da3-4a43-8e7b-081140a84a36 10Gi RWO rook-cephfs 10d - You can delete the dummy node. It is no longer needed.
Restore the WebSphere Automation data in the PVC to the target cluster using the ibm-pak launch restore command
- Determine the timestamp of the backup performed on the source cluster from which recovery is
intended. First, run the following commands to list available backups.
- Set the environment variables.
export CASE_NAME=ibm-websphere-automation export CASE_VERSION=1.8.1 - Run the
ibm-pak launchcommand for restoration.oc ibm-pak launch $CASE_NAME \ --version $CASE_VERSION \ --inventory automationOperator \ --action restore \ --namespace instance_namespace
- Set the environment variables.
- Run the
oc logcommand as indicated in the restore command output to confirm the presence of the same backup timestamp from the source cluster. - Use the
ibm-pak launch restorecommand to restore WebSphere Automation data from the wsa-backup PVC to the target cluster.- To initiate the restoration from the backup on the source cluster, run the restore action with
the
--timestampargument. - Replace
<timestamp>with the timestamp of the backup directory intended for restoration.
For more information on restoring data, see Backing up and restoring dataoc ibm-pak launch $CASE_NAME \ --version $CASE_VERSION \ --inventory automationOperator \ --action restore \ --namespace $WSA_INSTANCE_NAMESPACE \ --args "--timestamp <timestamp>" - To initiate the restoration from the backup on the source cluster, run the restore action with
the
- Validate that your WebSphere Automation data is restored successfully by opening the WebSphere Automation UI.
Replace the usage metering API key
- For more information on how to replace the usage metering API key, see Revoking or replacing the usage metering API key.
- Upon replacing the usage metering API key, it is necessary to update your WebSphere Application Server and WebSphere Application Server Liberty configurations to incorporate the new API key.
- View the server logs to validate that the servers are registered successfully.