0
votes

I have following scenario:

  1. Dump Mongo database (cmd mongodump)
  2. Change password from one of admin users
  3. Restore Mongo database (cmd mongorestore)

EDIT:

I use following command for db dump:

mongodump -h $HOST:$PORT --ssl --sslAllowInvalidCertificates --authenticationDatabase $authdb -u $user -p $pass --gzip --archive=$destination

As a result password was not restored. Is there any defect plan that can be followed in mongodb for this specific case?

2

2 Answers

0
votes

Are you sure that your admin user is created in the database you dump?

The authentication database is not necessarily the used database in mongodb. If you want to dump/restore users, you have to dump/restore your authentication database(s).

0
votes

So I found solution, --drop shoud be added in the command:

mongodump -h $HOST:$PORT --ssl --sslAllowInvalidCertificates --authenticationDatabase $authdb -u $user -p $pass --drop --gzip --archive=$destination