The username itself is used as a key in many tables, so you can’t easily change it. So the tips often referred to using just a different display name and the mail address, and to keep the real username as a “hidden” user-id.
I am in search of workaround of renaming username. This is very needful in my case almost all local users have been migrated to LDAP, only few users whose local username does not match with other platform.
Fyi, local user migration to LDAP is also not possible officially, but making changes in oc_users made it work. Means this is workaround and worked perfectly
Similarly there must be workaround for renaming username. I tried renaming from oc_user table then it just created new user.
Yes i previously looked into this. Purpose of posting here to find workaround. May be some of the people among us wanted this. So with discussion we can make it possible.
My another test:
I have renamed uid and lower uid in oc_user, then rename data directory of user in data/ with similar to that new username
When i logged in with new renamed user id, all my data available. Issue is that my chat history is not there. Further looking into it.
Lets work together to make it possible, it will help others.
Now I have tested it over a active user in backup environment. Asked him to test all things. The files name that contains username now shows as with new Filename (with new username string) in Nextcloud (there are 1000s of files that are not required to rename) it is because i guess database pointer updated new username in filename (only those files name that contain Username) .
Let me clear, For example Tom is user we renamed Tom username with Toma. Those files that contains Tom in file name also showing as Toma in nextcloud and they do not able to load or Download. It gives internal server error. For example Tom_Certificate.pdf showing as Toma_certificate.pdf. Now there are 1000s of file in specific user directory if they all required to rename it will be nearly impossible.
Hey there. Running occ files:scan --all would fix this for you. You’ve changed the FILES app database entries but not the filenames themselves. files:scan will get everything back in working order.
Yeah. And if you didn’t change the oc_filecache table in the database you wouldn’t need the files:scan step. You can files:scan -all as well, if you’ve got a lot of users and don’t want to do each one by hand
Rescanning is not really good, that means that users have to resync their files!
But there are more problems if you just go through the whole sql file. If you have a user Tom and a user Tomato, you start to rename Tom to Toma, this way you also rename Tomato to Tomaato. And if you have other database entries with “Tom”, it will rename everything…
How does this play into the steps offered by @dolphinscorp ? What would the easiest series of steps be?
I’m having to consider this solution for about 7 users in my database. Trying to not over complicate the resolution. I should explain that for most all purposes I do not need to do this. My issue is that the structure of the username is causing these users to get kicked out of the Nextcloud Deck iOS app every time they open a card. I have traced it to be this as the only difference between them and the other users. These were users set up before I added LDAP. So they all have the underscore and random numbers behind their username.