MongoDB.live, free & fully virtual. June 9th - 10th. Register Now

Upgrade advice from 2.6.11 to 4.2.6 (current)

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?

It also seems that it is just a matter of

  1. Stop the database.
  2. Upgrade the binaries
  3. Start the database
  4. Repeat 1-3 until done

Anything else I should know or look out for?

Thanks,
Scott

Hi @Scott_Reynolds,

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.

Fully read each upgrade procedure with care.

2 Likes

Thanks Chris!

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.

Scott

Yes, still a few things to take care of along the way.

  • Authentication Methods MONGO-CR to SCRAM
  • Setting the feature compatibility version
  • Storage engine change MMAP to WiredTiger
  • TLS options replace SSL
  • Default bind address to 127.0.0.1
  • etc
1 Like

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

i would modify your steps to the following:-

  1. Stop the database.
  2. Upgrade the binaries
  3. Start the database
  4. Update the fcv to upgraded binary version
  5. Repeat 1-4 until done

Thanks
R

@Scott_Reynolds

One potential shortcut might be an export/import path. I don’t know if it will work or not, just mentioning it.

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).

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.