2021-12-07T08:43:17.013+0000 checking for collection data in system.users.bson
2021-12-07T08:43:17.013+0000 assuming users in the dump directory are from <= 2.4 (auth version 1)
2021-12-07T08:43:17.013+0000 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 am sure that there is no syntatically error in the command…
a. for different version of mongodb can we do this activity?
b. If yes , what are the fixes
I did some testing and it wasn’t working for me either.
I put both db’s at the same version because I thought it was a versioning problem and instead nothing…
I finally managed to find this discussion:
The part that deserves more attention, in my opinion is the following:
You need all of admin to restore that collection successfully.
but surprisngly in the restore output log…it says 0 document(s) restored successfully.
please have a look and tell if we can ignore these messages:
although users and roles restores succesfuuly , in log why it is reflecting as 0 document successfully
2021-12-30T08:17:17.854+0000 using write concern: &{majority false 0}
2021-12-30T08:17:17.871+0000 will listen for SIGTERM, SIGINT, and SIGKILL
2021-12-30T08:17:17.871+0000 connected to node type: standalone
2021-12-30T08:17:17.871+0000 The --db and --collection flags are deprecated for this use-case; please use --nsInclude instead, i.e. with --nsInclude=${DATABASE}.${COLLECTION}
2021-12-30T08:17:17.871+0000 mongorestore target is a directory, not a file
2021-12-30T08:17:17.871+0000 building a list of collections to restore from admin dir
2021-12-30T08:17:17.871+0000 found collection admin.system.users bson to restore to admin.system.users
2021-12-30T08:17:17.871+0000 found collection metadata from admin.system.users to restore to admin.system.users
2021-12-30T08:17:17.871+0000 adding intent for admin.system.users
2021-12-30T08:17:17.871+0000 found collection admin.system.version bson to restore to admin.system.version
2021-12-30T08:17:17.871+0000 found collection metadata from admin.system.version to restore to admin.system.version
2021-12-30T08:17:17.871+0000 adding intent for admin.system.version
2021-12-30T08:17:17.871+0000 comparing auth version of the dump directory and target server
2021-12-30T08:17:17.874+0000 system.version document is not an authSchema featureCompatibilityVersion
2021-12-30T08:17:17.875+0000 restoring users and roles of auth version 5 to a server of auth version 5
2021-12-30T08:17:17.875+0000 restoring up to 4 collections in parallel
2021-12-30T08:17:17.875+0000 restoring users from admin/system.users.bson
2021-12-30T08:17:17.877+0000 restoring users to temporary collection
2021-12-30T08:17:17.877+0000 using 1 insertion workers
2021-12-30T08:17:17.911+0000 merging users/roles from temp collections
2021-12-30T08:17:17.922+0000 building indexes up to 4 collections in parallel
2021-12-30T08:17:17.922+0000 0 document(s) restored successfully. 0 document(s) failed to restore.
Hi @Chinmaya_Das,
When I tried to do this too, I also saw that 0 documents had been restored, the users also for me had been correctly restored.
But unfortunately I can’t explain why.