IBM Software Hub online backup and restore to the same cluster with the OADP utility

A Red Hat® OpenShift® Container Platform cluster administrator can create an online backup and restore it to the same cluster with the IBM Software Hub OADP utility.

Before you begin

Do the following tasks before you back up and restore a IBM Software Hub deployment.

  1. Check whether the services that you are using support platform backup and restore by reviewing Services that support backup and restore. You can also run the following command:
    cpd-cli oadp service-registry check \
    --tenant-operator-namespace ${PROJECT_CPD_INST_OPERATORS} \
    --verbose \
    --log-level debug

    If a service is not supported, check if one of the following alternatives is available:

  2. Install the software that is needed to back up and restore IBM Software Hub with the OADP utility.

    For more information, see Installing and configuring the software for the OpenShift API for Data Protection backup and restore utility.

  3. If you want to enable an instance administrator to do tasks related to backup and restore, you must give the instance administrator admin permissions on the project where the backup and restore utility is installed

    For more information, see Authorizing an instance administrator to manage backups.

  4. Install the cpdbr-tenant service and the Backup Restore Orchestration service for the instance.

    For more information, see Installing the backup and restore software for an instance of IBM Software Hub.

  5. Check that your IBM Software Hub deployment meets the following requirements:
    • The minimum deployment profile of IBM Cloud Pak foundational services is Small.

      For more information about sizing IBM Cloud Pak foundational services, see Hardware requirements and recommendations for foundational services.

    • All services are installed at the same IBM Software Hub release.

      You cannot back up and restore a deployment that is running service versions from different IBM Software Hub releases.

    • The control plane is installed in a single project (namespace).
    • The IBM Software Hub instance is installed in zero or more tethered projects.
    • IBM Software Hub operators and the IBM Software Hub instance are in a good state.
  6. Source your existing environment variables.

    Best practice: You can run the commands in this task exactly as written if you set up environment variables. For instructions, see Setting up installation environment variables.

    Ensure that you source the environment variables before you run the commands in this task.

Overview

When an online backup is taken, Kubernetes resources are stored in object storage, and Container Storage Interface (CSI) volume snapshots of the data are stored locally on the cluster. As a result, the OADP backup and restore utility can restore online backups only to the same cluster.

Best practice: Because CSI snapshots are stored locally, consider other online backup and restore options to avoid data loss in the event of a disaster to the same cluster. For more information, see IBM Software Hub online backup and restore to a different cluster (disaster recovery).
Backing up an IBM Software Hub deployment and restoring it to the same cluster involves the following high-level steps:
  1. Preparing to back up IBM Software Hub
  2. Creating an online backup
  3. Cleaning up the cluster before restoring IBM Software Hub
  4. Restoring IBM Software Hub
  5. Completing post-restore tasks

1. Preparing to back up IBM Software Hub

Complete the following prerequisite tasks before you create an online backup. Some tasks are service-specific, and need to be done only when those services are installed.

You can use the following strategies for restoring from an online backup:
Restore to the same namespace

You can restore a backup to the same namespace. The backup is restored to the same project as the IBM Software Hub instance, which replaces the current project with the backup.

Restore to a different namespace

Tech preview This is a technology preview and is not supported for use in production environments.

You can restore a backup to a different namespace. Restoring to a different namespace remaps the data in the backup into a new target project instead of the original project of the IBM Software Hub instance. The new project can exist in parallel to the original project of the IBM Software Hub instance.

Note: Some services cannot be restored to a different namespace. These services are excluded from the restore. To see which services are included in the restore, see Services that support back up and restore.

1.1 Checking the version of OADP utility components

Check that you installed the correct version of OADP components.
  1. Check that the OADP operator version is compatible with the OpenShift Container Platform version.
    oc get csv -A | grep "OADP Operator"
    OpenShift Container Platform Version OADP Version
    Version 4.16 Version 1.4
    Version 4.18 Version 1.4
    Version 4.19 Version 1.5
    Version 4.20 Version 1.5
    Version 4.21 Version 1.5
  2. Check that the cpd-cli oadp version (5.4.x.x) matches the IBM Software Hub version:
    cpd-cli oadp version

    For example, for IBM Software Hub 5.4.0, the version needs to be 5.4.0. For IBM Software Hub 5.4.0 Patch 1, it needs to be 5.4.0.1.

