Preparing to back up Cloud Pak for Data 4.0 before an upgrade

It is strongly recommended that you backup your IBM Cloud Pak® for Data installation before you upgrade from Version 4.0 to Version 4.6. However, some services do not support the Cloud Pak for Data backup and restore process. If you have any of these services on your cluster, you must exclude the services from your Cloud Pak for Data backup.

If your Cloud Pak for Data installation includes one or more of the following services, you must exclude them from the backup by creating or editing the configmap for the service:

  • Watson™ Assistant
  • Watson Discovery
  • Watson Speech services

Before you begin

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.

Watson Assistant

Add the following configmap to your Watson Assistant deployment.

To complete this task, you must be an administrator of the project where Watson Assistant is installed.

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

    If the command returns more than one instance of Watson Assistant, contact IBM® Support for assistance.

  3. Set the ${INSTANCE_NAME} environment variable to the name of the Watson Assistant instance:
    export INSTANCE_NAME=<wa-instance-name>
  4. Run the following command to create the configmap:
    cat <<EOF | oc apply -f -
    apiVersion: v1
    kind: ConfigMap
    metadata:
      name: cpd-wa-aux-br-cm
      namespace: ${PROJECT_CPD_INSTANCE}
      labels:
        app.kubernetes.io/instance: cpd-wa-aux
        app.kubernetes.io/name: wa-aux
        app.kubernetes.io/version: 1.0.0
        cpdfwk.aux-kind: br
        cpdfwk.component: wa
        cpdfwk.managed-by: ibm-cpd-sre
        cpdfwk.module: wa-aux
        cpdfwk.name: wa-aux-br-cm
        cpdfwk.vendor: ibm
        cpdfwk.version: 1.0.0
    data:
      aux-meta: |-
        name: ibm-watson-assistant-aux
        description: "This is auxiliary meta for backup/restore"
        component: ibm-watson-assistant
        support-instances: false
        aux-kind: br
        priority-order: 100
        managed-resources:
          - resource-kind: deployment
            labels: slot=${INSTANCE_NAME}
          - resource-kind: deployment
            labels: icpdsupport/addOnId=assistant
          - resource-kind: deployment
            labels: app=wa-data-governor
          - resource-kind: deployment
            labels: release=${INSTANCE_NAME}-dwf
          - resource-kind: StatefulSet
            labels: slot=wa
          - resource-kind: StatefulSet
            labels: formation_id=${INSTANCE_NAME}-redis
          - resource-kind: StatefulSet
            labels: release=${INSTANCE_NAME}-dwf-ibm-mt-dwf-rabbitmq
          - resource-kind: StatefulSet
            labels: release=${INSTANCE_NAME}-minio
          - resource-kind: cronjob
            labels: slot=${INSTANCE_NAME}
          - resource-kind: job
            labels: slot=${INSTANCE_NAME}
          - resource-kind: pod
            labels: icpdsupport/addOnId=assistant
          - resource-kind: pod
            labels: postgresql=wa-dwf-ibm-mt-dwf-pg
      backup-meta: |-
        pre-hooks:
          exec-rules:
          - resource-kind: persistentvolumeclaim
            labels: 'icpdsupport/addOnId=assistant'
            actions:
            - builtins:
                name: cpdbr.cpd.ibm.com/label-resources
                params:
                  action: add
                  key: velero.io/exclude-from-backup
                  value: "true"
                timeout: 360s
          - resource-kind: persistentvolumeclaim
            labels: 'icpdsupport/addOnId=assistant'
            actions:
            - builtins:
                name: cpdbr.cpd.ibm.com/label-resources
                params:
                  action: add
                  key: icpdsupport/ignore-on-nd-backup 
                  value: "true"
                timeout: 360s
        post-hooks:
          exec-rules:
          - resource-kind: persistentvolumeclaim
            labels: 'icpdsupport/addOnId=assistant'
            actions:
            - builtins:
                name: cpdbr.cpd.ibm.com/label-resources
                params:
                  action: remove
                  key: velero.io/exclude-from-backup 
                timeout: 360s
          - resource-kind: persistentvolumeclaim
            labels: 'icpdsupport/addOnId=assistant'
            actions:
            - builtins:
                name: cpdbr.cpd.ibm.com/label-resources
                params:
                  action: remove
                  key: icpdsupport/ignore-on-nd-backup
                timeout: 360s
    EOF

Watson Discovery

Update the Watson Discovery configmap.

To complete this task, you must be an administrator of the project where Watson Discovery is installed.

  1. Create a backup of Watson Discovery.
  2. Run the following command to create the configmap:
    cat <<EOF | oc apply -f -
    apiVersion: oppy.ibm.com/v1
    kind: TemporaryPatch
    metadata:
      name: wd-aux-br-patch
    spec:
      apiVersion: discovery.watson.ibm.com/v1
      kind: WatsonDiscovery
      name: wd
      patchType: patchStrategicMerge
      patch:
        commonconfig:
          backup-restore-configmap:
            data:
              aux-meta: |
                  name: watson-discovery-aux
                  description: This is auxiliary meta for lite backup and restore operation
                  version: 1.0.0
                  component: watson-discovery
                  aux-kind: br
                  support-instances: false
                  priority-order: 100
                  managed-resources:
                  - resource-kind: deployment
                    labels: app.kubernetes.io/name=discovery
                  - resource-kind: deployment
                    labels: app.kubernetes.io/name=wd
                  - resource-kind: StatefulSet
                    labels: app.kubernetes.io/name=discovery
                  - resource-kind: deployment
                    labels: icpdsupport/addOnId=discovery
                  - resource-kind: Pod
                    labels: postgresql=wd-discovery-cn-postgres
                  - resource-kind: StatefulSet
                    labels: service=discovery
              backup-meta: |
                pre-hooks:
                  exec-rules:
                  - resource-kind: persistentvolumeclaim
                    labels: "app.kubernetes.io/name in (discovery,wd)"
                    actions:
                    - builtins:
                        name: cpdbr.cpd.ibm.com/label-resources
                        timeout: 360s
                        params:
                          action: add
                          key: velero.io/exclude-from-backup
                          value: 'true'
                  - resource-kind: pod
                    labels: "app.kubernetes.io/name in (discovery,wd)"
                    actions:
                    - builtins:
                        name: cpdbr.cpd.ibm.com/label-resources
                        timeout: 360s
                        params:
                          action: add
                          key: velero.io/exclude-from-backup
                          value: 'true'
                post-hooks:
                  exec-rules:
                  - resource-kind: persistentvolumeclaim
                    labels: "app.kubernetes.io/name in (discovery,wd)"
                    actions:
                    - builtins:
                        name: cpdbr.cpd.ibm.com/label-resources
                        timeout: 360s
                        params:
                          action: remove
                          key: velero.io/exclude-from-backup
                  - resource-kind: pod
                    labels: "app.kubernetes.io/name in (discovery,wd)"
                    actions:
                    - builtins:
                        name: cpdbr.cpd.ibm.com/label-resources
                        timeout: 360s
                        params:
                          action: remove
                          key: velero.io/exclude-from-backup
              restore-meta: |
                post-hooks:
                  exec-rules:
                  - resource-kind: persistentvolumeclaim
                    labels: "app.kubernetes.io/name in (discovery,wd)"
                    actions:
                    - builtins:
                        name: cpdbr.cpd.ibm.com/label-resources
                        timeout: 360s
                        params:
                          action: remove
                          key: velero.io/exclude-from-backup
                  - resource-kind: pod
                    labels: "app.kubernetes.io/name in (discovery,wd)"
                    actions:
                    - builtins:
                        name: cpdbr.cpd.ibm.com/label-resources
                        timeout: 360s
                        params:
                          action: remove
                          key: velero.io/exclude-from-backup
    EOF

Watson Speech services

Update the Watson Speech services configmap.

