DEV Community

Cover image for MongoDB: How to export all collections? [Local/Remote]
YURII DE.
YURII DE.

Posted on • Edited on

1

MongoDB: How to export all collections? [Local/Remote]

Local

Dump

mongodump -d <database_name> -o <directory_backup>
Enter fullscreen mode Exit fullscreen mode

Restore

mongorestore -d <database_name> <directory_backup>
Enter fullscreen mode Exit fullscreen mode

Remote

Dump

mongodump --uri <uri_string> -o <directory_backup>
Enter fullscreen mode Exit fullscreen mode

Restore

mongorestore --uri <uri_string> <directory_backup>
Enter fullscreen mode Exit fullscreen mode

Note that I would recommend against using mongodump/mongorestore for big data storages. It is very slow and once you get past 10/20GB of data it can take hours to restore.

Top comments (0)

Image of Docusign

🛠️ Bring your solution into Docusign. Reach over 1.6M customers.

Docusign is now extensible. Overcome challenges with disconnected products and inaccessible data by bringing your solutions into Docusign and publishing to 1.6M customers in the App Center.

Learn more