1.2 Optional: Estimating how much storage to allocate for backups

You can estimate the amount of storage that you need to allocate for backups.

Note: Do not use this feature in production environments.

To use this feature, you must install the cpdbr-agent in the Red Hat OpenShift cluster. The cpdbr-agent deploys the node agents to the cluster. The node agents must be run in privileged mode.

  1. Log in to Red Hat OpenShift Container Platform as a cluster administrator or tenant administrator:
    ${OC_LOGIN}
    Remember: OC_LOGIN is an alias for the oc login command.
  2. Install the cpdbr-agent by running the following command:
    cpd-cli oadp install --component=cpdbr-agent --namespace=${OADP_PROJECT} --cpd-namespace=${PROJECT_CPD_INST_OPERANDS}
  3. Export the following environment variable:
    export CPDBR_ENABLE_FEATURES=volume-util
  4. Estimate how much storage you need to allocate to a backup by running the following command:
    cpd-cli oadp du-pv \
    --namespace=${OADP_PROJECT} \
    --cpd-namespace=${PROJECT_CPD_INST_OPERANDS}

1.3 Checking the primary instance of every PostgreSQL cluster is in sync with its replicas

The replicas for Cloud Native PostgreSQL and EDB Postgres clusters occasionally get out of sync with the primary node. To check whether this problem exists and to fix the problem, see the troubleshooting topic PostgreSQL cluster replicas get out of sync.

1.4 Preparing IBM Knowledge Catalog

If large metadata enrichment jobs are running while an online backup operation is triggered, the Db2 pre-backup hooks might fail because the database cannot be put into a write-suspended state. It is recommended to have minimal enrichment workload while the online backup is scheduled.

1.5 Labeling external NFS volumes

If you have external Network Files System (NFS) volumes in the IBM Software Hub instance that you want to backup, each of these NFS volumes needs to be labelled.

Note: When you take a backup, you're only backing up the NFS volume configuration, such as the connection details. The actual data remains on the external NFS server.
  1. Use the following command to label the NFS volume:
    NAMESPACE=<namespace_of_the_external_NFS_pvc>
    oc label pvc <pvc-name> -n $NAMESPACE cpdbr.cpd.ibm.com/external-volume=nfs
    

1.6 Excluding external volumes from backups

You can exclude external Persistent Volume Claims (PVCs) in the IBM Software Hub instance project (namespace) from online backups.

You might want to exclude PVCs that were manually created in the IBM Software Hub project (namespace) but are not needed by services. These volumes might be too large for a backup, or they might already be backed up by other means.

Note: During restore, you might need to manually create excluded PVCs if pods fail to start because of an excluded PVC.
  1. Log in to Red Hat OpenShift Container Platform as a cluster administrator.
    ${OC_LOGIN}
    Remember: OC_LOGIN is an alias for the oc login command.
  2. Use the following command to label the PVCs that you want to exclude:
    oc label pvc <pvc-name> icpdsupport/ignore-on-nd-backup=true

1.7 Checking the status of installed services

Ensure that the status of all installed services is Completed. Do the following steps:
  1. Log the cpd-cli in to the Red Hat OpenShift Container Platform cluster:
    ${CPDM_OC_LOGIN}
    Remember: CPDM_OC_LOGIN is an alias for the cpd-cli manage login-to-ocp command.
  2. Run the following command to get the status of all services.
    cpd-cli manage get-cr-status \
    --cpd_instance_ns=${PROJECT_CPD_INST_OPERANDS}

2. Creating an online backup

Create an online backup of a IBM Software Hub deployment by doing the following tasks.

When you run cpd-cli oadp commands, the Backup Restore Orchestration service processes them asynchronously. For some steps, check to make sure that the process completes before continuing.

2.1 Backing up the scheduling service

If the IBM Software Hub scheduling service is installed, create a backup of the service.

