-
Notifications
You must be signed in to change notification settings - Fork 561
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Transfer All User Properties and Device Groups to a Different User #6449
Comments
so sorry to hear about your loss! |
I'll do what we need to. I might be delayed on testing as i'm in a different timezone (São Paulo, Brazil), But I'll do my best to get back to you as fast as I can TIA, |
@rodrigolzd sure no worries! If you want u can email myself (check my github profile page) And we can arrange a time to do the test and see if it works! |
Hi guys, ### list all users: db.getCollection("meshcentral").find({"_id" : /.*user.*/i}).limit(1000).skip(0); OR db.meshcentral.find({"_id" : /.*user.*/i}).limit(1000).skip(0); ### update username, user email, user real name: db.meshcentral.update( { _id: "user//OLD_USERNAME" }, { $set: { _id: "user//NEW_USERNAME", name: "NEW_NAME", email: "NEW_EMAIL", realname: "NEW_REALNAME" } } ) |
@smartekIT that won't work because if u delete the user, any groups created by that user gets deleted as far as im aware So the way I did it was replace the creator of the group, then add the group into ur links but give u the full rights instead, |
also when run the query to list all users, if the same user found in _id field with value "wsuser//OLD_USERNAME" then we have to update that as well with the following query: db.meshcentral.update( { _id: "wsuser//OLD_USERNAME" }, { $set: { _id: "wsuser//NEW_USERNAME" } } ) @si458 I thought my code is replacing, it's never deleting! |
@smartekIT I don't no i will have to try it! Thank u for the help though! |
basically I'm updating/replacing the existing user details while keeping it's other properties like devices and groups or any other user settings.. etc. Yeah champion I'm learning it and loving it. mongodb is a new world for me but it's very interesting db to work with and learn. |
I use this windows application to work with mongodb and it's very clean GUI and nice and easy to work with: |
@smartekIT mongodb compass i use |
here is an interested one which is open source and running as a docker, I never used it but looking at the features it's promising: |
Is your feature request related to a problem? Please describe.
We recently lost a colleague who created and managed several device groups in the system. Now, all those groups are still tied to his account, which makes things a bit awkward since his name still shows up in the group details. We need to remove his user, but we don’t want to lose all the work he did.
Describe the solution you'd like
It would be really helpful if there was a way to transfer all the properties tied to his account, especially device groups, to another user in one go. This would let us clean up the system without manually reassigning everything one by one.
Describe alternatives you've considered
We’ve thought about manually moving each group and property, but that’s going to be pretty time-consuming given how many there are. Ideally, we'd like a bulk transfer option to make this smoother.
Additional context
The goal is to make sure the groups remain intact, just under a new user, so we can safely delete the old account without any disruption.
Thanks for looking into this!
Rodrigo
The text was updated successfully, but these errors were encountered: