Restoring your environments
Each environment in your disaster recovery plan contains different components to be restored.
About this task
Note: The hostname in your
new environment must be the same as the hostname in your source environment.
Procedure
-
Prepare the environment that you want to use to restore your deployments with the backed-up
data.
- Install Red Hat OpenShift with the same version as your source environment. To install, see Installing Red Hat software.
- 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.
- Create a project with the same name as your previous environment.
- Create the secure definition by using the backup secure definitions.
-
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. Make sure that the PVC for
zen-metastoredbis created. - If you are using dynamic provisioning, create the PVC for
cpe-filestore,icn-cfgstore,zen-metastoredb, andjms.
- If you are using static provisioning, restore your PVCs and PVs by using your backup
definitions. Make sure that the PVC for
- 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.
- Configure the LDAP connection and configure the LDAP user to Zen.
- If you took a snapshot of the LDAP virtual machine in your previous environment, restore the snapshot.
-
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/2103/online' taken at 20211213191005 into UMSDB replace existing db2 restore database TOSDB from '/home/db2inst1/backup/2103/online' taken at 20211213191010 into TOSDB replace existing db2 restore database GCDDB from '/home/db2inst1/backup/2103/online' taken at 20211213191016 into GCDDB replace existing db2 restore database AEDB from '/home/db2inst1/backup/2103/online' taken at 20211213191019 into AEDB replace existing db2 restore database ICNDB from '/home/db2inst1/backup/2103/online' taken at 20211213191024 into ICNDB replace existing db2 restore database BAWDB from '/home/db2inst1/backup/2103/online' taken at 20211213191030 into BAWDB replace existing db2 restore database DOCSDB from '/home/db2inst1/backup/2103/online' taken at 20211213191045 into DOCSDB replace existing db2 restore database DOSDB from '/home/db2inst1/backup/2103/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 -
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,zen-metastoredb, andjms. 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/2103 TARGET_DIR=/home/pv/2103 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" ;; *"datadir-zen-metastoredb-"*) 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 - If you are using an NFS based storage, modify the ownership of the files that you
restored in step 7.
- 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 - In your previous environment, check the
uid-rangein the namespace, by running the command:
The output looks similar to:oc describe project bawentName: bawent Created: 20 hours ago ... Annotations: ... ... openshift.io/sa.scc.supplemental-groups= 1000640000/10000 openshift.io/sa.scc.uid-range= 1000640000/10000 - For all restored files, modify the
uidfrom100065000to100064000, by using the following command:find ./ -uid 1000650000 -exec chown 1000640000:root {} \;
- Check the ownership of the backup files, by running a command similar
to:
-
Prepare the custom resource (CR) definition for the restored environment.
- 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.
- 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 - If you need IBM Business Automation Insights, remove the section
initialize_configuration.
- Deploy the environment with the backup CR definition files.
- If you are using IBM Business Automation Insights, use the following links to restore data:
- To restore Business Teams Service (BTS), follow the "Restoring BTS" instructions in Backing up and restoring.
- If you use IBM Automation Decision Services, complete the steps in the following topic.