Backups that are created in IBM Cloud Pak® for Data 5.0 cannot be restored in IBM Software Hub 5.10.0. You must take new backups in 5.10.0.

Check the Known issues and limitations for IBM Software Hub page for any workarounds that you might need to do before you create a backup.

Restriction: You cannot install IBM Software Hub scheduling service on s390x clusters (IBM Z and LinuxONE), so you cannot backup or restore the scheduling service to these clusters.
  1. Run the backup and restore utility in Kubernetes mode, and log in to Red Hat OpenShift Container Platform as a cluster administrator:
    ${OC_LOGIN}
    Remember: OC_LOGIN is an alias for the oc login command.
  2. Configure the OADP client to set the IBM Software Hub project to the scheduling service project:
    cpd-cli oadp client config set cpd-namespace=${PROJECT_SCHEDULING_SERVICE}
  3. Configure the OADP client to set the OADP project to the project where the OADP operator is installed:
    cpd-cli oadp client config set namespace=${OADP_PROJECT}
  4. Run service backup prechecks:
    cpd-cli oadp backup precheck \
    --backup-type singleton \
    --include-namespaces=${PROJECT_SCHEDULING_SERVICE} \
    --log-level=debug \
    --verbose \
    --hook-kind checkpoint
  5. Back up the IBM Software Hub scheduling service:
    cpd-cli oadp backup create \
    --backup-type singleton ${PROJECT_SCHEDULING_SERVICE}-online \
    --include-namespaces ${PROJECT_SCHEDULING_SERVICE} \
    --include-resources='clusterrole,clusterrolebinding,role,rolebinding,serviceaccount,deployment,configmap,customresourcedefinitions.apiextensions.k8s.io,scheduling.scheduler.spectrumcomputing.ibm.com,secret' \
    --prehooks=false \
    --posthooks=false \
    --with-checkpoint \
    --log-level=debug \
    --verbose \
    --hook-kind checkpoint \
    --selector 'icpdsupport/addOnId in (scheduling, bros),icpdsupport/ignore-on-nd-backup notin (true)' \
    --include-cluster-resources=true
    
  6. Validate the backup:
    cpd-cli oadp backup validate \
    --backup-type singleton \
    --include-namespaces=${PROJECT_SCHEDULING_SERVICE} \
    --backup-names ${PROJECT_SCHEDULING_SERVICE}-online \
    --log-level trace \
    --verbose \
    --hook-kind checkpoint
    

2.2 Backing up an IBM Software Hub instance

Create an online backup of each IBM Software Hub instance, or tenant, in your environment by doing the following steps.

Notes:
  • If the IBM Knowledge Catalog service is installed, and a lineage data import job is running at the same time as you are creating a backup, the job might fail. In this case, rerun the job.

  • If service-related custom resources are manually placed into maintenance mode prior to creating an online backup, those custom resources will remain in the same state if the backup is restored. Taking these services out of maintenance mode must be done manually after the restore.

  • The storage provider that you use to store backups might limit the number of snapshots that you can take per volume. For more information, consult your storage provider documentation.
  • For s390x clusters (IBM Z and LinuxONE), you must run the backup and restore commands from an x86_64 workstation.

Check the Known issues and limitations for IBM Software Hub page for any workarounds that you might need to do before you create a backup.

  1. If you are running the backup and restore utility in Kubernetes mode, and log in to Red Hat OpenShift Container Platform as a cluster administrator or tenant administrator:
    ${OC_LOGIN}
    Remember: OC_LOGIN is an alias for the oc login command.
  2. Create a backup:
    cpd-cli oadp tenant-backup create ${BACKUP_NAME} \
    --tenant-operator-namespace ${PROJECT_CPD_INST_OPERATORS} \
    --log-level=debug \
    --verbose &> ${BACKUP_NAME}.log&
  3. Use the cpd-cli oadp wait command to monitor the status of the tenant-backup create until it completes.
    CR_NAME=tenantbackups
    TIMEOUT=2h
    cpd-cli oadp wait \
    --br-operator-namespace ${BR_OPERATOR_NS} \
    --cr ${CR_NAME} \
    --name ${BACKUP_NAME} \
    --runtime-mode operator \
    --timeout ${TIMEOUT}

    For a list of all the custom resources that you can wait for, see oadp wait.

  4. Confirm that the tenant backup was created and has a Completed status:
    cpd-cli oadp tenant-backup list
  5. To view the detailed status of the backup, run the following command:
    cpd-cli oadp tenant-backup status ${BACKUP_NAME} \
    --details
    The command shows the following sub-backups:
    Backup Description
    cpd-tenant-xxx Backup that contains Kubernetes resources.
    cpd-tenant-vol-yyy Backup that contains volume data.
    Tip: If you need more information, listed in the status details are sub-backups (of type group). You can view more information about these sub-backups by running the following command:
    cpd-cli oadp backup status <SUB_BACKUP_NAME> \
    --details
  6. To view logs of the tenant backup and all sub-backups, run the following command:
    cpd-cli oadp tenant-backup log ${BACKUP_NAME}
