Skip to content

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

Manual upgrades of Percona Server for MongoDB

The default and recommended way to upgrade the database cluster is using the Smart Update strategy. The Operator controls how objects are updated and restarts the Pods in a proper order during the database upgrade or for other events that require the cluster update. To these events belong ConfigMap updates, password rotation or changing resource values.

In some cases running an automatic upgrade of Percona Server for MongoDB is not an option. For example, if the database upgrade impacts your application, you may want to have a full control over the upgrade process.

Running a manual database upgrade allows you to do just that. You can use one of the following upgrade strategies:

Rolling Update strategy and semi-automatic updates

To run a semi-automatic update of Percona Server for MongoDB, 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. Edit the deploy/cr.yaml file and set the updateStrategy key to RollingUpdate.

  3. 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
    

Manual upgrade (the On Delete strategy)

To upgrade Percona Server for MongoDB manually, do 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. Edit the deploy/cr.yaml file and set the updateStrategy key to OnDelete.

  3. The Pod with the newer Percona Server for MongoDB image will start after you delete it. Delete targeted Pods manually one by one to make them restart in the desired order:

    1. Delete the Pod using its name with the command like the following one:

      $ kubectl delete pod my-cluster-name-rs0-2
      
    2. Wait until Pod becomes ready:

      $ kubectl get pod my-cluster-name-rs0-2
      

      The output should be like this:

      NAME                    READY   STATUS    RESTARTS   AGE
      my-cluster-name-rs0-2   1/1     Running   0          3m33s
      

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-05-20