Now that all user data is centralized in the admin database, doing single-db dumps with mongodump no longer properly capture the user definitions for users defined on that database, and mongorestore doesn't know how to properly restore users for a per-db dump either. Plus neither mongodump nor mongorestore know anything about restoring user-defined-role definitions.
New proposal for interface for controlling how users/roles get dumped/restored:
// dumps everything in the server mongodump -u dan -p xxx // dumps just the database (ignore users) mongodump -u dan -p xxx -d mydb // dumps database AND users and roles associated with mydb to /dump/admin/system.* (what should this do against a < 2.6 db?) mongodump -u dan -p xxx -d mydb --dumpDbUsersAndRoles // restore everything in the dump dir mongorestore -u dan -p xxx // restore the db (ignore users) mongorestore -u dan -p xxx -d mydb // restore the db as well as users stored in /dump/admin/system.* which apply to mydb (using normal mongorestore semantics) mongorestore -u dan -p xxx -d mydb --restoreDbUsersAndRoles // restore the db as well as users stored in /dump/admin/system.* which apply to mydb (first clear out old users /oles) mongorestore -u dan -p xxx -d mydb --restoreDbUsersAndRoles --drop
- is related to
-
SERVER-11461 mongorestore with --drop doesn't drop admin.system.roles or admin.system.version.
- Closed
- related to
-
SERVER-12539 Make sure mongorestoring user/role data doesn't interfere with ongoing user or role modifications
- Closed
-
SERVER-12541 Mongorestore cannot restore 2.4-schema users to a clean 2.6 system
- Closed
-
SERVER-12491 mongorestore fails to restore 2.4-style users to an already upgrade 2.6 system
- Closed