Best practice: If you have services that connect to an external database, such as for business intelligence (BI) reporting, it is recommended that you also back up the database. Backing up the external database ensures data consistency if the IBM Software Hub backup is later restored. For example, you need to restore an older IBM Software Hub backup instead of the most recent backup. The external database is synchronized with the most recent IBM Software Hub backup, so it has data that is not in the backup that you want to restore. To maintain data consistency, you need to restore the external database backup that was taken at the same time as the IBM Software Hub backup.

3. Cleaning up the cluster before a restore

Before you can restore a IBM Software Hub deployment to the same cluster, you must delete the existing IBM Software Hub instance projects.

Important: Tech preview If you are restoring to a different namespace, then deleting the existing IBM Software Hub instance project is optional. You can keep the original instance project as long as the cluster has sufficient resources.

Resources in the IBM Software Hub instance are watched and managed by operators and controllers that run in other projects. To prevent corruption or out of sync operators and resources when you delete a IBM Software Hub instance, Kubernetes resources that have finalizers specified in metadata must be located, and those finalizers must be deleted before you can delete the IBM Software Hub instance.

  1. Log in to Red Hat OpenShift Container Platform as an instance administrator.
    ${OC_LOGIN}
    Remember: OC_LOGIN is an alias for the oc login command.
  2. Download the cpd-pre-restore-cleanup.sh script for your version of IBM Software Hub.
  3. If the tenant operator project exists and has the common-service NamespaceScope custom resource that identifies all the tenant projects, run the following command:
    ./cpd-pre-restore-cleanup.sh --tenant-operator-namespace="${PROJECT_CPD_INST_OPERATORS}"
  4. If the tenant operator project does not exist or specific IBM Software Hub projects need to be deleted, run the following command.

    If the common-service NamespaceScope custom resource is not available and additional projects, such as tethered projects, need to be deleted, modify the list of comma-separated projects in the --additional-namespaces option as necessary.

    ./cpd-pre-restore-cleanup.sh --additional-namespaces="${PROJECT_CPD_INST_OPERATORS},${PROJECT_CPD_INST_OPERANDS}"

4. Preparing to restore to a new namespace

If you want to restore a backup of an IBM Software Hub deployment to a different project (namespace), you need to set up some requirements for the new namespace. You can skip these steps if you plan to restore to the same namespace.

