March 31, 2023, 6:43am
I have a database with mongo version 6.0.4 and I need to populate it with information that will be obtained from other environments, however, not all of them have the same version, some of them have versions 4.4 and 5 implemented, due to this I intend to upgrade the environments to 6.0.4, therefore, is it necessary to have the same version of mongo in the source and destination to import the information? Or is it possible to do it without carrying out the upgrade?
March 31, 2023, 4:00pm
From old to new? Super easy, new to old? Not advised because then you have data types and things that aren’t supported in the older versions.
Do this instead:
Build Docker containers of MongoDB 6.0s.
Migrate the indexes to said containers
Export all the collections as BSON data in the old DBs.
Import all the collections with the indexes into the new 6.0 containers
Verify functionalities and make sure everything is all how you want it to be and working.
Connect them all to your infrastructure and point appropriate services to each.
Delete the old MongoDBs because at this point you don’t care about them and they’ve been effectively replaced with fully functional, latest build MongoDBs.
Relax and enjoy life knowing you have no headaches for trying to upgrade anything, or trying to hassle with a bunch of unforeseen issues and no outages.
Easy guide with multiple ways to get the data over:
So this is a topic that is noticed to be a hot one, one that many people over think. How do you manage the database shutdown? How do you manage the daunting task of upgrading from say 4.0 to 6.0? or 4.2 to 5.0.15? The answers are actually more simplistic and easier than you realize.
This weekend (So far we’ve already moved over 1 TB of data doing this process alone successfully) I’ve been working with a megachurch and a few techie teens to conduct an upgrade/migration, at a scale the…