One of our customers recently encountered an issue when upgrading from SharePoint 2007 to SharePoint 2013. I thought I will share this for the benefit of others in the SharePoint community who are planning to migrate from SharePoint 2007.
Users in the customer’s organization encountered the error below when opening a custom webpart that used the Target Audiences from the User Profile.
‘No User Profile Service is available in the current context’
This issue is most likely to occur when upgrading SharePoint from SharePoint 2007 to SharePoint 2010 and above. The above error specifically occurs when opening web parts configured to use Target Audience from ‘User Profile Service’. The customer initially thought that this could have been caused due to using our SharePoint to SharePoint migration tool (XPlica) to migrate their content from SharePoint 2007 to SharePoint 2013. Once the cause was identified, we were able to inform the customer that this wasn’t due to our SharePoint migration tools and directed him to the solution outlined below.
In such case, ‘Target Audiences’ property is missing (as shown in the below screenshot) when editing the webpart in the web application.
The reported error occurs if the ‘User Profile Service Application’ option is unchecked for the target web application in SharePoint Central Administration Site (as shown below).
- Go to the target SharePoint Central Administration Site.
- Click ‘Manage Web Applications’ link available under ‘Application Management’ section.
- Select the target web application in which you are migrating the web parts and click ‘Service Connections’ button from the SharePoint ribbon.
- Select the User Profile Service Application check box and click OK.
Once you make the necessary changes as stated above, you can open the webparts in the web application without issue and also you can see the ‘Target Audiences’ property when editing the webpart as shown below.
Know more about XPlica and to download it, please visit – http://www.vyapin.com/products/sharepoint-migration/dockit/sharepoint-migration-tools