I’ve inherited a project that is woefully behind migrating from Windows Server 2008 r2. I’m new to mongoDB, but from reading the release notes it appears as though the migration path is 2.6.11 → 3.0.15 → 3.2.22 → 3.4.24 → 3.6.18 → 4.0.18 → 4.2.6. Is this correct or is a shorter path possible?
That is the recommended upgrade path. One major consideration as you upgrade the server is the client versions. If the server is this stale it is likely the client drivers are also. This many major version changes introduces many depreciations which could break your apps.
It’s not. There are some important step in many of the upgrades and depending on whether you have a standalone, replica set or sharded cluster the procedure can vary.
I should have mentioned that I have a standalone db and that’s what drove me to the simplistic process after reading through the upgrade procedures. I will remember to update the client libraries.
Hello Scott,
you might want to update the fcv after each upgrade by running the below command db.adminCommand( { setFeatureCompatibilityVersion: "4.2" } )
//version depends on the version you are upgrading to
Also note to look to see if your language’s current driver can be used with MongoDB 4.2. @chris alluded to this earlier, but I would hate for your application to stop working because you upgraded MongoDB.
Since you’re running a standalone, I will assume that this is not a production instance? Replica sets are generally recommended for production. If this is production data, I would definitely make a back up of the MongoDB data directory before proceeding with the upgrade (you should do this anyways, but this warning definitely applies here as you most likely don’t want to lose your data).