Tech preview This is a technology preview and is not supported for use in production environments.

  1. Check that the cpdbr-tenant service role-based access control and the Backup Restore Orchestration service role-based access control are installed. If you did not install them while installing IBM Software Hub, follow the step for installing role-based access controls in Installing the software for backing up an instance by using the OADP backup and restore utility.
  2. If you are using the License Service, update the WATCH_NAMESPACE environment variable so that it includes both the original projects and the mapped target projects.
    1. Log in to Red Hat OpenShift Container Platform as a cluster administrator:
      ${OC_LOGIN}
      Remember: OC_LOGIN is an alias for the oc login command.
    2. Run the following command to find the WATCH_NAMESPACE environment variable in the ibm-licensing-operator deployment.
      IBM_LICENSING_OPERATOR_NS=ibm-licensing
      IBM_LICENSING_WATCH_NAMESPACE_INDEX=$(oc get deployment ibm-licensing-operator -n ${IBM_LICENSING_OPERATOR_NS} -o json | \
        jq '.spec.template.spec.containers[0].env | map(.name == "WATCH_NAMESPACE") | index(true)')
    3. Patch the ibm-licensing-operator deployment so its WATCH_NAMESPACE environment variable includes the new namespace. Include ${TETHERED_NAMESPACES} if you have tethered namespaces.
      oc patch deployment ibm-licensing-operator -n ${IBM_LICENSING_OPERATOR_NS} \
        --type='json' \
        -p="[{
          \"op\": \"replace\",
          \"path\": \"/spec/template/spec/containers/0/env/${IBM_LICENSING_WATCH_NAMESPACE_INDEX}\",
          \"value\": {
            \"name\": \"WATCH_NAMESPACE\",
            \"value\": \"${PROJECT_CPD_INST_OPERATORS},${PROJECT_CPD_INST_OPERANDS},${PROJECT_CPD_INST_OPERATORS_NEW},${PROJECT_CPD_INST_OPERANDS_NEW}\"
          }
        }]"
      

5. Restoring IBM Software Hub to the same cluster

Restore an online backup of a IBM Software Hub deployment to the same cluster by doing the following tasks. You can restore the backup to either the same project (namespace) or a different project.

5.1 Restoring the scheduling service

If the IBM Software Hub scheduling service was installed on the cluster at the time that you backed up IBM Software Hub, then you must install or restore the service on the cluster before you restore the IBM Software Hub instance.

You can also restore the scheduling service if you are experiencing problems with the service.

Note: Before you can restore a backup of the scheduling service on the same cluster, you must uninstall the service. For details, see Uninstalling the scheduling service.

Check the Known issues and limitations for IBM Software Hub page for any workarounds that you might need to do before you restore a backup.

  1. Log in to Red Hat OpenShift Container Platform as a cluster administrator or tenant administrator:
    ${OC_LOGIN}
    Remember: OC_LOGIN is an alias for the oc login command.
  2. Configure the OADP client to set the IBM Software Hub project to the scheduling service project:
    cpd-cli oadp client config set cpd-namespace=${PROJECT_SCHEDULING_SERVICE}
  3. Configure the OADP client to set the OADP project to the project where the OADP operator is installed:
    cpd-cli oadp client config set namespace=${OADP_PROJECT}
  4. Restore an online backup.
    cpd-cli oadp restore create ${PROJECT_SCHEDULING_SERVICE}-restore \
    --from-backup=${PROJECT_SCHEDULING_SERVICE}-online \
    --include-resources='clusterrole,clusterrolebinding,role,rolebinding,serviceaccount,deployment,configmap,customresourcedefinitions.apiextensions.k8s.io,scheduling.scheduler.spectrumcomputing.ibm.com,secret' \
    --include-cluster-resources=true \
    --skip-hooks \
    --log-level=debug \
    --verbose

5.2 Restoring an IBM Software Hub instance

Restore an IBM Software Hub instance by doing the following steps. The steps depend on whether you want to restore the backup to the same namespace or a different namespace.

Notes:
  • Check the Known issues and limitations for IBM Software Hub page for any workarounds that you might need to do before you restore a backup.

  • If service-related custom resources are manually placed into maintenance mode before an online backup is created, those custom resources remain in the same state if the backup is restored. Taking these services out of maintenance mode must be done manually after the restore.

  • For s390x clusters (IBM Z and LinuxONE), you must run the backup and restore commands from an x86_64 workstation
  • If running a restore command produces a Failed or PartiallyFailed error, you must clean up the IBM Software Hub instance and restart the restore process.

Best practice: If your IBM Software Hub deployment has services that connect to an external database, and you followed the recommendation to back up the database at the same time that you back up IBM Software Hub, restore the database backup that was taken at the same time as the IBM Software Hub backup.
Restore to the same namespace
  1. Log in to Red Hat OpenShift Container Platform as a cluster administrator or tenant administrator:
    ${OC_LOGIN}
    Remember: OC_LOGIN is an alias for the oc login command.
  2. Restore IBM Software Hub to the original project:
    cpd-cli oadp tenant-restore create ${TENANT_BACKUP_NAME}-restore \
    --from-tenant-backup ${TENANT_BACKUP_NAME} \
    --verbose \
    --log-level=debug &> ${TENANT_BACKUP_NAME}-restore.log&
Restore to a different namespace

Tech preview This is a technology preview and is not supported for use in production environments.

  1. Source the environment variables used to map the source and target namespaces. The mapping is used later in the restore commands. For instructions, see Setting up installation environment variables

    Make sure you have the following environment variables defined:

    • PROJECT_CPD_INST_OPERATORS
    • PROJECT_CPD_INST_OPERATORS_NEW
    • PROJECT_CPD_INST_OPERANDS
    • PROJECT_CPD_INST_OPERANDS_NEW
    • RESTORE_PROJECT_MAPPING
      • This environment variable must include ${PROJECT_INST_BR_SVC}:${PROJECT_INST_BR_SVC_NEW}

    If tenant projects are part of the backup, add those project mappings to RESTORE_PROJECT_MAPPING.

  2. Log in to Red Hat OpenShift Container Platform as a cluster administrator:
    ${OC_LOGIN}
    Remember: OC_LOGIN is an alias for the oc login command.
  3. Use the following command to create a YAML file that contains the definitions for clusterrolebindings, clusterroles, and webhook configurations.
    cpd-cli oadp restore cluster-scoped-resources \
    --namespace-mappings=${RESTORE_PROJECT_MAPPING} \
    --from-tenant-backup ${BACKUP_NAME} \
    --verbose \
    --log-level=debug \
    -f cluster_scoped_resources_${BACKUP_NAME}.yaml
  4. Use the following command to create the resources.
    oc create -f cluster_scoped_resources_${BACKUP_NAME}.yaml
  5. Use the following command to generate a YAML file that contains the cluster-scoped resources needed to restore the backup to different namespace.
    cpd-cli oadp tenant-restore create ${RESTORE_NAME} \
      --from-tenant-backup=${BACKUP_NAME} \
      --log-level=trace \
      --namespace-mappings=${RESTORE_PROJECT_MAPPING} \
      --override-group-attributes excludedResourceTypes:clusterrolebindings,clusterroles,mutatingwebhookconfigurations,validatingwebhookconfigurations \
      --verbose &> ${RESTORE_NAME}.log&

5.3 Monitor the progress of the restore

Monitor the progress of the restore operation and troubleshoot issues by using the following commands. These commands can provide details about the restore operation, such as a list of restores, detailed status information, and logs.

  1. Get the status of the installed components:
    1. Log the cpd-cli in to the Red Hat OpenShift Container Platform cluster:
      ${CPDM_OC_LOGIN}
      Remember: CPDM_OC_LOGIN is an alias for the cpd-cli manage login-to-ocp command.
    2. Run the appropriate command for your environment:
      Installations with tethered projects
      cpd-cli manage get-cr-status \
      --cpd_instance_ns=${PROJECT_CPD_INST_OPERANDS} \
      --tethered_instance_ns=${PROJECT_CPD_INSTANCE_TETHERED_LIST}
      Installations without tethered projects
      cpd-cli manage get-cr-status \
      --cpd_instance_ns=${PROJECT_CPD_INST_OPERANDS}
    3. Check that all services have the status Completed or Succeeded.
  2. To view a list of restores, run the following command:
    cpd-cli oadp tenant-restore list
  3. To view the detailed status of the restore, run the following command:
    cpd-cli oadp tenant-restore status ${RESTORE_NAME} \
    --details
    The command shows a varying number of sub-restores in the following form:
    cpd-tenant-r-xxx
    Tip: If you need more information, you can find sub-restores (of type group) listed in the status details. You can view more information about these sub-restores by running the following command:
    cpd-cli oadp restore status <SUB_RESTORE_NAME> \
    --details
  4. To view logs of the tenant restore, run the following command:
    cpd-cli oadp tenant-restore log ${RESTORE_NAME}

6. Completing post-restore tasks

