Site icon NgDeveloper

How to export mongodb database / all collections of the database ?

How-export- mongodb- database-collections- database-featured

MongoDB Database Export / Import (All collections export / import)

MongoDB Export Command to export all the collections of the database:

mongodump -d <database_name> -o <directory_backup>

Example:

mongodump -d ngdeveloper -0 D:\ngdeveloper\mongodb-exports\

MongoDB Import Command to import all the collections of the database:

mongorestore -d <database_name> <directory_backup>

Example:

mongorestore -d ngdeveloper D:\ngdeveloper\mongodb-exports\
Exit mobile version