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

mongorestore does not drop admin.tempusers if it exists in the dump

      If admin.tempusers is included in a mongodump that is being restored, the check to see if the admin.tempusers collection already exists before inserting users will say the collection doesn't exists. This means the pre-existing collection is not dropped. This will likely cause a duplicate key error when mongorestore attempts to insert users into this collection. Even worse is that if the users have been changed since the last mongorestore, the newer versions of the users will not be inserted into the temporary collection and the old users in admin.tempusers are the ones which will be merged into admin.system.users.

      This is due to restore.knownCollections not being updated with collections that are created during the restore process.

      This can cause some particularly serious issues when it interacts with the bug TOOLS-2422. Both should be fixed and backported.

            tim.fogarty@mongodb.com Tim Fogarty
            tim.fogarty@mongodb.com Tim Fogarty
            0 Vote for this issue
            9 Start watching this issue