[SERVER-12541] Mongorestore cannot restore 2.4-schema users to a clean 2.6 system Created: 29/Jan/14  Updated: 10/Dec/14  Resolved: 05/Mar/14

Status: Closed
Project: Core Server
Component/s: Security, Tools
Affects Version/s: 2.5.5
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Spencer Brody (Inactive) Assignee: Spencer Brody (Inactive)
Resolution: Won't Fix Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Related
related to SERVER-12854 Prevent mongorestore from restoring u... Closed
related to TOOLS-124 MongoRestore backwards compatibility ... Closed
is related to SERVER-12369 Update mongodump and mongorestore to ... Closed
Operating System: ALL
Participants:

 Description   

If you mongodump a 2.4 system with user data, then try to mongorestore that to a clean 2.6 system with no users, it will fail saying that you're trying to restore users with an outdated schema. This is because

{getParameter:1, authSchemaVersion:1}

reports upgraded 2.6 systems with users and clean 2.6 systems with no users as the same schema version. We should be able to detect when the system we're talking to has v3 authorization schema only because it has no users or roles yet, and allow the restore to proceed with v2.4 schema users.



 Comments   
Comment by Spencer Brody (Inactive) [ 05/Mar/14 ]

This worked in 2.6.0-rc0, but won't work in 2.6.0-rc1 or later, by design.

Comment by Spencer Brody (Inactive) [ 05/Mar/14 ]

This ticket contradicts SERVER-12854. SERVER-12854 is about maintaining the property that after upgrading to the 2.6 binary, user modification is only allowed in the new schema. In fixing SERVER-12854, the work that resolved this ticket in 2.6.0-rc0 was undone.

Comment by Githook User [ 07/Feb/14 ]

Author:

{u'username': u'stbrody', u'name': u'Spencer T Brody', u'email': u'spencer@10gen.com'}

Message: SERVER-12541 Give restore role the ability to query admin.system.version
Branch: master
https://github.com/mongodb/mongo/commit/ce5ec7ad32c56a4b92e0745643911b4a1974e61e

Comment by Githook User [ 06/Feb/14 ]

Author:

{u'username': u'stbrody', u'name': u'Spencer T Brody', u'email': u'spencer@mongodb.com'}

Message: SERVER-12541 Make sure 2.4 users can be restored to a clean 2.6 system
Branch: master
https://github.com/mongodb/mongo/commit/27fb434eaebc35646cdadf7acac562aa47c06ac8

Comment by Githook User [ 29/Jan/14 ]

Author:

{u'username': u'stbrody', u'name': u'Spencer T Brody', u'email': u'spencer@mongodb.com'}

Message: SERVER-12369 SERVER-11461 Update mongodump and mongorestore to properly handle users and roles in 2.6

There are some known caveats:
(1) It's not safe to run mongorestore while user-management commands are
executing on a live system (SERVER-12539).

(2) To restore 2.4 users to a 2.6 system that has never had any users added, you
must manually insert the version document indicating v1 users into
admin.system.version, which must be done by a highly privileged user, before
beginning the restore (SERVER-12541).
Branch: master
https://github.com/mongodb/mongo/commit/dac6264fb0f0040f7bd8784ed44c33e4a1318d5b

Generated at Thu Feb 08 03:28:49 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.