We are currently in the process of changing (AD) domain and user names for users. This is done gradually, and the old and new domain/user names will coexist in a transition period.
A challenge we have is migrating sharepoint user profiles. Preferrably, data from the old mysite profile is moved or copied to the new profile/user when the user logs on the intranet with the new credentials the first time. Im thinking of doing this with a "hidden" web part on person.aspx.
However, I cannot find a C# equivalent to the Move-SPuser, and simply iterating blindly through all of the properties from the old profile and adding them to the new seems hairy. I suspect that there are some properties, like sid/guid etc. that should not be copied. Is this the way to do it? Is there a better way, or "best-practise" of migrating/copying user profiles to a new user?