This article demonstrates the usage of the tool called “Mongo-mirror” which can be used to migrate data from the old versions of MongoDB such as 4.2.25 to a newer version of MongoDB on Atlas.
We will exhibit how to set a single node replica set in Amazon AWS cloud EC2 instance, install MongoDB 4.2.25, load dummy data using the simrunner onto the source cluster, set an Atlas cluster (the destination), and use the aforementioned tool setup on a sync server (for demo purpose we will re-purpose the source machine as sync server, but it is advised to use a separate machine with higher resources as the sync server) to transfer the data from the source to destination.
Install Mongo on the EC2 machine
Launch an EC2 instance in AWS with Linux 2 with a t2.medium machine and then ssh into the machine once provisioned as shown below: