Mongo
Securing Mongo
First, start your mongo deamon without authentication.
$ mongo admin- `db.createUser({ user: 'admin-supreme', pwd: 'a-good-password', roles: [ 'root' ] })
use newdatabase- `db.createUser({ user: 'nd-supreme', pwd: 'a-good-password', roles: [ 'dbOwner' ] })
Uncomment the line
auth=true
and make sure
noauth=true
is commented out.
Dump
Dumping a database is easy:
$ mongodump -d dbName
With auth:
$ mongodump -d dbName -u dbUser -p
Restore a databse
$ mongorestore -d dbName dump/dbName