Complete additional tasks for the control plane and for some services after you restore a IBM Software Hub deployment.

6.1 Applying cluster HTTP proxy settings or other RSI patches to the control plane

If you applied cluster HTTP proxy settings or other RSI patches to an IBM Software Hub instance in the source cluster, the evictor cronjob runs every 30 minutes to patch pods that did not get patched. Optionally, you can run the following command to apply the patches:
cpd-cli manage apply-rsi-patches --cpd_instance_ns=${PROJECT_CPD_INST_OPERANDS} -vvv

6.2 Patching Cognos Analytics instances

If a Db2 OLTP database within the cluster is used for a Cognos Analytics content store or audit database, the Cognos Analytics service instance must be patched. Because the Db2 database host and port might be different in the target cluster, update these values in the Cognos Analytics service instance to the correct values to ensure that the instance starts successfully. Do the following steps:
  1. Patch the content store and audit database ports in the Cognos Analytics service instance by running the following script:
    #!/usr/bin/env bash
    #-----------------------------------------------------------------------------
    #Licensed Materials - Property of IBM
    #IBM Cognos Products: ca
    #(C) Copyright IBM Corp. 2024
    #US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule
    #-----------------------------------------------------------------------------
    set -e
    #set -x
    
    function usage {
        echo $0: usage: $0 [-h] -t tethered_namespace -a audit_db_port_number -c cs_db_port_number [-v]
    }
    
    function help {
        usage
        echo "-h prints help to the console"
        echo "-t tethered namespace (required)"
        echo "-a Audit DB port number"
        echo "-c CS DB port number"
        echo "-v turn on verbose mode"
        echo ""
        exit 0
    }
    
    while getopts ":ht:a:c:v" opt; do
        case ${opt} in
            h)
                help
                ;;
            t)
                tethered_namespace=$OPTARG
                ;;
            a)
                audit_db_port_number=$OPTARG
                ;;
            c)
                cs_db_port_number=$OPTARG
                ;;
            v)
                verbose_flag="true"
                ;;
            ?)
                usage
                exit 0
                ;;
        esac
    done
    
    if [[ -z ${tethered_namespace} ]]; then
        echo "A tethered namespace must be provided"
        help
    fi
    
    echo "Get CAServiceInstance Name"
    cr_name=$(oc -n ${tethered_namespace} get caserviceinstance --no-headers -o custom-columns=NAME:.metadata.name)
    if [[ -z ${cr_name} ]]; then
        echo "Unable to find CAServiceInstance CR for namespace: ${tethered_namespace}"
        help
    fi
    
    if [[ ! -z ${cs_db_port_number} ]]; then
        echo "Updating CS Database Port Number in the Custom Resource ${cr_name}..."
        oc patch caserviceinstance ${cr_name} --type merge -p "{\"spec\":{\"cs\":{\"database_port\":\"${cs_db_port_number}\"}}}" -n ${tethered_namespace}
    fi
    
    if [[ ! -z ${audit_db_port_number} ]]; then
        echo "Updating Audit Database Port Number in the Custom Resource ${cr_name}..."
        oc patch caserviceinstance ${cr_name} --type merge -p "{\"spec\":{\"audit\":{\"database_port\":\"${audit_db_port_number}\" }}}" -n ${tethered_namespace}
    fi
    
    sleep 20
    check_status="Completed"
  2. Check the status of the Cognos Analytics reconcile action:
    for i in {1..240};do
    caStatus=$(oc get caserviceinstance ${cr_name} -o jsonpath="{.status.caStatus}" -n ${tethered_namespace})
    
    if [[ ${caStatus} == ${check_status} ]];then
        echo "ca ${check_status} Successfully"
        break
    elif [[ ${caStatus} == "Failed" ]];then
        echo "ca ${caStatus}!"
        exit 1
    fi
    echo "ca Status: ${caStatus}"
    sleep 30
    
    done

6.3 Patching Watson OpenScale database

If a Db2 or Db2 Warehouse database in the cluster is used as data mart database in Watson OpenScale, the port must be updated. Because the Db2 database port might be different after restoring, update the port in the Watson OpenScale instance database to the correct value. You can update the port through the Watson OpenScale user interface or API.

