Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-12369

Update mongodump and mongorestore to properly handle backing up users and roles in 2.6

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: 2.5.4
    • Fix Version/s: 2.5.5
    • Component/s: Security, Tools, Usability
    • Labels:
      None
    • Backwards Compatibility:
      Fully Compatible
    • Operating System:
      ALL

      Description

      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

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: