How to switch to a different LDAP server

Dear all,

I am in the situation that I have to switch our Nextcloud instance to a different LDAP server and I would, of course, like all users to keep their files etc.

If this wasn’t complicated enough (I’ve read about the UUID/internal username issue) some login names (uid field in LDAP) have changed.

Hence my questions:

  1. If any, what is the recommended way to switch to a different LDAP server while ensuring that users keep their files etc?

  2. If 1) is possible, how can I change the login name of users in that process?

Thanks a lot!


  1. Add the new LDAP server in the administration backend
  2. Gain direct access to the database on the terminal (e.g. using mysql)
  3. Update the ldap_dn column in oc_ldap_group_mapping with the DN string of the new server for all users (e.g. “uid=username,cn=users,dc=example,dc=com”): UPDATE oc_ldap_group_mapping SET ldap_dn="$newstring" WHERE ldap_dn="$oldstring";
  4. Disable the old LDAP server
  5. Login with the credentials of the new LDAP server and enjoy all your files as if nothing had happened