MongoDB, Using mongorestore on an .agz file

2

I am using MongoDB 3.6 and am having trouble understanding how to use mongorestore on an .agz file. If I specify the below, then I get an error saying Failed: error connecting to db server: no reachable servers

mongorestore --gzip --archive=<filename>.agz --db test

And when I use the below command, specifying the actual mongod instance, I don't get any errors and actually see the status preparing collections to restore from, but I don't see anything in the actual mongod instance

mongorestore --gzip --archive=<filename>.agz --db test -u <username> -p <password> --authenticationDatabase 'admin' --port 27000 --host <hostname>

What am I supposed to be doing instead?

siddhu

Posted 2019-05-01T21:05:47.790

Reputation: 35

Answers

0

I figured out my issue.....The second command that I listed above (with the username and password) works, I just had the wrong db name.

I thought it could be any db name you want and it would create it in the new instance you are restoring to, but I realized that the db has to be match the name from the instance you use the mongodump command on

siddhu

Posted 2019-05-01T21:05:47.790

Reputation: 35