Skip to content

Db2 Containerization to OpenShift, Kubernetes, or CP4D

Containerizing an existing Db2 database on an on-premise system to OpenShift, Kubernetes, or CP4D is the most common scenario for using Db2 Shift. In order to move a Db2 database to a POD you will require the following information:

  • Source Database details
  • Destination location
  • Type of Containerization environment
  • Shift Options

The target of the Db2 Shift operation can be OpenShift, a Kubernetes cluster, or Cloud Pak for Data system.

The syntax for running a direct shift from a Db2 database to a POD is:

Shift Pod

db2shift

    Required Options

    --mode=[move | all]    
    --dest-type=POD
    --oc or --kubectl
    --source-dbname=flights
    --source-owner=db2inst1
    --dest-dbname=db2oltp
    --dest-server=c-demo-db2u-0

    Optional Settings

    --dest-namespace=db2u
    --hadr or --keep-rfw-pending
    --online or --offline
    --threads=4
    --compress-level=0
    --exclude-functions
    --sync=[start_sync, rerun_sync, finish_sync]
    --blank-slate=[true|false] or --new-settings=[true|false]
    --gen-settings
    --verify

The panel that provides this capability:

ShiftPOD

Mode Option (Command Line and UI)

The MODE option determines what steps the Db2 Shift program will take to move your database to the new location. The following are the values that move can have.

Move Database Only

Syntax: --mode=move Mode

The MOVE option will take a copy of your Db2 database and copy it into the target Db2U container or instance. No other processing is done with the database.

Move Database and Set up LDAP and DMC Settings (CP4D)

Syntax: --mode=all Mode

If you choose the ALL option, the database will be moved and the program will also apply any security and console settings that are required. This is equivalent to running mode=move and mode=sec_and_monitor one after another. The ALL option is necessary in CP4D environments where the LDAP settings need to be updated and the DMC console needs to be reset to recognize the new database.

Move Database for HADR Setup

Syntax: --mode=move --hadr Mode

When HADR mode is selected, the database will be copied over to the target location and initialized as an HADR secondary. The database can now be connected with the primary database as an HADR pair and participate in failover or readonly applications.

This option cannot be used if your database needs to be migrated or if the database needs to be renamed.

Destination Type (Command Line Only)

Syntax --dest-type=POD

The destination is a POD. This setting is only required when using the command line. It is automatically generated by the UI.

Settings (Command Line and UI)