Uploaded image for project: 'MongoDB Database Tools'
  1. MongoDB Database Tools
  2. TOOLS-2393

Error when dumping and restoring system.* collections from the admin db with the archive mode

    • Type: Icon: Bug Bug
    • Resolution: Gone away
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 3.4.12
    • Component/s: mongodump, mongorestore
    • None
    • Environment:
      Ubuntu 16.04

      if you dump a collection of the admin.system.* namespace, you got an error when trying to restore it. ex: with the system.roles collection

      Mongodump

       

      mongodump --authenticationDatabase admin -d admin -c system.roles --archive=roles.archive --gzip -u admin
      

      Mongorestore

      mongorestore --drop --authenticationDatabase admin --archive=roles.archive --gzip -u admin
      

      You get the following error:

      2019-10-08T16:39:19.372+0200	preparing collections to restore from
      2019-10-08T16:39:19.383+0200	assuming users in the dump directory are from <= 2.4 (auth version 1)
      2019-10-08T16:39:19.384+0200	Failed: the users and roles collections in the dump have an incompatible auth version with target server: cannot restore users of auth version 1 to a server of auth version 5

      I'm dumping and restoring from the same mongoDB server!

      If i do not specify a given collection but the full admin db for the dump, it works!

       

            Assignee:
            david.golden@mongodb.com David Golden
            Reporter:
            gregory.maes@sigfox.com Gregory Maes
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: