While investigating other issue, I pressed the “Clear Username-LDAP User Mapping” (in Admin->LDAP/AD integration->Expert )two days ago, like I’ve done sometimes in the past.
But this time the “LDAP user and group backend” was disabled in the process. When I reenabled it, ~10% of my users where moved from the usual id -their email- to a new one -email_NNNN-. This has created some problems, mainly their files were gone. But after modifying in our BBDD the entries in the owncloud_name in oc_ldap_user_mapping at least the user files reappeared in their folders.
Now our main remaining problem is that shared folders and files that where shared with any of this users are not accessible by them. Newly shared ones work ok. I’ve checked the oc_share table and everything is ok there. It looks like nextcloud can see the share, but it’s not able to make a connection with the id of the user sharing the file and the actual nextcloud user.