Changing Username from UID to sAMAccountName (Current Users)

Hey Everyone, I have had LDAP configured for nearly a year using the username as their UID. Now I am looking to migrate these 100 users which have their UID as their username in Nextcloud to AccountName in Nextcloud.

I have already made the change under the “Expert” setting in Nextcloud to do this and it’s working great for new users. Is there anyway to migrate all my current users without losing data, or shared links?

I have accomplished this with several test users but the share links never work afterwards for obvious reasons. Here is how I get there:

cd /var/ncdata
cp -R 123456ABC-C545-35D8-9D34-2FE7CCB59167 DAlex
chown -R www-data:www-data DAlex

Remove the User from the Nextcloud AD group. The user should now appear as an LDAP Remnant:

sudo -u www-data /var/www/nextcloud/occ user:delete 123456ABC-C545-35D8-9D34-2FE7CCB59167

Re-add them to the Nextcloud AD group and have the user login and their username will now be their account name (DAlex) they will see all of their old data. In this case they would have to re-share all of their previous items, because they’re technically a new user

Am I at a brick wall, is this possible to do without losing share links? A formal way would be best but I am up for any solution that has the least amount of end user work.

Nextcloud version: 12.0.4.3
Operating system and version: Ubuntu 16.04.3 LTS
Apache: Apache/2.4.18 (Ubuntu) (apache2handler)
PHP version: 7.0.22