DEV Community

Radhakishan Jangid
Radhakishan Jangid

Posted on

Mongodump and Mongorestore

Use following command to generate archive of mongodb dump database.

mongodump --db <database_name> --gzip --archive=./dump
Enter fullscreen mode Exit fullscreen mode

Use following command to generate json of mongodb dump database.

mongodump -d <database_name -o ./dump 
Enter fullscreen mode Exit fullscreen mode

Use following command to import archive of mongodb dump into database.

mongorestore --gzip --archive=./dump
Enter fullscreen mode Exit fullscreen mode

Hope it helps you.
😊

Top comments (0)