Another alternative:
Just export the data to JSON, indexes as JSON, etc. and so on, and then just upload the JSON documents to the new MongoDB Cluster.
If it’s large amounts of data, just export to JSON files in batches of appropriate sizes, and then import the JSON files into the new DB. I literally migrated a 600GB 8 Node Cluster running 4.2 on premise to an 10 Node cluster running 6.0 for a friends engineering firm doing this.
0 Down time, zero shut downs, zero data lost, it was practically brainless. After confirmation all the aggregations and indexes/queries etc. were all there, we connected the servers to the new cluster, and nukes the Kubernetes containers running the 4.2. 100% successful migration in 20GB batches, and it only took 3 hours.
You don’t have to get extreme and complicated for processes that can just be easy if you want them to.
EDIT:
The 3 hours wasn’t because it takes 3 hours to export 600GB of data and configs, that only took 40 minutes. It took 3 hours because of having to troubleshoot Kubernetes and Docker issues, and the replication needing to happen on a backup location in Europe, had to wait for the data to upload to that cluster as well over a slow VPN. Otherwise the entire process wouldn’t have even taken 1.5 hours if that.
EDIT:
And with this exact method, I’m literally volunteering my time to oversee 6.3TB of a migration this weekend. And we’re going to export the JSON files to an external SSD, and just upload the JSON from the exact same SSDs to the new clusters. Upgrade/Migration. Going from several 4.0 and 4.2’s to several different (Breaking it up into smaller 3 node sharded clusters instead of giant monolithic clusters) 6.0 clusters. Zero downtime planned, zero production disruption, and then we’re nuking the entire old server rack and pending whether or not I can take the rack and old Dell Poweredgess for my lab.
Don’t over think things, don’t push for complications, if there’s an easy, very safe method that meets your needs, and you’re willing to do it, then well, just do it. But this is just another alternative way @Stuart_S