Offline backup prerequisite tasks

Complete prerequisite tasks before you back up an IBM Cloud Pak® for Data deployment.

Best practice: You can run the commands in these tasks 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 these tasks.

Check the status of installed services

Ensure that the status of all installed services is Completed. Do the following steps.

  1. Run the cpd-cli manage login-to-ocp command to log in to the cluster as a user with sufficient permissions to complete this task. For example:
    cpd-cli manage login-to-ocp \
    --username=${OCP_USERNAME} \
    --password=${OCP_PASSWORD} \
    --server=${OCP_URL}
    Tip: The login-to-ocp command takes the same input as the oc login command. Run oc login --help for details.
  2. Run the following command to get the status of all services.
    cpd-cli manage get-cr-status \
    --cpd_instance_ns=${PROJECT_CPD_INSTANCE}

Prepare Watson Machine Learning

Before you back up the Watson™ Machine Learning service, disable scheduled jobs and (cancel/wait to finish) existing starting/running jobs. Run the following command, replacing <timeout_in_seconds> with the timeout duration for jobs to complete before terminating them:
oc -n ${PROJECT_CPD_INSTANCE} get pods -l app=wml-deployment-manager -o name | xargs -I{} oc -n <service_namespace> exec {} -- bash -c "/opt/ibm/wml-online-scoring/runtime-manager/bin/startQuiesce.sh <timeout_in_seconds>"

Prepare Watson Machine Learning Accelerator

Before you back up the Watson Machine Learning Accelerator service, do the following steps:
  1. Stop all running jobs:
    oc delete $(oc get pj -l release=wmla -o name)
  2. Stop any deployed models, see Stop an inference service.
  3. Stop any notebook servers, see Stopping a notebook server.
  4. If you are using IBM® Storage Fusion, Portworx or Red Hat OpenShift Data Foundation storage, delete conda content from the persistent volume (PV):
    1. Get the conda pod name:
      oc get po |grep wmla-conda
    2. Delete conda PV data from wmla-conda pod:
      oc exec -it wmla-conda-pod-name bash
      bash-4.4$ rm -rfv /opt/conda/*
    3. Delete the conda_synced file from the wmla-conda pod:
      oc exec -it wmla-conda-pod-name bash
      bash-4.4$ rm -rf /var/shareDir/dli/work/conda_synced

Prepare SPSS Modeler

Before you back up the SPSS® Modeler service, stop all active runtimes and jobs. Do the following steps:
  1. Before you start the backup, confirm that you are logged in as cluster administrator.
  2. To stop all active SPSS Modeler runtimes and jobs, run the following commands:
    oc delete rta -l type=service,job -l component=spss-modeler
  3. To check whether any SPSS Modeler runtime sessions are still running, run the following command:
    oc get pod -l type=spss-modeler

    When no pods are running, no output is produced for this command.

Prepare Data Refinery

To avoid any unnecessary data loss, it is recommended that you stop all Data Refinery runtimes and jobs. Do the following steps:
  1. Before you start the backup, confirm that you are logged in as cluster administrator.
  2. To stop all active Data Refinery runtimes and jobs, run the following command:
    oc delete $(oc get deployment -l type=shaper -o name)
    oc delete $(oc get svc -l type=shaper -o name)
    oc delete $(oc get job -l type=shaper -o name)
    oc delete $(oc get secrets -l type=shaper -o name)
    oc delete $(oc get cronjobs -l type=shaper -o name)
    oc scale -\-replicas=0 deploy wdp-shaper wdp-dataprep

Prepare Db2® Warehouse

Add a label to the Db2U cluster so that backups can successfully complete. Do the following steps:

  1. Retrieve the names of the Cloud Pak for Data deployment's Db2U clusters:
    oc get db2ucluster -A -ojsonpath='{.items[?(@.spec.environment.dbType=="db2wh")].metadata.name}'
  2. For each Db2U cluster, do the following substeps:
    1. Export the Db2U cluster name:
      export DB2UCLUSTER=<db2ucluster_name>
    2. Label the cluster:
      oc label db2ucluster ${DB2UCLUSTER} db2u/cpdbr=db2u --overwrite
  3. Verify that the Db2U cluster now contains the new label:
    oc get db2ucluster ${DB2UCLUSTER} --show-labels

Prepare Db2

Add a label to the Db2U cluster so that backups can successfully complete. Do the following steps:

  1. Retrieve the names of the Cloud Pak for Data deployment's Db2U clusters:
    oc get db2ucluster -A -ojsonpath='{.items[?(@.spec.environment.dbType=="db2oltp")].metadata.name}'
  2. For each Db2U cluster, do the following substeps:
    1. Export the Db2U cluster name:
      export DB2UCLUSTER=<db2ucluster_name>
    2. Label the cluster:
      oc label db2ucluster ${DB2UCLUSTER} db2u/cpdbr=db2u --overwrite
  3. Verify that the Db2U cluster now contains the new label:
    oc get db2ucluster ${DB2UCLUSTER} --show-labels

Prepare Watson Knowledge Catalog

If you plan to restore an offline backup to a different cluster, ensure that the wkc-iis-sa service account is in the users section in the Watson Knowledge Catalog security context constraint (SCC). This service account might have been added when the SCC was created. If it wasn't added, run the following command:
oc patch scc wkc-iis-scc --type=merge -p ‘{“users”:[“system:serviceaccount:${PROJECT_CPD_INSTANCE}:wkc-iis-sa”]}’

Prepare Watson Assistant

Ensure that volumes have the necessary labels for backup and restore. Do the following steps.

  1. Back up Watson Assistant.

    For more information, see Backing up and restoring data in the Watson Assistant IBM Cloud docs.

  2. Run the following command to get the name of the Watson Assistant installation (instance) in the Cloud Pak for Data control plane project:
    oc get wa -n ${PROJECT_CPD_INSTANCE}

    Note the name that is returned by this command. You will need this information to clean up and reinstall Watson Assistant after Cloud Pak for Data is restored.

    Typically, the command returns one instance of Watson Assistant. If the command returns more than one instance, contact IBM Support for assistance on ensuring that no data is lost during backup and restore.

Prepare Watson Discovery

Before you back up a cluster where the Watson Discovery service is installed, back up the Watson Discovery data separately by running the Watson Discovery backup script. For more information, see Backing up and restoring data.