Configuring IM with the PostgreSQL database before installing or upgrading
Configure Identity Management (IM) with the embedded or external PostgreSQL database before you install or upgrade foundational services. You cannot migrate data from embedded PostgreSQL to external PostgreSQL after you install or upgrade foundational services.
From foundational services version 4.10, the MongoDB data is removed automatically when the migration is completed. For more information on database migration status, see Database migration status.
For the Isolated migration of the cluster with two or more IBM Cloud PaksĀ® in the same namespace, the MongoDB data is migrated successfully when you upgrade the first IBM Cloud Pak. To migrate the MongoDB data from other IBM Cloud Paks, run the following command:
#!/bin/bash
DB_POD="icp-mongodb-0"
# Execute MongoDB rollback commands
echo 'use samlDB
db.saml.updateMany({}, {$unset:{migrated: null}})
use platform-db
db.cloudpak_ibmid_v3.updateMany({}, {$unset:{migrated: null}})
db.cloudpak_ibmid_v2.updateMany({}, {$unset:{migrated: null}})
db.Directory.updateMany({}, {$unset:{migrated: null}})
db.Users.updateMany({}, {$unset:{migrated: null}})
db.UserPreferences.updateMany({}, {$unset:{migrated: null}})
db.ZenInstance.updateMany({}, {$unset:{migrated: null}})
db.ZenInstanceUsers.updateMany({}, {$unset:{migrated: null}})
db.ScimAttributes.updateMany({}, {$unset:{migrated: null}})
db.ScimAttributeMapping.updateMany({}, {$unset:{migrated: null}})
db.Groups.updateMany({}, {$unset:{migrated: null}})
db.ScimServerUsers.updateMany({}, {$unset:{migrated: null}})
db.ScimServerGroups.updateMany({}, {$unset:{migrated: null}})
use OAuthDBSchema
db.OauthClient.updateMany({}, {$unset:{migrated: null}})' | oc exec -ti $DB_POD -- bash -ec 'mongo --host rs0/mongodb:27017 --username $ADMIN_USER --password $ADMIN_PASSWORD --authenticationDatabase admin --ssl --sslCAFile /data/configdb/tls.crt --sslPEMKeyFile /work-dir/mongo.pem'