Database migration status
The Identity Management (IM) Operator migrates databases as a part of Authentication custom resource (CR) reconciliation. To monitor progress for these migration operations, review the Authentication CR.
Viewing status
To view the status of the Authentication CR, retrieve it from the cluster and look at its .status property.
# SERVICES_NS is the namespace where foundational services Operands, such as the Authentication CR, are installed.
oc get authentication.operator.ibm.com example-authentication -oyaml -n "${SERVICES_NS}"
Verifying status (4.10.0 and later)
In IBM Cloud PakĀ® foundational services versions 4.10.0 and later, you can check the Authentication CR for the progress of the MongoDB to PostgreSQL database migration with the following conditions:
MigrationsPerformed condition
The MigrationsPerformed condition communicates whether all the required migrations for the installation or upgrade process completed or failed.
The following statuses can appear for the MigrationsPerformed condition:
-
Complete: All the required migrations are completed. The status sets to"True"only when all the required migrations are completed. -
Failed: One or more of the required migrations failed, and the status sets to"False". The error message directs you to see the pod logs of the IM Operator for detailed information on the migration failure.
If the migration fails, the IM Operator continues to retry all required migrations until the MigrationsPerformed condition status is set to "True". You can use the values in the .status.conditions section to find the failed migrations.
MigrationsRunning condition
The MigrationsRunning condition communicates the running or completed status of all the required migrations for the installation or upgrade process.
The following statuses can appear for the MigrationsRunning condition:
-
InProgress: The migration is in progress, and the status sets to"False". -
Done: All the required migrations are completed. The status sets to"True"only when all the required migrations that are in progress are completed.
Verifying status (before 4.10.0)
In IBM Cloud Pak foundational services versions before 4.10.0, you can check the progress of the MongoDB to EDB PostgreSQL database migration by viewing the following annotations and conditions on the Authentication CR:
authentication.operator.ibm.com/db-schema-version annotation
The authentication.operator.ibm.com/db-schema-version annotation is set with the database schema version when the IM Operator creates the database schema in the EDB (common-service-db) successfully.
If you need to run the migration again, you can remove the authentication.operator.ibm.com/db-schema-version annotation and set the authentication.operator.ibm.com/migration-complete annotation to false or remove it.
authentication.operator.ibm.com/migration-complete annotation
You can check the completion status of the migration process with the authentication.operator.ibm.com/migration-complete annotation.
If the annotation is set to "true", the IM Operator helps ensure that the migrations that are required for the installation or upgrade process are completed and continue to reconcile the rest of the IM workload. The annotation is set to true automatically when the IM Operator performs all the required migrations successfully.
If the annotation is set to "false", the IM Operator retries the failed migrations until they are migrated successfully. If the IM Operator fails to perform all necessary migrations for an upgrade or installation, it sets this annotation automatically to "false". For more information, see Troubleshooting MongoDB to EDB PostgreSQL database migration issues.
Use the "true" and "false" annotation statuses to control whether the IM Operator runs migrations or not. You can use the annotations when data stored in MongoDB does not adhere to IM's schemas in the EDB or if you want to change the documents in MongoDB before migration to the EDB.
For example, if you need to initiate migration between MongoDB and EDB again, and the EDB schema is already initialized, you can update the annotation to "false". If the EDB schema is not initialized, the migration can also be reattempted when this annotation is set to "false" and by removing the authentication.operator.ibm.com/db-schema-version annotation.
If you update the annotation from "false" to "true", the data migration is stopped between the MongoDB to EDB PostgreSQL database. You can help ensure that the IM Operator does not complete the database activity when you make changes that are related to the databases.
authentication.operator.ibm.com/retain-migration-artifacts annotation
By default, the IM Operator retains the artifacts of the MongoDB to help ensure that the MongoDB to the EDB PostgreSQL database migration is successfully completed. The authentication.operator.ibm.com/retain-migration-artifacts annotation is set to "true" in the Authentication CR to signal the Operator to retain the artifacts of the MongoDB and place finalizers on the resources that need to be connected to the MongoDB instance.
If you want to completely remove the MongoDB after a successful database migration, set the authentication.operator.ibm.com/retain-migration-artifacts annotation to "false". The IM Operator removes the MongoDB resources that exist in the Authentication namespace. The authentication.operator.ibm.com/retain-migration-artifacts and authentication.operator.ibm.com/migration-complete annotations are removed from the Authentication CR when the IM Operator removes the MongoDB resources successfully, and the authentication.operator.ibm.com/db-schema-version annotation is set to the database schema version.
MigrationsPerformed condition (before 4.10.0)
The
MigrationsPerformed condition communicates whether all the required migrations for installation or upgrade processes are completed, in progress, or failed.
The three statuses of the MigrationsPerformed condition are as follows:
-
Complete: All the required migrations are completed. The status sets to"True"only when all the required migrations are completed. -
InProgress: The migration is still in progress and the status sets to"False". -
Failed: One or more of the required migrations failed, and the status sets to"False". The error message directs you to see the pod logs of the IM Operator for detailed information on the migration failure.If the migration fails, the IM Operator continues to retry all required migrations until the
MigrationsPerformedcondition status is set to"True", or theauthentication.operator.ibm.com/migration-completeannotation is set to"true".