Authors: Dian Guo Zou, Georg Sander, Benjamin Wende
Introduction
The Business Teams Service (BTS) is a foundation service that is used in IBM Cloud Pak for Business Automation (CP4BA).
To protect the environment from data loss and corruption, it is important to backup the data from environment, so that the environment could be rebuilt from the backup data if the primary environment failed to provide services when disaster happened.
BTS data should be backup too. BTS data are stored in the EDB PostgreSQL service database, the EDB documentation contains examples for several storage providers including AWS S3, Google Cloud, Microsoft Azure and Minio. BTS Knowledge center describes how to utilize the S3 compatible storage to backup and restore BTS data.
In some environments, due to some reasons, the S3 compatible storage may be a service that can’t be accessed by CP4BA, so it’s better to provide a different method to backup and restore BTS data without S3 compatible storage.
This Blog describes a method to backup and restore BTS data without S3 compatible storage. To backup and restore BTS data is a sub-step of backup and restore CP4BA, this blog is using Business Automation Workflow (BAW) in IBM CP4BA 22.0.1 as an example, this blog won’t describe too much about the detail steps for backup and restore BAW, more information could reference the IBM Knowledge center.
Please note, the deployment may be different in different user’s environment, so the backup and restore method for that environment maybe some different from others. In below section, it is using following configuration and method to backup and restore:
- Use Offline backup method. i.e. stop related pods before backup, so that there is no new data would be generated during backup, and the backup data could be in consistency state.
- The deployment is using NFS as storage class, so the backup and restore method here based on the file system.
- The deployment is using dynamic provision.
- The deployment is BAW enterprise pattern for CP4BA 22.0.1 with Business Automation Workflow Capability and Content Platform Engine Capability.
- The deployment is using DB2 single server as database server, and there is not configured JDBC over SSL.
Backup BAW environment and Backup BTS
This section describes the steps to backup the BAW environment and backup BTS. Here provides another method to backup BTS data.
- backup following secret: icp4adeploy-cpe-oidc-secret, admin-user-details, ibm-bts-cnpg-bawent-cp4ba-bts-app, and other secrets associated with CR deployment (e.g. DB username/password etc.)
- scale down working pods to 0.
- backup databases.
- backup necessary PVC definition. For example, backup following PVC definitions:
- cpe-filestore-pvc-ctnrs
- icn-cfgstore-ctnrs
- datadir-zen-metastoredb-0
- datadir-zen-metastoredb-1
- datadir-zen-metastoredb-2
- demo-instance1-baw-jms-data-vc-demo-instance1-baw-jms-0
- backup necessary PV files. To be simple, you could backup all files, but we would only restore the necessary files on target env. Please preserve permissions for all content during backup
- backup BTS data. Assumed that the name of BTS EDB pod is ibm-bts-cnpg-bawent-cp4ba-bts-1, execute following commands.
# Firstly, backup BTS database
oc rsh ibm-bts-cnpg-bawent-cp4ba-bts-1
export PX_USER=$(cat /etc/superuser-secret/username)
export PX_PASSWORD=$(cat /etc/superuser-secret/password)
pg_dump -d BTSDB -U postgres -Fp -c -C --if-exists -f /var/lib/postgresql/data/bk_btsdb.sql
exit
# Secondly, copy the backup from the pod.
oc cp ibm-bts-cnpg-bawent-cp4ba-bts-1:/var/lib/postgresql/data/bk_btsdb.sql /tmp/bk_btsdb.sql
- copy the generated bk_btsdb.sql to target environment.
Restore BAW environment and Restore BTS
This section describes the steps to restore the BAW environment and restore BTS.
Prerequisite before restoring:
- IAF/common services should be installed.
- Create a openshift project with exactly the same name as the primary environment.
Please follow below steps to restore the environment.
- restore database
- restore secret for icp4adeploy-cpe-oidc-secret, admin-user-details, ibm-bts-cnpg-bawent-cp4ba-bts-app, and other secrets used for CR deployment (e.g. DB username/password etc.)
- Modify the permission for the PV backup files. Restore site may use different file permission from the source environment.
- Create the necessary PVC, Restore files for corresponding PVs.
- Prepare the custom resource (CR) definition, modify hostname, set “shared_configuration.sc_content_initialization: false” and “shared_configuration.sc_content_verification: false”to avoid redo initialization and verification to break existing data in database. If BAI is enabled, please remove initialize_configuration section in CR.
- Deploy the CR file.
- After deployment completed, copy bk_btsdb.sql to BTS PV folder, so that BTS pod could access bk_btsdb.sql.
- After deployment completed, restore BTS data with following commands:
# Firstly, stop BTS server:
oc scale deployment ibm-bts-cp4ba-bts-316-deployment --replicas=0
# Secondly, login BTS EDB pod to restore BTS data:
oc rsh ibm-bts-cnpg-bawent-cp4ba-bts-1
export PX_USER=$(cat /etc/superuser-secret/username)
export PX_PASSWORD=$(cat /etc/superuser-secret/password)
psql -U postgres -f /var/lib/postgresql/data/bk_btsdb.sql
exit
# Thirdly, restart BTS server.
oc scale deployment ibm-bts-cp4ba-bts-316-deployment --replicas=1
After that, you could verify if BTS data is completed.
Reference:
[1] Knowledge Center - Backing up and restoring: https://www.ibm.com/docs/en/cloud-paks/1.0?topic=service-backup-restore