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

admin.system.version is not restored by mongorestore

    • Type: Icon: Question Question
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 4.0.4
    • Component/s: Admin
    • None

      Hello,

      Following the procedure of restoring a sharded cluster from backup (https://docs.mongodb.com/manual/tutorial/restore-sharded-cluster/#optional-for-any-csrs-hostname-or-replica-set-name-changes-update-shard-metadata-in-each-shard-s-identity-document)

      I stumbled upon an issue.

      There is this step:

      use admin
      db.system.version.deleteOne( { _id: "minOpTimeRecovery" } )

      and

      db.system.version.updateOne(
      { "_id" : "shardIdentity" },

      { $set : \{ "configsvrConnectionString" : "myNewCSRSName/config1.example.net:27019,config2.example.net:27019,config3.example.net:27019"}

      }
      )

      however having restored my backup (dump created by mongodump), system.version collection contains only the following documents

      { "_id" : "featureCompatibilityVersion", "version" : "4.0" } { "_id" : "authSchema", "currentVersion" : 5 }

      .

      Seems that mongorestore ignores system.version collection.

      I see in my backup log that system.version is written to the dup directory, and I can see the files in the backup dir.
      rw-rr- 1 root root 134 May 17 14:12 system.version.metadata.json
      rw-rr- 1 root root 716 May 17 14:12 system.version.bson

      But when I run mongorestore it restores everythin but the system.version collection (I am restoring all databases, without any filters)
      I restore to a mongod instance that doesn't have accsess control enabled at all.

      I end up inserting the document into system.version

      db.system.version.insertOne(

      { "_id" : "shardIdentity", "clusterId" : ObjectId("***"), "shardName" : "****", "configsvrConnectionString" : "***/****:****,****:*****,****:****" }

      )

      In the end when i am done with restoring all shards, the sharded cluster works without any issues.

      Is there a way to force mongorestore restore the admin.system.version collection? or Am I missing something here?

      Thanks for your assistance in advance.
      Best regards

            Assignee:
            eric.sedor@mongodb.com Eric Sedor
            Reporter:
            genacvali91 Gennadiy
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: