The title sums it up nicely. Essentially what I am asking is, if its possible to backup (use mongodump perhaps?) only users (accounts created for human users)?
So after digging around further i found how to do that.
In short i needed to take the system.users collection or rather use a query to get only users from that collection that follow a certain pattern. for me it was user@some.domain, without the query i would have gotten all service users also which i did not want or need.
The tricky part was mongorestore which did not work if i wanted to restore only the system.users collection
The error i got was:
2020-01-28T12:44:49.902+0200 assuming users in the dump directory are from <= 2.4 (auth version 1)
2020-01-28T12:44:49.960+0200 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
2020-01-28T12:44:49.960+0200 0 document(s) restored successfully. 0 document(s) failed to restore.
I got the error because mongorestore is unable to determine the version of the dump mongo if you dont give it system.version collection also.
admin.system.users
– Wernfried Domscheit Jan 27 '20 at 20:16