Changing EVERY user name in Gitlab

For security reasons we must change every username in our LDAP server (AD). As a consequence of this we must change the name of every user in GitLab. Since we have hundreds of groups and projects belonging to hundreds of users we have no clue where to start. We are afraid touching GitLab Internals such as DB tables. Maybe somebody has done something similar and could provide us with instructions.