New UUIDs (and new profiles) after LDAP change

I’m not givin’ up here… :smiley:

I do understand the idea of using UUIDs. If I change my login name from du to ds due to marriage or if I move an entity within the directory, the UUID does not change.

The drawbacks are:

  • this internal username is also used in logging, a the user’s directory and in commands like occ ldap:check-user --update 43A…
  • this internal username is also used for all the *DAV urls
  • if you migrate from one directory type to another, the UUID changes

While I can live with drawback 1 and 2, it is difficult with drawback 3:

MariaDB [nextcloud]> SELECT * FROM oc_ldap_user_mapping WHERE ldap_dn LIKE "%=du,%";
+--------------------------------------+--------------------------------------------------------+--------------------------------------+------------------------------------------------------------------+
| owncloud_name                        | ldap_dn                                                | directory_uuid                       | ldap_dn_hash                                                     |
+--------------------------------------+--------------------------------------------------------+--------------------------------------+------------------------------------------------------------------+
| 43AD3B... | cn=du,ou=company,ou=users,ou=corp,dc=corp,dc=internal | 43AD3B... | 0e4fbce9dac2834a9 |
| 7cc9e9... | uid=du,ou=company,ou=users,ou=corp,dc=corp,dc=internal        | 7cc9e9... | b627c52106fbeebb9f |
+--------------------------------------+--------------------------------------------------------+--------------------------------------+------------------------------------------------------------------+
2 rows in set (0.001 sec)

The first entry is from an Active Directory, the second is an entry from a sync’ed OpenLDAP server.

Did ever, ever someone changed the LDAP type? Is there an approach to “search and replace” entries in the database?

Just for the sake of documentation, the following resources are useful: