Change Owncloud LDAP Login to another Domain with different User ID's

Does anyboy know in which database tables the User ID’s are saved.
We are switching to a new domain and the new domain cannot have the same user id’s as the old one.
So when changing LDAP to the new domain, our users would have empty owncloud folders.

Is there a way to avoid manually moving the users owncloud files from the old sid’s folder to the new ones on the console and then running e.g. " occ files:scan", by changing the user sid’s/object id’s in the mysql database.

So the user authenticates per ldap on the new domain and we have already prepared the database with the correct new sid’s instead of the old ones and we have renamed the filesystem folders to the new sid’s, so that the user has still all his owncloud files after the login

Is this possible?

Thanks for your answers in advance