Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

mongorestore error: Don't know what to do with the dump file [closed]

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.

like image 689
Prasanna Aarthi Avatar asked Oct 10 '22 06:10

Prasanna Aarthi


People also ask

How do I restore a .GZ file in MongoDB?

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.

Does Mongorestore overwrite data?

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.

How do I restore a collection in MongoDB?

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.

How do you use Mongorestore?

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.


1 Answers

in mongodb 3.0 or above, we should specify the database name to restore

mongorestore -d [your_db_name] [your_dump_dir]
like image 340
clevertension Avatar answered Oct 11 '22 19:10

clevertension