Seamless upgrade Db2 Data Gate instance to latest Cloud Pak for Data 4.6 version

IBM Db2 for z/OS Data Gate blog series

Fan Jing
5 min readDec 7, 2022

Introduce the seamless instance upgrade from IBM Db2 for z/OS Data Gate 2.6.0 to 3.0.0.

By Fan Jing

Introduction

From other blog posts, you may already have a glimpse of the product IBM Db2 for z/OS Data Gate (What is Db2 Data Gate? Db2 Data Gate Blog Series Part 1), as well as some of its new features and functionalities, such as Better and flexible metadata support and New synchronization workload metrics. In this blog, we will discuss another new feature of Data Gate 3.0.0, seamless instance upgrade. In a nutshell, seamless instance upgrade allows users to keep their existing Db2 Data Gate instances when they upgrade CP4D 4.5 to future latest version. It is no longer necessary to remove the old instance and provision a new one when users upgrade CP4D. It also preserve the instance configuration and your table definitions.

Prerequisites

  1. Install Db2 Data Gate 2.6.0, provision a Data Gate instance

2. Add some tables to the Db2 Data Gate instance and start synchronization for them

3. Do some operations in the source Db2 for z/OS, the overview tab will clearly show the system status and table/query statistics, while the graphs on the Monitor tab show the synchronization latency, synchronization throughput, and a few statistics regarding the source data and the logs, which are designed for Db2 Data Gate 2.6.0.

We could also confirm that we are using Db2 Data Gate 2.6.0 from the result of the following command:

oc get csv -A | grep gate

ibm-common-services ibm-datagate-operator.v2.6.0 IBM Datagate Service 2.6.0 Succeeded
oc get sub -A | grep gate

ibm-common-services ibm-datagate-operator-subscription ibm-datagate-operator ibm-datagate-operator-catalog v2.6
oc get datagateservices

NAME VERSION BUILD STATUS RECONCILED
datagateservice-cr 2.6.0 2.0.1059 Completed 2.6.0
oc get datagateinstanceservices

NAME VERSION BUILD STATUS RECONCILED
dg1670334974915924 2.6.0 2.0.1059 Completed 2.6.0

Within the operator container, we could find that latest stands for 2.6.0:

How to upgrade Data Gate from 2.6.0 to 3.0.0

  1. Logging in to the cluster
cpd-cli manage login-to-ocp \
--username=${OCP_USERNAME} \
--password=${OCP_PASSWORD} \
--server=${OCP_URL}

2. Updating the operator

cpd-cli manage apply-olm \
--release=${VERSION} \
--cpd_operator_ns=${PROJECT_CPD_OPS} \
--upgrade=true

or

cloudctl case launch --case ibm-datagate-prod-***.tgz --inventory datagateOperatorSetup --namespace ${PROJECT_CPD_OPS} --action install-catalog --tolerance=1

After that, confirm that the channel of datagate operator subscription is v3.0 now:

oc get sub -A | grep gate
ibm-common-services ibm-datagate-operator-subscription ibm-datagate-operator ibm-datagate-operator-catalog v3.0

Manually edit the subscription and change its channel to v3.0 if it always show v2.6.

Data Gate csv is 3.0.0 then:

oc get csv -A | grep gate
ibm-common-services ibm-datagate-operator.v3.0.0 IBM Datagate Service 3.0.0 ibm-datagate-operator.v2.6.0 Succeeded

Within the operator container, we could find that latest stands for 3.0.0 now:

3. Upgrading the service

cpd-cli manage apply-cr \
--components=datagate \
--release=${VERSION} \
--cpd_instance_ns=${PROJECT_CPD_INSTANCE} \
--block_storage_class=${STG_CLASS_BLOCK} \
--file_storage_class=${STG_CLASS_FILE} \
--license_acceptance=true \
--upgrade=true

or

oc patch datagateservices datagateservice-cr --type merge 
-p '{"spec":{"version":"dg_version"}}'

or

manually edit the datagateservices datagateservice-cr and change its version to 3.0.0.

4. Validating the upgrade

You can run the cpd-cli manage get-cr-status command if you want to confirm that the custom resource status is Completed after the apply-cr command ran successfully:

cpd-cli manage get-cr-status \
--cpd_instance_ns=${PROJECT_CPD_INSTANCE} \
--components=datagate

Also you could check the result of oc get datagateservices command to confirm that Data Gate service is upgraded.

oc get datagateservices
NAME VERSION BUILD STATUS RECONCILED AGE
datagateservice-cr 3.0.0 2.0.1173 Completed 3.0.0 3h18m

5. Upgrading each Db2 Data Gate deployment

5.1 Find the instance identifier (the result will be under “NAME”):

oc get dginstance

5.2 Run the oc patchcommand, specifying 3.0.0 as the dg_version, to upgrade the Db2 Data Gate deployment. Replace instance_id with the deployment identifier that you obtained from the oc get dginstancecommand:

oc patch dginstance instance_id --type merge 
-p '{"spec":{"version":"dg_version", "metadata":{"version":"dg_version"}}}'

6. Verifying the deployment upgrade

You can use a command to verify that the deployment was upgraded and is ready to use.

Run the following command and wait for the status to change to Completed:

oc get dginstance instance_id -o jsonpath='{.status.datagateInstanceStatus} {"\n"}'

From UI, you could find that your tables are still there,

while the dashboard and monitor tabs are showing more things now, which are designed for Db2 Data Gate 3.0.0,

it proves that you’ve upgraded data gate service and instance successfully now. Congratulations!

--

--