Data Migration from MongoDB to MongoDB Atlas
- Open the server where mongodb is installed.
- Open Command prompt and navigate to C:\Users\Administrator
3. Take backup of On-premise MongoDB database.
Run the below command in the command prompt and press Enter.
< mongodump --db mondodb_name >
Example: < mongodump --db suremdmdb >
4. Import the MongoDB database or restore database in MongoDB Atlas.
To fetch the query, follow these steps:
- Navigate to Clusters tab, select a cluster and click Collections > Command Line Tools.
b. Click Copy to copy the query.
Note: i. Change the password in the query as specified in step no.8 of MongoDB Atlas Setup.
ii. Change MongoDB connection string in Database Worker as well.
c. Run the query in Command prompt.
5. Navigate to MongoDB Atlas console and verify the database.
6. Navigate to the server where application is deployed and change the MongoDB connection string in api and pluto web config files.
<add key="MongoDBConnectionString" value="XXXXXXXXXXXX" />
Note: Enter the connection string (copied from step no.13 of MongoDB Atlas Setup) in value parameter.