Upgrading existing deployment
This topic explains the procedure to migrate a Kubernetes or Red Hat® OpenShift® cluster.
Before you begin
- Ensure that the System requirements are met.
- Ensure that you have completed the Downloading the Docker assets task.
- Ensure that you understand how the Product Master is installed by using operators. For more information, see Installing (containerized).
- Ensure that deployment YAML files are configured. For more information, see Configuring Product Master deployment YAML.
- Starting from the IBM Product Master 14.0 GA release, all secrets values are passed from the app_secrets.yaml file. Product Master is deprecating random secret usage. You need to take a backup of all the existing secrets and update all values from the random-secret to the app_secrets.yaml file.
- Take backup of the existing release deployment files, customization, app-secret, random-secret,
IBM
Db2® database and MongoDB, and /opt/MDM/public_html
folder of admin pod.
- Backup all the key values present in the random-secret
-
- Take backup by using the following command.
Self-managed
Kubernetes clusterAmazon EKS
cluster
Red Hat OpenShift clusterkubectl get secret random-secret -o jsonpath='{.data}' | jq -r 'to_entries[] | "\(.key): \(.value | @base64d)"' > random-secret.txt
oc get secret random-secret -o jsonpath='{.data}' | jq -r 'to_entries[] | "\(.key): \(.value | @base64d)"' > random-secret.txt
- Update all the values from the random-secret file to the app_secrets.yaml
file by using the following command.
Self-managed Kubernetes
clusterAmazon EKS
cluster
Red Hat OpenShift clusterwhile IFS= read -r line; do key=$(echo $line | cut -d: -f1) value=$(echo $line | cut -d: -f2- | xargs) kubectl patch secret app-secret --type=json -p='[{"op": "add", "path": "/data/'"$key"'", "value":"'"$(echo -n $value | base64)"'"}]' done < random-secret.txt
while IFS= read -r line; do key=$(echo $line | cut -d: -f1) value=$(echo $line | cut -d: -f2- | xargs) oc patch secret app-secret --type=json -p='[{"op": "add", "path": "/data/'"$key"'", "value":"'"$(echo -n $value | base64)"'"}]' done < random-secret.txt
- Ensure all the values that are related to MongoDB and IBM MQ pods are updated in the app-secret
file by using the following command.
Self-managed Kubernetes
clusterAmazon EKS
cluster
Red Hat OpenShift clusterkubectl get secret app-secret -o jsonpath='{.data}' | jq -r 'to_entries[] | "\(.key): \(.value | @base64d)"' | grep '<key>'
oc get secret app-secret -o jsonpath='{.data}' | jq -r 'to_entries[] | "\(.key): \(.value | @base64d)"' | grep '<key>'
- Take backup by using the following command.
Self-managed
Kubernetes clusterAmazon EKS
cluster
- Backup MongoDB
-
- Go to the MongoDB pod by using the following command.
Self-managed Kubernetes clusterAmazon EKS
cluster
Red Hat OpenShift clusterkubectl rsh productmaster-mongodb-5464cb968-qcnts
oc rsh productmaster-mongodb-5464cb968-qcnts
Note: Get the MongoDB user and password through the random-secret file. - Take the backup of the MongoDB database by using the following
command.
$cd /data/db $mongodump \ --username <username> \ --authenticationDatabase admin \ --password <password> \ -d <database_name>
- Download the /data/db/dump folder to your local machine by using the
following command. Self-managed Kubernetes clusterAmazon EKS
cluster
Red Hat OpenShift clusterkubectl rsync productmaster-mongodb-6975f78c4d-4hx5w:/data/db/dump .
oc rsync productmaster-mongodb-6975f78c4d-4hx5w:/data/db/dump .
- Scale down the MongoDB pod by using the following command.
Self-managed Kubernetes clusterAmazon EKS
cluster
Red Hat OpenShift clusterkubectl scale sts <mongodbpodname> --replicas=0
oc scale sts <mongodbpodname> --replicas=0
- Delete the PV and PVC for the MongoDB pod by using the following command.Self-managed Kubernetes clusterAmazon EKS
cluster
kubectl delete pvc <mongodbpvcname>
Red Hat OpenShift clusterkubectl delete pv <mongodbpvname>
oc delete pvc <mongodbpvcname>
oc delete pv <mongodbpvname>
Note: Before provisioning a static volume, you need to first create PV and PVC. For provisioning a dynamic volume there is no need to create separate PV and PVC.
- Go to the MongoDB pod by using the following command.
Self-managed Kubernetes clusterAmazon EKS
cluster
Procedure
What to do next
- After all the pods are up and running, you can log in to the IBM Product Master by using the following URLs.
UI Self-managed Kubernetes cluster Amazon EKS cluster Red Hat OpenShift cluster Persona-based UI https://<hostname>:<nginx_ingress https port>/mdm_ui/#/login https://<hostname>/mdm_ui/#/login https://<hostname>/mdm_ui/#/login Admin UI https://<hostname>:<nginx_ingress https port>/ https://<hostname>/ https://<hostname>/utils/enterLogin.jsp - Perform database migration by accessing the
productmaster-admin-<container-name> pod by using the
following command.
Self-managed Kubernetes clusterAmazon EKS
cluster
Red Hat OpenShift clusterkubectl rsh productmaster-admin-<container-name>
Follow the steps listed in the Migrating to IBM Product Master Version 14.0 topic.oc rsh productmaster-admin-<container-name>
- If you are using dynamic volume provisioning then, you need to restore the MongoDB database that
you backed up in the Backup MongoDB section.
- Copy the dump into the /data/db folder of the MongoDB pod by using the
following command.Self-managed Kubernetes clusterAmazon EKS
cluster
Red Hat OpenShift clusterkubectl rsync dump productmaster-mongodb-0:/data/db
oc rsync dump productmaster-mongodb-0:/data/db
- Restore the MongoDB database by using the following command. This way, the backup gets restored
on the latest MongoDB version.
$ mongorestore --username <username> \ --authenticationDatabase admin \ --password <password> \ /data/db/dump
- Copy the dump into the /data/db folder of the MongoDB pod by using the
following command.Self-managed Kubernetes clusterAmazon EKS
cluster
- If you had done the customization by creating custom images, then to get your customization, follow Customizing the containerized deployment instructions.