Preparing to upgrade IBM Knowledge Catalog

Before you can upgrade IBM Knowledge Catalog to Version 5.2 and migrate all IBM Knowledge Catalog data to the EDB Native PostgreSQL database that is used in Version 5.2, complete several checks and preparation tasks.

This information applies to upgrades from Version 4.8, 5.0, or 5.1.

Before you begin

The commands in the following tasks use environment variables so that you can run the commands exactly as written (see Setting up installation environment variables).

Pre-upgrade tasks

Complete these tasks before you start the upgrade:

  1. Log the cpd-cli in to the Red Hat® OpenShift® Container Platform cluster:
    ${CPDM_OC_LOGIN}
    Remember: CPDM_OC_LOGIN is an alias for the cpd-cli manage login-to-ocp command.
  2. Verify the status of the Db2U StatefulSet and pod:
    oc get sts c-db2oltp-wkc-db2u -n ${PROJECT_CPD_INST_OPERANDS}
    oc get pods c-db2oltp-wkc-db2u-0 -n ${PROJECT_CPD_INST_OPERANDS}
  3. Verify that the Db2 databases that must be migrated are connected:
    kubectl exec -i -n ${PROJECT_CPD_INST_OPERANDS} c-db2oltp-wkc-db2u-0 -- ksh -l -c "db2 connect to LINEAGE"
    kubectl exec -i -n ${PROJECT_CPD_INST_OPERANDS} c-db2oltp-wkc-db2u-0 -- ksh -l -c "db2 connect to WFDB"
    kubectl exec -i -n ${PROJECT_CPD_INST_OPERANDS} c-db2oltp-wkc-db2u-0 -- ksh -l -c "db2 connect to ILGDB"
    kubectl exec -i -n ${PROJECT_CPD_INST_OPERANDS} c-db2oltp-wkc-db2u-0 -- ksh -l -c "db2 connect to BGDB"
  4. For IBM Knowledge Catalog 5.2, four separate PostgreSQL instances are deployed. Each instance is configured with distinct schemas and distinct persistent volume claims (PVCs).

    Check the sizes of the current Db2 databases to calculate the storage that is required for the PostgreSQL instances.

    Get the current database sizes. Specify the commands on a single line:

    BGDB
    This database holds the business glossary.
    kubectl exec -i -n ${PROJECT_CPD_INST_OPERANDS} c-db2oltp-wkc-db2u-0 -- ksh -l -c "db2 connect to BGDB > /dev/null; db2 \"SELECT TABSCHEMA, SUM(DATA_OBJECT_P_SIZE + INDEX_OBJECT_P_SIZE + LONG_OBJECT_P_SIZE + LOB_OBJECT_P_SIZE) AS TOTAL_SCHEMA_SIZE_KB FROM SYSIBMADM.ADMINTABINFO WHERE TABSCHEMA = 'BG' GROUP BY TABSCHEMA\" | awk '/BG/ { printf \"%s: %.2f GB\\n\", \$1, \$NF / (1024 * 1024) }'"
    WFDB
    This database holds workflow data.
    kubectl exec -i -n ${PROJECT_CPD_INST_OPERANDS} c-db2oltp-wkc-db2u-0 -- ksh -l -c "db2 connect to WFDB > /dev/null; db2 \"SELECT TABSCHEMA, SUM(DATA_OBJECT_P_SIZE + INDEX_OBJECT_P_SIZE + LONG_OBJECT_P_SIZE + LOB_OBJECT_P_SIZE) AS TOTAL_SCHEMA_SIZE_KB FROM SYSIBMADM.ADMINTABINFO WHERE TABSCHEMA = 'DB2INST1' GROUP BY TABSCHEMA\" | awk '/DB2INST1/ { printf \"%s: %.2f GB\\n\", \$1, \$NF / (1024 * 1024) }'"
    LINEAGE
    This database hold activity lineage data.
    kubectl exec -i -n ${PROJECT_CPD_INST_OPERANDS} c-db2oltp-wkc-db2u-0 -- ksh -l -c "db2 connect to LINEAGE > /dev/null; db2 \"SELECT TABSCHEMA, SUM(DATA_OBJECT_P_SIZE + INDEX_OBJECT_P_SIZE + LONG_OBJECT_P_SIZE + LOB_OBJECT_P_SIZE) AS TOTAL_SCHEMA_SIZE_KB FROM SYSIBMADM.ADMINTABINFO WHERE TABSCHEMA = 'LINEAGE_TENANT_999' GROUP BY TABSCHEMA\" | awk '/LINEAGE_TENANT_999/ { printf \"%s: %.2f GB\\n\", \$1, \$NF / (1024 * 1024) }'"
    DATAQUALITY
    This database holds data quality information.
    kubectl exec -i -n ${PROJECT_CPD_INST_OPERANDS} c-db2oltp-wkc-db2u-0 -- ksh -l -c "db2 connect to LINEAGE > /dev/null; db2 \"SELECT TABSCHEMA, SUM(DATA_OBJECT_P_SIZE + INDEX_OBJECT_P_SIZE + LONG_OBJECT_P_SIZE + LOB_OBJECT_P_SIZE) AS TOTAL_SCHEMA_SIZE_KB FROM SYSIBMADM.ADMINTABINFO WHERE TABSCHEMA = 'DATAQUALITY' GROUP BY TABSCHEMA\" | awk '/DATAQUALITY/ { printf \"%s: %.2f GB\\n\", \$1, \$NF / (1024 * 1024) }'"

    This database is available only if the data quality feature is enabled in your deployment.

    ILGDB
    This database holds information that is related to the data privacy service.
    kubectl exec -i -n ${PROJECT_CPD_INST_OPERANDS} c-db2oltp-wkc-db2u-0 -- ksh -l -c "db2 connect to ILGDB > /dev/null; db2 \"SELECT TABSCHEMA, SUM(DATA_OBJECT_P_SIZE + INDEX_OBJECT_P_SIZE + LONG_OBJECT_P_SIZE + LOB_OBJECT_P_SIZE) AS TOTAL_SCHEMA_SIZE_KB FROM SYSIBMADM.ADMINTABINFO WHERE TABSCHEMA = 'DB2INST1' GROUP BY TABSCHEMA\" | awk '/DB2INST1/ { printf \"%s: %.2f GB\\n\", \$1, \$NF / (1024 * 1024) }'"
  5. Expand the PVCs based on the results from the previous steps.

    Edit the wkc-cr custom resource. You can do this manually or run an oc patch command. Update the values for the following parameters in the spec section.

    Set the variables for the Postgres instances as follows.

    Consider the numbers in the instructions as the required minimum. If you expect future growth, feel free to increase the numbers accordingly. The variables for the different databases, for example $BGDB, refer to the sizes of the Db2 schemas that you determined in the previous step.

    If the DATAQUALITY database exists, the required space on the migration volume of the dataquality migration is 3.5 times the space of the DATAQUALITY database. If the DATAQUALITY database does not exist, assume the $DATAQUALITY value to be 0 in your calculations. In version 5.2.0, do not set the ikc_dataquality_postgres_migration_storage_size variable in the wkc-cr custom resource.

    You can determine the value of the $CURRENT_PROFILING_PVC_SIZE variable by checking the size of the wdp-profiling-cloud-native-postgresql-1 PVC.

    The default value for each storage size is 50 GB. If your calculation yields a lower value for one of the entries, you do not need to update the respective variable in the CR.

    5.2.0 Variables and PVCs in Version 5.2.0
    Variable to set in the CR Name of the affected PVC Minimum value
    ikc_glossary_workflow_postgres_storage_size ikc-glossary-workflow-postgres $BGDB + $WFDB
    activity_lineage_postgres_storage_size ikc-activity-lineage-postgres $LINEAGE
    wdp_profiling_edb_postgres_storage_size wdp-profiling-cloud-native-postgresql $DATAQUALITY + $CURRENT_PROFILING_PVC_SIZE
    ikc_dp_dps_bidata_mde_mdi_postgres_storage_size ikc-dp-dps-bidata-mde-mdi-postgres $ILGDB + 20 GB (to account for metadata import and reporting data)
    ikc_postgres_migration_storage_size ikc-db2-postgres-migration-<component> max($BGDB, $WFDB, $LINEAGE, $DATAQUALITY*3.5, $ILGDB)
    5.2.1 and later Variables and PVCs in Version 5.2.1 and later
    Variable to set in the CR Name of the affected PVC Minimum value
    ikc_glossary_workflow_postgres_storage_size ikc-glossary-workflow-postgres $BGDB + $WFDB
    activity_lineage_postgres_storage_size ikc-activity-lineage-postgres $LINEAGE
    wdp_profiling_edb_postgres_storage_size wdp-profiling-cloud-native-postgresql $DATAQUALITY + $CURRENT_PROFILING_PVC_SIZE
    ikc_dp_dps_bidata_mde_mdi_postgres_storage_size ikc-dp-dps-bidata-mde-mdi-postgres $ILGDB + 20 GB (to account for metadata import and reporting data)
    ikc_dataquality_postgres_migration_storage_size ikc-db2-postgres-migration-dataquality $DATAQUALITY*3.5
    ikc_dps_postgres_migration_storage_size ikc-db2-postgres-migration-dps $ILGDB
    ikc_glossary_postgres_migration_storage_size ikc-db2-postgres-migration-glossary $BGDB
    ikc_wdplineage_postgres_migration_storage_size ikc-db2-postgres-migration-wdplineage $LINEAGE
    ikc_workflow_postgres_migration_storage_size ikc-db2-postgres-migration-workflow $WFDB

    The changes are applied when you upgrade your system.