How to change the user's username?

Back in Nextcloud 12 or something, it wasn’t possible to log in using the users’ email address. To work around this issue, I created accounts with the email addresses as the username.

It worked well (and still works today), but now that email address is supported to log in your instance, I’d like to normalize my usernames.

I’ve heard it’s possible to do that, but it requires some command-lines. I’m OK with doing some command-line, but I’d like to know what needs to be done to change a username?

Server info

Nextcloud version: 17.0.2
Operating system and version: Ubuntu 18.04
Apache or nginx version: nginx 1.14.0
PHP version: 7.2

1 Like

is it, really?

it is indeed, just tested it right now :wink:

i mean no doubt that it works. but as far as i understood from it it was just a nice side-effect… and no real feature.

I can’t find it, but I actually saw this feature in a release changelog. It seemed like an intentional new feature.

@JimmyKater Unintentional but displayed as a placeholder on login? I don’t think so. :wink:

Screenshot from v16:
nextcloud_login

Changing the login IDs is probably not a simple task as many links contain the login ID. I can only think of a solution to search all tables in the database and replace every occurrence of each login ID with the new one. CalDAV and CardDAV syncs will probably need to set new DAV URLs after this.

/!\ This is an untested hack and might very well render your whole instance unusable /!\

But you could install another test setup, copy your db and data and give it a try (although even this does not guarantee you won’t run into unexpected problems later).

1 Like