Restoring your environment

Each environment in your disaster recovery plan contains different components to be restored.

About this task

You must prepare the environment that you want to use to restore your deployments with the backed-up data. To back up your data, see Backing up your environment.
Note: The IBM Cloud Pak® for Business Automation disaster recovery solution requires backing up and restoring both IBM Cloud Pak for Business Automation components and Cloud Pak foundational services. The IBM Cloud Pak for Business Automation disaster recovery documentation only provides backup and restore instructions for IBM Cloud Pak for Business Automation components. For instructions to back up and restore Cloud Pak foundational services, contact the Cloud Pak foundational services team.

Procedure

  1. Prepare the environment that you want to use to restore your deployments with the backed-up data.
    1. Install Red Hat OpenShift with the same version as your source environment. To install, see Installing Red Hat software.
    2. Install the IBM Cloud Pak for Business Automation operator by following the steps in Preparing for a production deployment to prepare and set up your environment.

      If your capability has an operator, you must also install that operator. For example, if you want to restore IBM Workflow Process Service, you must install the IBM Workflow Process Service operator.

  2. Create a project with the same name as your previous environment.
  3. Create the secure definition by using the backup secure definitions.
  4. Restore the persistent volumes (PV) and persistent volume claims (PVC):
    • If you are using static provisioning, restore your PVCs and PVs by using your backup definitions.
    • If you are using dynamic provisioning, create the PVC for cpe-filestore, icn-cfgstore, and jms.
  5. If you previously used Lightweight Directory Access Protocol (LDAP), restore the LDAP server. Different types of LDAP servers have different methods for restoring. For IBM Security Directory Server, see IBM Security Directory Server backup and restore. If you took a snapshot of the LDAP virtual machine in your previous environment, restore the snapshot.
  6. Restore all the databases from the backup images. For example, if you are using PostgreSQL, restore the data by using the database command pg_restore. If you are using Db2 with online backup, you can restore your databases by using the following commands:
    db2 restore database  UMSDB  from '/home/db2inst1/backup/2400/online' taken at 20211213191005 into  UMSDB  replace existing 
    db2 restore database  TOSDB  from '/home/db2inst1/backup/2400/online' taken at 20211213191010 into  TOSDB  replace existing 
    db2 restore database  GCDDB  from '/home/db2inst1/backup/2400/online' taken at 20211213191016 into  GCDDB  replace existing 
    db2 restore database  AEDB   from '/home/db2inst1/backup/2400/online' taken at 20211213191019 into  AEDB  replace existing 
    db2 restore database  ICNDB  from '/home/db2inst1/backup/2400/online' taken at 20211213191024 into  ICNDB  replace existing 
    db2 restore database  BAWDB  from '/home/db2inst1/backup/2400/online' taken at 20211213191030 into  BAWDB  replace existing 
    db2 restore database  DOCSDB  from '/home/db2inst1/backup/2400/online' taken at 20211213191045 into  DOCSDB  replace existing 
    db2 restore database  DOSDB  from '/home/db2inst1/backup/2400/online' taken at 20211213191049 into  DOSDB  replace existing 
     
    db2 rollforward db UMSDB to end of logs and stop 
    db2 rollforward db TOSDB to end of logs and stop 
    db2 rollforward db GCDDB to end of logs and stop 
    db2 rollforward db AEDB to end of logs and stop 
    db2 rollforward db ICNDB to end of logs and stop 
    db2 rollforward db BAWDB to end of logs and stop 
    db2 rollforward db DOCSDB to end of logs and stop 
    db2 rollforward db DOSDB to end of logs and stop 
  7. Restore the files stored on the PV. Keep the same folder structure, the same user group information, and the same permissions.
    If you are using an NFS based storage, you can use the following script to restore PV content for PVCs such as cpe-filestore, icn-cfgstore, and jms. The script does not restore log files. If you want to restore the log files, you need to copy the log files to the corresponding PV.
    #!/bin/sh 
     
    NS=bawent 
    SOURCE_DIR=/home/pv/2400 
    TARGET_DIR=/home/pv/2400 
    BACKUP_DIR=/home/backup 
     
    pvrestore() { 
        oc get pvc -n $NS --no-headers=true | while read each
        do
            pvc=`echo $each | awk '{ print $1 }'`
            pv=`echo $each | awk '{ print $3 }'`
               
            case $pvc in
                *"cpe-filestore"*)  echo "restore $pvc" ;;
                *"icn-cfgstore"*)  echo "restore $pvc" ;;
                *"baw-jms-data-"*)  echo "restore $pvc" ;;
                *"jms-pvc-"*)  echo "restore $pvc" ;;
                *) continue ;;
            esac
            if [  -d "$BACKUP_DIR/$pvc" ]
            then
               echo "    cp -r -a $BACKUP_DIR/$pvc/.  $TARGET_DIR/$NS-$pvc-$pv/ "
               cp -r -a $BACKUP_DIR/$pvc/*  $TARGET_DIR/$NS-$pvc-$pv/
            else
               echo "NOT FOUND for $pvc"
            fi
        done
    } 
     
    pvrestore 
  8. If you are using an NFS based storage, modify the ownership of the files that you restored in step 7.
    1. Check the ownership of the backup files, by running a command similar to:
      drwxr-x--- 3 1000650000 root    4096 Dec 13 18:13 demo-instance1-baw-server-0 
    2. In your previous environment, check the uid-range in the namespace, by running the command:
      oc describe project bawent
      The output looks similar to:
      Name:                   bawent 
      Created:                20 hours ago 
      ... 
      Annotations:            ... ... 
                              openshift.io/sa.scc.supplemental-groups= 1000640000/10000 
                                    openshift.io/sa.scc.uid-range= 1000640000/10000 
    3. For all restored files, modify the uid from 100065000 to 100064000, by using the following command:
      find ./  -uid  1000650000  -exec chown 1000640000:root {} \; 
  9. Prepare the custom resource (CR) definition for the restored environment.
    1. If the previous environment's hostname is different than the restored environment's hostname, change the hostname in the CR files to match the hostname of the restored environment.
    2. If initialization was completed in the original deployment, set the following values in your CR to avoid reinitialization and verification that might cause an error in your database data:
      shared_configuration.sc_content_initialization: false
      shared_configuration.sc_content_verification: false
    3. If you need IBM Business Automation Insights, remove the section initialize_configuration.
  10. Deploy the environment with the backup CR definition files.
  11. If you upgraded from version 21.0.3 to 24.x, you need to register WLP_CLIENT_ID and WLP_CLIENT_SECRET in Identity Access Management.
    1. Use the command oc describe configmap ibm-common-services-status -n kube-public to check the Identity Access Management status.
    2. If the Identity Access Management status is "Ready", find the ibm-common-services/registration-json configmap on the restored cluster and save it as platform-oidc-registration.json.
    3. Update client_id and client_secret in platform-oidc-registration.json with the value of WLP_CLIENT_ID and WLP_CLIENT_SECRET from step 9 in Backing up your environment.
    4. See Client Registration API to register with the platform-oidc-registration.json file that was generated in the previous step.
  12. If you are using IBM Business Automation Insights, use the following links to restore data:
  13. To restore Business Teams Service (BTS), follow the "Restoring BTS" instructions in Backing up and restoring.
  14. If you use IBM Automation Decision Services, complete the steps in the following topic.