Skip to content

For help, click the link below to get free database assistance or contact our experts for personalized support.

Upgrade to a specific version

Assumptions

For the procedures in this tutorial, we assume that you have set up the Smart Update strategy to update the objects in your database cluster.

Read more about the Smart Update strategy and other available ones in the Upgrade strategies section.

Procedure

To upgrade Percona Server for MongoDB to a specific version, do the following:

  1. Check the version of the Operator you have in your Kubernetes environment. If you need to update it, refer to the Operator upgrade guide.

  2. Check the Custom Resource manifest configuration to be the following:

    • spec.updateStrategy option is set to SmartUpdate
    • spec.upgradeOptions.apply option is set to Disabled or Never.
    ...
    spec:
      updateStrategy: SmartUpdate
      upgradeOptions:
        apply: Disabled
        ...
    
  3. Check the current version of the Custom Resource and what versions of the database and cluster components are compatible with it. Use the following command:

    $ curl https://check.percona.com/versions/v1/psmdb-operator/1.19.1 |jq -r '.versions[].matrix'
    

    You can also find this information in the Versions compatibility matrix.

  4. Update the database, the backup and PMM Client image names with a newer version tag. Find the image names in the list of certified images.

    We recommend to update the PMM Server before the upgrade of PMM Client. If you haven’t done it yet, exclude PMM Client from the list of images to update.

    Since this is a working cluster, the way to update the Custom Resource is to apply a patch with the kubectl patch psmdb command.

    This example command updates the cluster with the name my-cluster-name to the 1.19.1 version:

    $ kubectl patch psmdb my-cluster-name --type=merge --patch '{
       "spec": {
          "crVersion":"1.19.1",
          "image": "percona/percona-server-mongodb:7.0.14-8",
          "backup": { "image": "percona/percona-backup-mongodb:2.8.0" },
          "pmm": { "image": "percona/pmm-client:2.44.0" }
       }}'
    
    $ kubectl patch psmdb my-cluster-name --type=merge --patch '{
       "spec": {
          "crVersion":"1.19.1",
          "image": "percona/percona-server-mongodb:7.0.14-8",
          "backup": { "image": "percona/percona-backup-mongodb:2.8.0" }
       }}'
    
  5. After you applied the patch, the deployment rollout will be triggered automatically. You can track the rollout process in real time using the kubectl rollout status command with the name of your cluster:

    $ kubectl rollout status sts my-cluster-name-rs0
    

The update process is successfully finished when all Pods have been restarted. If you turned on Percona Server for MongoDB Sharding, the mongos and Config Server nodes must be restarted too to complete the upgrade.


Last update: 2025-04-25