I have lots of collections in my development server. I need to use the same data for testing scenarios. I am trying to import all the data of development environment to local by command is it possible?

I successfully imported to a file by using below command:

mongoimport -d dbName -c collectionName dataFile.js

But how can we do same to import DB from development environment to local Env command-line?


The mongoimport tool is only intended for importing simple data in text formats (JSON, CSV, TSV).

To backup and restore a full database (including index definitions & collection options) typical approaches are to use either:

The MongoDB manual has a section on Backup and Recovery describing supported approaches for different types of deployments (standalone, replica set, sharded cluster).

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.