Migrate from internal auth to LDAP

I’ve seen this old post regarding how to migrate from internal to LDAP:

However, I want to know if the guidance regarding this has changed. It appears the main issue is that Nextcloud doesn’t attempt to match users in the LDAP with the existing users in the internal db, instead it always creates a new user. Is there a way to override this behavior? I have done this on other applications before like Jenkins, Jellyfin, where I migrated from internal auth to LDAP, and maintained my account on both.

I’m using Nextcloud on Ubuntu, via Docker. I’m using the nextcloud:production container.