|
| 1 | +=============================== |
| 2 | +Upgrade MongoDB Version and FCV |
| 3 | +=============================== |
| 4 | + |
| 5 | +.. default-domain:: mongodb |
| 6 | + |
| 7 | +You can upgrade the major, minor, and/or feature compatibility versions |
| 8 | +of your MongoDB resource. These settings are configured in your |
| 9 | +resource's |k8s-configmap|. |
| 10 | + |
| 11 | +- To upgrade your resource's major and/or minor versions, set the |
| 12 | + :setting:`spec.version` setting to the desired MongoDB version. |
| 13 | + |
| 14 | +- To modify your resource's |
| 15 | + :manual:`feature compatibility version |
| 16 | + </reference/command/setFeatureCompatibilityVersion/>`, set |
| 17 | + the :setting:`spec.featureCompatibilityVersion` setting to the desired |
| 18 | + version. |
| 19 | + |
| 20 | +.. note:: |
| 21 | + |
| 22 | + If you update ``spec.version`` to a later version, consider setting |
| 23 | + :setting:`spec.featureCompatibilityVersion` to the current working |
| 24 | + MongoDB version to give yourself the option to downgrade if |
| 25 | + necessary. |
| 26 | + |
| 27 | + To learn more about feature compatibility, see |
| 28 | + :dbcommand:`setFeatureCompatibilityVersion` in the MongoDB Manual. |
| 29 | + |
| 30 | +Example |
| 31 | +------- |
| 32 | + |
| 33 | +Consider the following |k8s-configmap| for a standalone resource: |
| 34 | + |
| 35 | +.. code-block:: yaml |
| 36 | + :emphasize-lines: 7 |
| 37 | + |
| 38 | + --- |
| 39 | + apiVersion: mongodb.com/v1 |
| 40 | + kind: MongoDB |
| 41 | + metadata: |
| 42 | + name: my-standalone-downgrade |
| 43 | + spec: |
| 44 | + version: 3.6.12 |
| 45 | + type: Standalone |
| 46 | + project: my-project |
| 47 | + credentials: my-credentials |
| 48 | + persistent: false |
| 49 | + ... |
| 50 | + |
| 51 | +This resource has a MongoDB version of ``3.6.12``. The following steps |
| 52 | +upgrade the deployment's MongoDB version to ``4.0.6``: |
| 53 | + |
| 54 | +1. Perform the following modifications to the resource's |
| 55 | + ConfigMap: |
| 56 | + |
| 57 | + a. Set :setting:`spec.version` to the desired MongoDB version. |
| 58 | + |
| 59 | + #. Set :setting:`spec.featureCompatibilityVersion` to the current |
| 60 | + working MongoDB version: |
| 61 | + |
| 62 | + .. code-block:: yaml |
| 63 | + :emphasize-lines: 7-8 |
| 64 | + |
| 65 | + --- |
| 66 | + apiVersion: mongodb.com/v1 |
| 67 | + kind: MongoDB |
| 68 | + metadata: |
| 69 | + name: my-standalone-downgrade |
| 70 | + spec: |
| 71 | + version: 4.0.6 |
| 72 | + featureCompatibilityVersion: 3.6 |
| 73 | + type: Standalone |
| 74 | + project: my-project |
| 75 | + credentials: my-credentials |
| 76 | + persistent: false |
| 77 | + ... |
| 78 | + |
| 79 | + .. note:: |
| 80 | + |
| 81 | + Setting ``featureCompatibilityVersion`` to ``3.6`` disables |
| 82 | + :manual:`4.0 features that persist data incompatible with MongoDB 3.6 |
| 83 | + </release-notes/4.0-compatibility/#compatibility-enabled>`. |
| 84 | + |
| 85 | +2. Reapply the configuration to |k8s|: |
| 86 | + |
| 87 | + .. code-block:: none |
| 88 | + |
| 89 | + kubectl apply -f <standalone-config>.yaml |
| 90 | + |
| 91 | +|k8s| automatically reconfigures your deployment with the new |
| 92 | +specifications. You can see these changes reflected in the |
| 93 | +|mms| or `Cloud Manager <docs.cloudmanager.com/current/>`__ |
| 94 | +:abbr:`UI (User Interface)`. |
| 95 | + |
0 commit comments