This is driving me nuts.
I just want to move my mongodb to a new computer.
However when I try to do mongodump --db margin_calls
i get the error:
Failed: error dumping metadata: error creating directory for metadata file dump\margin_calls: mkdir dump: Access is denied.
So then I tried it with access controls. I made a user on the admin db with userAdminAnyDatabase
privileges, I then restarted mongod in --auth
mode and started a mongo instance:
mongo -u "myUserAdmin" -p "abc123" --authenticationDatabase "admin"
in the docs it says:
So I then proceed to make user in the database I want to backup with the role: 'backup'
db.createUser({user: "loba", pwd: "abc123", roles: ["backup"]})
And it just throws this error:
Error: couldn't add user: No role named backup@margin_calls :
_getErrorWithCode@src/mongo/shell/utils.js:25:13
DB.prototype.createUser@src/mongo/shell/db.js:1267:15
@(shell):1:1
I've been trying this for days now and I'm beginning to get really stressed out, why can't I simply back up my database ?
I'm using mongo 3.2 on windows 10