To complete this task, you must be an administrator of the project where the Watson Speech services are installed.

  1. Create a backup of Watson Speech services data.
  2. Run the following command to get the name of the Watson Speech services custom resource in the Cloud Pak for Data control plane project:
    oc get WatsonSpeech -n ${PROJECT_CPD_INSTANCE}

    The default name is speech-prod-cr.

  3. Set the ${SPEECH_CR_NAME} environment variable to the name of the Watson Speech services custom resource:
    export SPEECH_CR_NAME=<cr-name>
  4. Run the following command to create the following configmap:
    cat <<EOF | oc apply -f -
    apiVersion: v1
    kind: ConfigMap
    metadata:
      name: ${SPEECH_CR_NAME}-aux-backup-restore-configmap
      namespace: ${PROJECT_CPD_INSTANCE}
      labels:
        app.kubernetes.io/component: backup-restore
        app.kubernetes.io/instance: ${SPEECH_CR_NAME}
        app.kubernetes.io/managed-by: Ansible
        app.kubernetes.io/name: speech-to-text
        cpdfwk.aux-kind: br
        cpdfwk.component: speech
        cpdfwk.managed-by: ibm-cpd-sre
        cpdfwk.module: speech-aux
        cpdfwk.name: speech-aux-backup-restore-configmap
        cpdfwk.vendor: ibm
        cpdfwk.version: 1.0.0
        release: ${SPEECH_CR_NAME}
    data:
      aux-meta: |-
        name: speech-aux
        description: This is auxiliary meta for backup and restore operation for Speech services
        version: 1.0.0
        component: speech
        aux-kind: br
        support-instances: false
        priority-order: 100
        managed-resources:
          - resource-kind: deployment
            labels: 'icpdsupport/addOnId=speech'
          - resource-kind: deployment
            labels: 'appName in (stt-customization, tts-customization, stt-async)'
          - resource-kind: pod
            labels: 'release=${SPEECH_CR_NAME},app.kubernetes.io/component=postgres'
          - resource-kind: StatefulSet
            labels: 'release in (${SPEECH_CR_NAME},${SPEECH_CR_NAME}-rabbitmq)'
          - resource-kind: deployment
            labels: 'release in (${SPEECH_CR_NAME}, ${SPEECH_CR_NAME}-tts-cr, ${SPEECH_CR_NAME}-stt-cr)'
      backup-meta: |-
        pre-hooks:
          exec-rules:
          - resource-kind: watsonspeeches.speech.watson.ibm.com
            name: ${SPEECH_CR_NAME}
            actions:
            - builtins:
                name: cpdbr.cpd.ibm.com/enable-quiesce
                params:
                  statusFieldName: speechStatus
                timeout: 3600s
          - resource-kind: pod
            labels: 'release in (${SPEECH_CR_NAME},${SPEECH_CR_NAME}-rabbitmq)'
            actions:
            - builtins:
                name: cpdbr.cpd.ibm.com/label-resources
                params:
                  action: add
                  key: velero.io/exclude-from-backup
                  value: "true"
                timeout: 360s
          - resource-kind: persistentvolumeclaim
            labels: 'release in (${SPEECH_CR_NAME},${SPEECH_CR_NAME}-rabbitmq)'
            actions:
            - builtins:
                name: cpdbr.cpd.ibm.com/label-resources
                params:
                  action: add
                  key: velero.io/exclude-from-backup
                  value: "true"
                timeout: 360s
        post-hooks:
          exec-rules:
          - resource-kind: watsonspeeches.speech.watson.ibm.com 
            name: ${SPEECH_CR_NAME}
            actions:
            - builtins:
                name: cpdbr.cpd.ibm.com/disable-quiesce
                params:
                  statusFieldName: speechStatus
                timeout: 3600s
          - resource-kind: pod
            labels: 'release in (${SPEECH_CR_NAME},${SPEECH_CR_NAME}-rabbitmq)'
            actions:
            - builtins:
                name: cpdbr.cpd.ibm.com/label-resources
                params:
                  action: remove
                  key: velero.io/exclude-from-backup
                timeout: 360s
          - resource-kind: persistentvolumeclaim
            labels: 'release in (${SPEECH_CR_NAME},${SPEECH_CR_NAME}-rabbitmq)'
            actions:
            - builtins:
                name: cpdbr.cpd.ibm.com/label-resources
                params:
                  action: remove
                  key: velero.io/exclude-from-backup
                timeout: 360s
      restore-meta: |-
        post-hooks:
          exec-rules:
          - resource-kind: watsonspeeches.speech.watson.ibm.com
            name: ${SPEECH_CR_NAME}
            actions:
            - builtins:
                name: cpdbr.cpd.ibm.com/disable-quiesce
                params:
                  statusFieldName: speechStatus
                timeout: 3600s
    EOF

What to do next

Create the offline backup of Cloud Pak for Data. Then continue with the upgrade process.