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: