Assuming that you're referring to an AD forest migration, then use the following approach:
- prior to the migration, set the value of the ms-DS-ConsistencyGuid attribute of every security principal you intend to migrate to the value of the objectGuid attribute
- migrate
- re-establish Entra Connect but set the source anchor attribute to ms-DS-ConsistencyGuid
If the above response helps answer your question, remember to "Accept Answer" so that others in the community facing similar issues can easily find the solution. Your contribution is highly appreciated.
hth
Marcin