I want to be sure duplicate users are not created after I change the usernames in my external database. My plan is to change the 'UID' field in my external database from GUID type to Text type, and change the values from a GUID to their numeric memberID (five digits). Then I was going to change the username's in the Moodle database to match the new usernames. Will that work so that when these users logon the next time, they maintain the same account in Moodle? I don't want it to create a new account and for them to loose all their history, since that would be a catastrophic problem...
I described somewhere in these forums, how I changed the usernames from firstname.lastname to eMail-Address when I changed the authorization module from LDAP to Shibboleth. It works. But I used a clone of my production server as test-server to go through all the needed sql-queries to update/modify the user records.