Cloud backup needs to be able to implement its version of initial sync that clones all databases preserving UUIDs, including admin.system.version. However, starting up mongod without data files will itself create the admin.system.version collection with a newly generated UUID. Backup uses the technique below to replace the collection with one preserving the UUID of the backup source.
We need a test to ensure the following will keep working:
- Use listCollections to note the UUID of the existing admin.system.version
- Issue applyOps command:
db.runCommand({ "applyOps" : [ { "op" : "c", "ns" : "admin.$cmd", "ui" : UUID("deadbeef-8afe-4493-ac73-f2d521877a3b"), // <-- Your new UUID "o" : { "create" : "system.version" } }, { "op" : "i", "ns" : "admin.system.version", "o" : { "_id" : "featureCompatibilityVersion", "version" : "3.6" } }, { "op" : "c", "ns" : "admin.$cmd", "ui" : UUID("16f1fd0d-aa46-487e-b4c5-571ff5f1e385"), // <-- The UUID of the existing admin.system.version "o" : { "drop" : "admin.tmp_system_version" // <-- Just a placeholder name, doesn't have to be actual collection } } ] })