Hi @jo.ca
Auth0 Professional Services has tools that can help in this scenario. Let me know if you would be interested in a PS engagement.
If you want to do this on your own, basically, you will use the user export job (from the management API) to export all the users, write a script to merge them and then break them up into 500K chunks, and then import the chunks, handling errors. You will also need to file a support ticket to get passwords exported and then merge the passwords (and decide which password to use when merging two accounts).
If there are a large number of users, this should be done in two steps, the second being a delta of the first, to minimize downtime.
You can also write a lazy migration script that does something similar.
John