Skip to content

Instantly share code, notes, and snippets.

@feanil
Created March 13, 2024 14:16
Show Gist options
  • Save feanil/0c85779cec955916924571fb416d2048 to your computer and use it in GitHub Desktop.
Save feanil/0c85779cec955916924571fb416d2048 to your computer and use it in GitHub Desktop.
Mongo 4.4 to Mongo 7 Upgrade Runbook

Links:

General Flow: You have to update the cluster to each intermediate version. You first upgrade all the secondaries to a version, then step down the primary. Once the primary is a secondary you can upgrade it. Once everything is on the new version, you update the featureCompatibilityVersion setting so that you can proceed with the next version upgrade.

Links:

General Flow: You have to upgrade to each intermediate version and update the compatability setting as you go.

  1. Upgrade to Mongo 5
  2. Start up mongo 5 against your 4.4 data
  3. As an admin user run db.adminCommand( { setFeatureCompatibilityVersion: "5.0" } )
  4. Upgrade to Mongo 6
  5. Start up mongo 6 against your now mongo 5 data
  6. As an admin user run db.adminCommand( { setFeatureCompatibilityVersion: "5.0" } ) * Note: Starting with mongo 6, the mongo cli isn't there, it's mongosh now. You should update any scripts that use the old CLI to use the new one instead.
  7. Upgrade to Mongo 7
  8. Start up mongo 7 against your now mongo 6 data
  9. As an admin user run db.adminCommand( { setFeatureCompatibilityVersion: "7.0", confirm: true } )

Warning: These are the steps I followed to upgrade my dev environment so if you're gonna use them for production-like environments, be sure to do lots of testing between versions and look at the official instructions. This is just meant to give others a quick overview of the process if they are in a hurry and risk tolerant.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment