I have mongo DB installed in the following path c:\mongodb\bin
. I have configured my environment variable PATH in advanced settings.I also have mongod running .When I run the following command mongorestore dump from the following path c:\hw1-1\dump
(This contains the BSON files) I'm getting this error:
Don't know what to do with the dump file
I have referred to this thread to check my path.
You should just be able to do mongorestore --gzip <path to gzip folder). Side note you can use mongodump with --gzip option and it will compress it for you.
Mongorestore only uses insert commands and does not execute any modifications when restoring data into an existing database. As a result, the restoration process will not overwrite existing documents that have a matching value for the _id field of the documents in the backup.
To restore a single database or a collection (or specific documents) from a snapshot, you can use the Queryable Backup to export a single database or collection to restore to the target deployment.
Basic mongorestore syntax The basic way to restore a database is to use the mongorestore command to specify the backup directory (dump directory) without any options. This option is suitable for databases located in the localhost (127.0. 0.1) using the port 27017.
in mongodb 3.0 or above, we should specify the database name to restore
mongorestore -d [your_db_name] [your_dump_dir]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With