Skip to content

Mongo Auth The Hard Way

Christopher M. Neill edited this page Jun 29, 2016 · 4 revisions

Don't try this at home:

  1. if you can, back up the database you want, eg, mongodump; that will give you everything you are able to read...

  2. copy out and SSL certs you want to save from prior installation if it is on the same IP. otherwise run the mongo.yml to gen a new TLS key.

  3. install a fresh cp of mongodb by hand.

  4. copy the SSL config from another env and edit by hand. Epsilon does not use SSL.

  5. either create or copy the mongo auth key you will need this to create a root user.

  6. run mongodb without any data.

  7. run the mongo shell using the admin database: mongo admin

  8. create an admin user for the admin db:

db.createUser({user: "superuser", pwd: "foobarbaz", roles: [ "root" ] })

  1. Log in using the account you just created.

  2. Edit the appropriate db with the correct credentials from ansible.

  3. Restore the saved data.

  4. You may need to invalidate stale user tokens, db.users.drop()

Clone this wiki locally