Directly upgrade from mongodb 4.2 to 7.0 replica set

Hello,

We have a mongodb v4.2 replica set using 2 in memory storage engines and 1 wired tiger instance. We now want to upgrade to v7.0 but we do not really care if there is a down time and also the data can be reloaded using our loader process anytime. If this is the case, can we directly upgrade to v7.0 by stopping all the mongodb v4.2 instances and run the v7.0 instances and start loading data into the new version using our Go loader process? If not, why am I forced to upgrade one version at a time from 4.2 > 4.4 > 5.0 > 6.0 > 7.0 and isn’t this going to take a lot of time and effort?

Thanks
Ranjith

MongoDB enforces upgrade paths (4.2 → 4.4 → 5.0 → 6.0 → 7.0) to ensure data compatibility and structural integrity across versions.
Each major version upgrade may involve storage format changes, feature deprecations, and modifications to internal data structures, which are handled incrementally to avoid data corruption or performance issues, which is why it is recommended to do incremental upgrade.
Depending on how large your dataset is, it shouldn’t be too much time and effort to perform these upgrades - stay safe - do it incrementally.

2 Likes