Recently I have been doing some testing of disaster recovery scenarios in my development and QA SharePoint 2010 environments. I noticed a couple minor issues that have been occurring after the restore process. One issue that I will discuss in this post is a problem encountered with the User Profile Service.
Issue: After restoring a farm from a backup using the Restore-SPFarm PowerShell command the User Profile Synchronization service fails to start and I received a generic SharePoint error page when trying to access the User Profile Application management page in central administration.
I reproduced this issue multiple times on multiple farms. Although I can reproduce the issue I was not able to come to any conclusion on what is the root cause of the problem. I did, however, identify a fairly quick way to resolve the issue.
Resolution: To resolve the issue I deleted the User Profile Application that was created during the restore process and then recreated it. To ensure that you do not lose any user profile content there are a few steps that must be followed:
- Using central administration, stop the user profile application service on all servers in the farm.
- Using central administration, delete the user profile application. DO NOT check the option to “Delete data associated with the Service Applications”.
- Identify the names of the user profile, social, and sync databases.
- Run the New-SPProfileServiceApplication PowerShell command passing in parameters for: ApplicationPool, Name, MySiteHostLocation, ProfileDBName, ProfileSyncDBName, and SocialDBName. This will create a new profile service application using your restored profile databases.
- Run the New-SPProfileServiceApplicationProxy PowerShell command passing in parameters for: ServiceApplication and Name. Also include the DefaultProxyGroup parameter.
- Start the User Profile Service on all servers in the farm
- Run an IISReset command on each server.
- Start the User Profile Synchronization Service on the application server. Wait for 5 – 10 minutes for the service to start. Ensure that it is started before proceeding.
- Ensure that the User Profile Synchronization Timer job is enabled and set properly and then start a full import.
Always remember to test out your disaster recovery plan in a development or QA environment prior to your production launch of SharePoint 2010.