Upgrading MongoDB Replica Set from 4.0 to 7.0 – Potential Issues and Considerations

I am managing a three-node MongoDB replica set currently running version 4.0. I am planning to upgrade it to the latest stable version, 7.0, following the recommended step-by-step upgrade path:

4.0 → 4.2 → 4.4 → 5.0 → 6.0 → 7.0

Here are some details about my setup:

  • Storage Engine: WiredTiger
  • Operating System: Ubuntu 18.04.2
  • Upgrade Method: Replacing MongoDB binary files (mongod, mongos, etc.) for each version.

Before I begin, I want to understand what potential issues or risks might arise during the upgrade process, including but not limited to:

  • Data corruption or loss
  • Compatibility problems with existing data or configurations
  • Downtime or service interruptions
  • Unexpected behavior during binary replacements

Additionally, I’d appreciate any best practices or precautions I should take to ensure a smooth upgrade.

Read the release notes and replicaset upgrade for each version.

image

MongoDB 5.0+ requires avx feature set on x86_64 architecture.

Ubuntu 18.04 will only support up to MongoDB version 6.0. Ubuntu 22.04 will then support 6.0.4 through to MongoDB 8.0.

If using the MongoDB repos for apt, expired gpg certificates are likely to be encountered and implicitly trusting them will be needed.

If following correct procedures “downtime” is limited to the time it takes to step down and elect a new primary.

One primary concern is that all client applications are using up to date drivers!

1 Like