Linux · January 30, 2019 1

Import/Restore MongoDB Backup from gz file

MongoDB tools provide some awesome utilities like mongoimport, mongoexport and mongorestore.

Database dump can be easily imported/restored using mongorestore as follow.

mongorestore --gzip --archive=mongo_dump_6457.gz

You may restore dump to a specific database as well.

mongorestore --gzip --archive=test.20150715.gz --db test