Upgrading the MongoDB embedded services

Prepare the MongoDB database of IBM Automation Decision Services or IBM Automation Document Processing for the upgrade to 24.0.0.

About this task

You need to check the MongoDB featureCompatibilityVersion (FCV) version before you upgrade to 24.0.0. If the MongoDB featureCompatibilityVersion (FCV) version is 4.4, you need to upgrade the MongoDB featureCompatibilityVersion (FCV) version to 5.0.

Follow the steps in the Procedure section to upgrade the MongoDB featureCompatibilityVersion (FCV) version to 5.0 for IBM Automation Decision Services or IBM Automation Document Processing.

Procedure

  1. Identify a running pod of the MongoDB service that is in use by IBM Automation Decision Services or IBM Automation Document Processing. Depending on the capability you installed, the pod name might vary.
    Run the following command to generate a list of pods.
    oc get pods | grep mongo
    The following example command identifies the MongoDB pod as icp4adeploy-mongo-deploy-6c78656bd4-gh7dt.
    oc get pods | grep mongo
    icp4adeploy-mongo-deploy-6c78656bd4-gh7dt                         1/1     Running     0               142m
    Note: You can ignore the icp-mongo pods and the mongo operator pod as they are related to Cloud Pak foundational services and you do not need to upgrade them manually.
  2. Check the version of MongoDB featureCompatibilityVersion (FCV) version.
    • For 21.0.3-IF031 or later
      Run the following commands.
      oc get pods | grep mongo-deploy
      oc exec icp4adeploy-mongo-deploy-<podID> -- bash -c 'mongo --norc --tls --tlsAllowInvalidCertificates -u "$MONGO_INITDB_ROOT_USERNAME" -p "$MONGO_INITDB_ROOT_PASSWORD" --eval "db.adminCommand({getParameter: 1, featureCompatibilityVersion: 1})"'

      If the MongoDB featureCompatibilityVersion version is 4.4, you need to set the featureCompatibilityVersion version to 5.0.

      If the MongoDB featureCompatibilityVersion version is 5.0, you can skip the following steps.

    • From 24.0.0-IF001 For 22.0.2-IF006
      1. Run the following commands.
        oc get pods | grep mongo-deploy
        oc exec icp4adeploy-mongo-deploy-<podID> -- bash -c 'mongo --norc --tls --tlsAllowInvalidCertificates -u <Mongo-username> -p <Mongo-password> --eval "db.adminCommand({getParameter: 1, featureCompatibilityVersion: 1})"'

        Where <Mongo-username> is the value from file /etc/credentials/admin/MONGO_ROOT_USERNAME and <Mongo-password> is the value from file /etc/credentials/admin/MONGO_ROOT_PASSWORD. You can find the MONGO_ROOT_USERNAME and MONGO_ROOT_PASSWORD files in the Mongo pod.

      2. Upgrade the MongoDB version to 5.0.15 by manually adding the following to the custom resource YAML file and the operator upgrades the Mongo deployment.
        The following custom resource file is for IBM Automation Document Processing.
        ecm_configuration:
          document_processing:
            mongo:
              image:
                repository: cp.icr.io/cp/cp4a/iadp/mongo_adp
                tag: 5.0.15
        The following custom resource file is for IBM Automation Decision Services.
        ads_configuration:
          mongo:
            image:
              repository: cp.icr.io/cp/cp4a/ads/mongo
              tag: 5.0.15
        Note: After you update the custom resource, wait for the Operator to upgrade the mongo-deploy pod before you go to the next step. It might take 20 minutes or longer. You can monitor whether the pod is updated by running the following command periodically and noting the AGE of the pod.
        oc get pods | grep mongo-deploy
  3. Set the MongoDB featureCompatibilityVersion (FCV) version to 5.0.
    • For 21.0.3-IF031 or later
      Run the following command.
      oc exec icp4adeploy-mongo-deploy-<podID> -- bash -c 'mongo --norc --tls --tlsAllowInvalidCertificates -u "$MONGO_INITDB_ROOT_USERNAME" -p "$MONGO_INITDB_ROOT_PASSWORD" --eval "db.adminCommand({ setFeatureCompatibilityVersion: \"5.0\" })"'
    • From 24.0.0-IF001 For 22.0.2-IF006
      Run the following command.
      oc exec icp4adeploy-mongo-deploy-<podID> -- bash -c 'mongo --norc --tls --tlsAllowInvalidCertificates -u <Mongo-username> -p <Mongo-password> --eval "db.adminCommand({ setFeatureCompatibilityVersion: \"5.0\" })"'

      Where <Mongo-username> is the value from file /etc/credentials/admin/MONGO_ROOT_USERNAME and <Mongo-password> is the value from file /etc/credentials/admin/MONGO_ROOT_PASSWORD. You can find the MONGO_ROOT_USERNAME and MONGO_ROOT_PASSWORD files in the Mongo pod.

    If the command is successful, the last line of the output is { "ok" : 1 }.

  4. Verify that the MongoDB featureCompatibilityVersion (FCV) version is updated to 5.0.
    • For 21.0.3-IF031 or later
      Run the following command.
      oc exec icp4adeploy-mongo-deploy-<podID> -- bash -c 'mongo --norc --tls --tlsAllowInvalidCertificates -u "$MONGO_INITDB_ROOT_USERNAME" -p "$MONGO_INITDB_ROOT_PASSWORD" --eval "db.adminCommand({getParameter: 1, featureCompatibilityVersion: 1})"'
    • From 24.0.0-IF001 For 22.0.2-IF006
      Run the following command.
      oc exec icp4adeploy-mongo-deploy-<podID> -- bash -c 'mongo --norc --tls --tlsAllowInvalidCertificates -u <Mongo-username> -p <Mongo-password> --eval "db.adminCommand({getParameter: 1, featureCompatibilityVersion: 1})"'

      Where <Mongo-username> is the value from file /etc/credentials/admin/MONGO_ROOT_USERNAME and <Mongo-password> is the value from file /etc/credentials/admin/MONGO_ROOT_PASSWORD. You can find the MONGO_ROOT_USERNAME and MONGO_ROOT_PASSWORD files in the Mongo pod.

      Important: After you verified that the MongoDB featureCompatibilityVersion (FCV) version is updated to 5.0, you need to remove the image tag that you added in step 2 for both IBM Automation Document Processing and IBM Automation Decision Services from the 24.0.0-IF001 custom resource before you start the upgrade.