Navigation

Upgrade MongoDB Version and FCV

On this page

You can upgrade the major, minor, or feature compatibility versions of your MongoDB resource. Configure these settings in your MongoDB Database Resource Specification.

Overview

To upgrade your resource’s major or minor versions, set the spec.version setting to the desired MongoDB version.

To modify your resource’s feature compatibility version, set the spec.featureCompatibilityVersion setting to the desired version.

Note

If you update spec.version to a later version, consider setting spec.featureCompatibilityVersion to the current working MongoDB version to give yourself the option to downgrade if necessary. To learn more about feature compatibility, see setFeatureCompatibilityVersion in the MongoDB Server Documentation.

Procedure

To upgrade the standalone deployment’s MongoDB version from 4.2.2-ent to 4.4.18-ent, complete the steps in the following syntactic example.

If you update spec.version to a later version without setting the spec.featureCompatibilityVersion to any value, the Feature Compatibility Version (FCV) upgrades to the same version that you specify in spec.version. However, you can explicitly specify a previous version for the FCV. The following example illustrates this use case. It sets spec.version to 4.4.18-ent and spec.featureCompatibilityVersion to 4.2.

1

Change the settings in the MongoDB Database Resource Specification as shown in the following example:

  1. Set spec.version to the desired MongoDB version.
  2. Set spec.featureCompatibilityVersion to the current working MongoDB version:
---
apiVersion: mongodb.com/v1
kind: MongoDB
metadata:
 name: my-standalone-downgrade
spec:
 version: "4.4.18-ent"
 featureCompatibilityVersion: "4.2"
 type: Standalone
 project: my-project
 credentials: my-credentials
 persistent: false
...

The following example shows the result of this change:

spec:
  version: "4.4.18-ent"
  featureCompatibilityVersion: "4.2"
2

Reapply the configuration to Kubernetes.

kubectl apply -f <standalone-config>.yaml

Kubernetes automatically reconfigures your deployment with the new specifications. You can see these changes reflected in your Ops Manager or Cloud Manager application.