6.4 Resetting status of ongoing Watson OpenScale model evaluations

When a Watson OpenScale instance is restored, some of its features, such as scheduled or on-demand model evaluations, might not function properly. You must reset the status of ongoing model evaluations. For details, see Resetting status of ongoing Watson OpenScale model evaluations.

6.5 Restarting Data Replication replications

After IBM Software Hub is restored, do the following steps:
  1. Connect to the restored IBM Software Hub instance.
  2. Go to the restored replications and stop them.
  3. Restart the replications.

6.6 Restarting IBM Knowledge Catalog metadata import jobs

After IBM Software Hub is restored, long running metadata import jobs might not resume. The job run status might still be Running, even though the actual import job isn't running. The job must be canceled and manually restarted. You can cancel and restart a job in IBM Knowledge Catalog or by using an API call.
Cancel and restart a job in IBM Knowledge Catalog
  1. Go to a Jobs page, either the general one or the one for the project that contains the metadata import asset.
  2. Look for the job and cancel it.
  3. Restart the job.
Cancel and restart a job by using an API call
Note: You must have the Admin role to use this API call.
post /v2/metadata_imports/recover_task

The request payload must look like the following example. For recovery_date, specify the date when IBM Knowledge Catalog was restored from the backup image. Any jobs that were started before the specified date are restarted automatically.

{
  "recovery_date": "2022-05-05T01:00:00Z",
  "pending_type": "running"
}

6.7 Restarting IBM Knowledge Catalog metadata enrichment jobs

After IBM Software Hub is restored, running metadata enrichment jobs might not complete successfully. Such jobs must be manually restarted.

To restart a metadata enrichment job, do the following steps:
  1. In IBM Knowledge Catalog, open the project that contains the metadata enrichment asset.
  2. Select the asset.
  3. Click the Button to start or delete an enrichment job. button of the asset and then click Enrich to start a new enrichment job.

6.8 Rerunning IBM Knowledge Catalog lineage data import jobs

If a lineage data import job is running at the same time that an online backup is taken, the job is in a Complete state when the backup is restored. However, users cannot see lineage data in the catalog. Rerun the lineage import job.

6.9 Restarting IBM Knowledge Catalog lineage pods

After a restore, restart the following lineage pods so that you can access lineage data from the knowledge graph:
  • wkc-data-lineage-service-xxx
  • wdp-kg-ingestion-service-xxx
Do the following steps:
  1. Log in to Red Hat OpenShift Container Platform as a cluster administrator or tenant administrator:
    ${OC_LOGIN}
    Remember: OC_LOGIN is an alias for the oc login command.
  2. Restart the wkc-data-lineage-service-xxx pod:
    oc delete -n ${PROJECT_CPD_INST_OPERANDS} "$(oc get pods -o name -n ${PROJECT_CPD_INST_OPERANDS} | grep wkc-data-lineage-service)"
  3. Restart the wdp-kg-ingestion-service-xxx pod:
    oc delete -n ${PROJECT_CPD_INST_OPERANDS} "$(oc get pods -o name -n ${PROJECT_CPD_INST_OPERANDS} | grep wdp-kg-ingestion-service)"

6.10 Retraining existing watsonx Assistant skills

After restoring the watsonx Assistant backup, it is necessary to retrain the existing skills. This involves modifying a skill, to trigger training. The training process for a skill typically requires less than 10 minutes to complete. For more information, see the Retraining your backend model section in the IBM Cloud documentation.

6.11 Restoring services that do not support online backup and restore

The following list shows the services that don't support online backup and restore. If any of these services are installed in your IBM Software Hub deployment, actions must be taken after an online backup is restored to make them functional.
Data Gate
Data Gate synchronizes Db2 for z/OS data in real time. After IBM Software Hub is restored, data might be out of sync from Db2 for z/OS. It is recommended that you re-add tables after IBM Software Hub foundational services are restored.
MANTA Automated Data Lineage
The service is functional and data can be re-imported. For information about importing data, see Managing existing metadata imports (IBM Knowledge Catalog).