Rolling back an upgrade

If you want to roll back an upgrade that you pinned, restore your databases and storage backups, delete the custom resource, re-provision the operators and re-create them, and then reapply your previous custom resource YAML file.

Procedure

To roll back an upgrade.

  1. Scale down the containers of the CP4BA operators.
  2. If your database schema changed during the upgrade, scale down your component containers.

    If the database schema did not change or your containers do not communicate with a database, you do not need to scale the component pods to 0. If the schema changed between releases then you do need to scale that specific component down to 0 before you restore the database.

  3. If necessary, restore your databases and storage volumes from the backups that you made before you upgraded.

    If you do restore the database, then you must ensure that the data is consistent between the database and the objects in the persistent volumes.

  4. List the subscriptions in the CP4BA deployment namespace or the openshift-operators namespace if you installed in all namespaces.

    In the Red Hat OpenShift console, go to Workloads > Installed Operators to delete the operators Subscription and the ClusterServiceVersion.

    In the OC CLI, run the following command.

    oc get subscription
  5. Delete all of the subscriptions.

    In the OC CLI, run the following command.

    oc delete subscription <subscription names from previous step>
  6. List the cluster service versions in the CP4BA deployment namespace or the openshift-operators namespace if you installed in all namespaces.

    In the OC CLI, run the following command.

    oc get csv
  7. Delete all of the cluster service versions.

    In the OC CLI, run the following command.

    oc delete csv <csv names from previous step>

    After you removed the Operator Lifecycle Manager (OLM) resources, the custom resource still exists and the installed components continue to be in the cluster.

  8. Delete the custom resource of the upgraded release.

    To roll back from the 23.0.2 release to a 23.0.1 interim fix, delete the existing custom resource. The following command deletes the installed components in the cluster.

    oc delete icp4acluster $(oc get icp4acluster --no-headers | awk '{print $1}')
    Note: To roll back to an interim fix in 23.0.2, for example IF002 to IF001, then you do not need to delete the custom resource.
  9. Install the operators again by applying the previously pinned catalogs and creating the operators in the OpenShift console.

    For more information, see Setting up the cluster.

  10. Retrieve your backup copy of your previous custom resource YAML file.
  11. For IBM FileNet® Content Manager, edit the custom resource YAML to comment out the initialization and verification sections.
  12. Apply the edited custom resource YAML from your previous deployment.
    For example, the following command applies a file that is named my_backup_icp4a_cr.yaml.
    oc apply -f descriptors/my_backup_icp4a_cr.yaml
  13. If you need, you can also roll back the version of the Cloud Pak foundational services.

What to do next

Confirm that the system is restored, and up and running as expected.