MongoDb: How to import dump data from .gz file?

Dump command:

mongodump --host localhost:27017 --gzip --db Alex --out ./testSO

Restore Command:

mongorestore --host localhost:27017 --gzip --db Alex ./testSO/Alex

Works perfectly!


While using archive:

Dump command:

mongodump --host localhost:27017 --archive=dump.gz --gzip --db Alex

Restore Command:

mongorestore --host localhost:27017 --gzip --archive=dump.gz --db Alex

Note:- While using archive you need to stick with the database name.

Different database name or collection name is not supported. For more info.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)