As for how easy it can be to set up a MongoDB Atlas account and database, it will just become harder when you try to move the data around.
Lately, at our company, we have decided to migrate our current development MongoDB Instance into another Instance and In this article, I will discuss how I approached and solved this task.
So the challenging part of this Migration was our database design, because of its complexity, the Application is a built upon Microservices and Microservice Architecture that includes around +30 Microservices with +10 Databases that handle Different Groups of Microservices separately, and then each of them contains around hundreds of collections that even each of them contains thousands of data.
According to the Official Documentation of MongoDb, you could export each collection separately which is not helpful for our case because we are dealing with a lot of collections.
Another Solution might be using the MongoDump command to dump the whole Database together, but again not that helpful as it's done manually for exporting and importing each of the Databases.
After enough research regarding the best way to handle this situation, I have come to a tool that could do this in a matter of seconds which I will be discussing below.
First of All, Prepare your Host and Target MongoDB URI or at least a connection for each of them
Then, We are using a tool called NoSQL Booster.
NoSQLBooster is a cross-platform GUI tool for MongoDB v2.6-5.0, which provides a build-in MongoDB script debuggerMongoDB script debugger, and comprehensive server monitoring tools, chaining fluent query, SQL query, query code generator, task scheduling, and much more.
- After you have installed the tool, you will be popped up with adding connections from the first step.
in this step , I am Connecting via my Atlas URI, so you can simply connect other atlases or any MongoDB from any server.
- you will see your connections loaded in the side like mine in the picture
- Only part left is pretty simple, you copy a database and simply paste it into the other connection. it is simple as that, It will load the DB with all of its data and indexes into the other one.
A) Copy A Database from the Host Connection
B) Paste A Database to the Target Connection
in my case, I did the copying operation around +10 times and our new database is good to go :).
Thanks for reading this Article, Just wanted to share this experience I had today in this article.
can you do all the DBs together with one click? I am not sure, maybe there is a better solution but this is quickest i have found and used. :)