Migrate accounts from GitLab authentication to email

I have the need to migrate one, possibly more, users from GitLab (Keycloak) back to simple user name/email authentication.
Looking at the documentation here mmctl command line tool — Mattermost documentation it seems like this path isn’t supported?

Means the only way available is directly modifying the user table?

There was some time pressure so I went ahead with SQL, sharing my approach for the potential benefit of others.
This command…
sudo docker exec -it --user postgres mattermost-db psql -d mattermost -c "update users set authdata='',authservice='',password='' where username like('MyUsersName');"
… followed by a password reset did the trick.

Obviously, if you don’t use docker you can skip all the docker exec… stuff.

1 Like