Working my way through the somewhat impenetrable documentation for mongodump
and mongorestore
(the docs could use one single Examples section with a comprehensive set of examples).
I did not manage to figure out how to dump 1 database from my server, so I dumped everything. Every form of the command I tried other than simply mongodump --uri='mongodb://admin:xxxxxxxx@example.com:27017'
failed with:
Failed: can't create session: could not connect to server: connection() error occured during connection handshake: auth error: sasl conversation error: unable to authenticate using mechanism "SCRAM-SHA-1": (AuthenticationFailed) Authentication failed.
Okay, so now I have a dump
dir. Every form of mongorestore
I try specifying a database and the target name to restore to fails with the same uninformative authentication error.
Can someone provide a mongorestore
command line that will restore 1 database from the dump
dir to a new name, e.g., restore mydb
to mydb_bak
?