Offline backup prerequisite tasks
Complete prerequisite tasks before you back up an IBM Cloud Pak® for Data deployment.
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.
-
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: Thelogin-to-ocp
command takes the same input as theoc login
command. Runoc login --help
for details. - 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
<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
- Stop all running
jobs:
oc delete $(oc get pj -l release=wmla -o name)
- Stop any deployed models, see Stop an inference service.
- Stop any notebook servers, see Stopping a notebook server.
- If you are using IBM® Storage
Fusion,
Portworx or Red Hat OpenShift Data Foundation storage, delete conda content
from the persistent volume (PV):
- Get the conda pod name:
oc get po |grep wmla-conda
- Delete conda PV data from wmla-conda pod:
oc exec -it wmla-conda-pod-name bash bash-4.4$ rm -rfv /opt/conda/*
- 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
- Get the conda pod name:
Prepare SPSS Modeler
- Before you start the backup, confirm that you are logged in as cluster administrator.
- To stop all active SPSS
Modeler runtimes and
jobs, run the following
commands:
oc delete rta -l type=service,job -l component=spss-modeler
- 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
- Before you start the backup, confirm that you are logged in as cluster administrator.
- 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:
- 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}'
- For each Db2U cluster, do the following substeps:
- Export the Db2U cluster
name:
export DB2UCLUSTER=<db2ucluster_name>
- Label the
cluster:
oc label db2ucluster ${DB2UCLUSTER} db2u/cpdbr=db2u --overwrite
- Export the Db2U cluster
name:
- 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:
- 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}'
- For each Db2U cluster, do the following substeps:
- Export the Db2U cluster
name:
export DB2UCLUSTER=<db2ucluster_name>
- Label the
cluster:
oc label db2ucluster ${DB2UCLUSTER} db2u/cpdbr=db2u --overwrite
- Export the Db2U cluster
name:
- Verify that the Db2U cluster now contains the new
label:
oc get db2ucluster ${DB2UCLUSTER} --show-labels
Prepare Watson Knowledge Catalog
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.
- Back up Watson
Assistant.
For more information, see Backing up and restoring data in the Watson Assistant IBM Cloud docs.
- 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.