Issue: When we backup the mysite data and restore on new SharePoint 2010 farm, we sometime are unable to access my content page.

If we check in ULS we see

3wp.exe (0x0A3C)                           0x1330                                      246                               7hz8    Medium      My Site: PersonalSpaceRedirect: Unknown error: System.Threading.ThreadAbortException: Thread was being aborted.     at Microsoft.SharePoint.Portal.WebControls.PersonalSpaceRedirect.RedirectToGlobalPrivatePage()     at Microsoft.SharePoint.Portal.WebControls.PersonalSpaceRedirect.LoadControl(Object sender, EventArgs a).     
01/06/2010 18:59:36.52     w3wp.exe (0x0A3C)                           0x1330                                      246                               79gk    Medium      My Site: PersonalSpacePublicRedirect: User was redirected to here from 'http://[server]/personal/[user]/default.aspx', but should have gone to 'http://[server]/sites/mysite/_layouts/MySite.aspx'.    

So the issue happens because the User ID for the profile does not match and causes the redirect to fail to personal site collection.

Resolution and explanation :

In a normal SharePoint environment, the user is the owner his own my site. If the user is owner of the my site and the access to the profile store is also correctly granted the relink of the old my site with the new user profile should work automatically. When the user opens the first the his old my site, SharePoint will automatically find the profile of that specific user in the profile store and gather the new Profile ID (named User ID). This ID will be written in the property bag of the my site web(urn:schemas-microsoft-com:sharepoint:portal:profile:userprofile_guid). In the profile store, we also update the Personal Site property for that user and so the re-link is done. In our case the user was not able to do these type of modifications due to permission issues, therefore the My Site Web Property was not repaired, so that the mysite was pointing still to the old profile id. In the profile store we were also not able to add this relative url to the "Personal Site" property. So we can re-link the my sites with the profiles using powershell, by adding the new profile id in the property bag of the my site:

$web = get-spweb http://mysiteurl/personal/userid

$web.SetProperty("urn:schemas-microsoft-com:sharepoint:portal:profile:userprofile_guid", "USER Profile ID") $web.Update()

The new user profile id can be looked up in the Profile DB directly, however this is only recommended with the help of MS support:

select * from [Profile DB].[dbo].[UserProfile_Full] (nolock) where NTName = 'domain\user'


and second action is to

go ahead and delete the user profile from user profile store and then click on my content, this should create a new profile with the correct ID.

Central admin-> application management-> mange service application-> user profile application –> mange user profile-> search for the user and delete it.