0 votes
in MongoDB by
Mongorestore of a db causing me trouble

1 Answer

0 votes
by
I’m new to MongoDB and I have hard time to backup my local DB and restore it on my server. I found the link on Mongo’s website:

https://www.mongodb.org/display/DOCS/Import+Export+Tools but I still have problems with the restore.

When I do my backup I call

mongodump –db Gen

Then I see that all the collections are dump in /bin/dump/Gen folder

I copy-paste from local to the server in the same folder the call

mongorestore –db Gen –drop –dbpath dump/Gen

But I get the following : Error : root directory must be a dump of a single database when specifying a db name with –db

What am I doing wrong in MongoDB?

Thanks for the help!

Ok I find out what I’m doing wrong :

I was doing

mongorestore –db Gen –drop –dbpath dump/Gen

But without the –dbpath it works just fine!

mongorestore –db Gen –drop dump/Gen
...