MongoDB version update

You can update Managed Service for MongoDB clusters from version 3.6 to 4.0.

Before updating

Prior to updating the cluster, make sure this doesn't affect your apps:

  1. Read the release notes MongoDB to see if any changes may affect your app.
  2. Try updating a test cluster (you can try deploying it from a backup of the main cluster).
  3. Make a backup of the main cluster before updating.

Updating a cluster

To update a Managed Service for MongoDB cluster:

  1. Open the Managed Service for MongoDB page in the folder with the cluster to be updated.
  2. Select the cluster from the list and click Edit cluster.
  3. In the Version field, select 4.0.
  4. Click Save changes.

When the update starts, the cluster status switches to UPDATING. Wait for the operation to complete and then check the cluster version.

  1. Get a list of your MongoDB clusters:

    $ yc managed-mongodb cluster list
    +----------------------+---------------+---------------------+--------+---------+
    |          ID          |     NAME      |     CREATED AT      | HEALTH | STATUS  |
    +----------------------+---------------+---------------------+--------+---------+
    | c9q8p8j2gaih8iti42mh |   mongodb406  | 2019-04-23 12:44:17 | ALIVE  | RUNNING |
    +----------------------+---------------+---------------------+--------+---------+
    
  2. Get information about a cluster and check the MongoDB version in the config.version parameter:

    $ yc managed-mongodb cluster get c9qut3k64b2o9umqogr7
      id: c9qut3k64b2o9umqogr7
      folder_id: b1g0itj57rbjk9thrinv
      created_at: "2019-07-16T09:43:50.393231Z"
      name: mongodb406
      environment: PRODUCTION
      monitoring:
      - name: Console
        description: Console charts
        link: https://console.cloud.yandex.ru/folders/b1g0itj57rbjk9thrinv/managed-mongodb/cluster/c9qut3k64b2o9umqogr7?section=monitoring
      config:
        version: "3.6"
        feature_compatibility_version: "3.6"
        ...
    
  3. Start the MongoDB update:

    $ yc managed-mongodb cluster update c9qutgkd4b2o9umqog97 --mongodb-version=4.0
    

    When the update starts, the cluster status switches to UPDATING. Wait for the operation to complete and then check the cluster version.

You can update the MongoDB version for a cluster using the update API method: pass the appropriate value in the configSpec.poolerConfig.poolingMode request parameter.