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:

  1. Using central administration, stop the user profile application service on all servers in the farm.
  2. Using central administration, delete the user profile application.   DO NOT check the option to “Delete data associated with the Service Applications”.
  3. Identify the names of the user profile, social, and sync databases.
  4. 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.
  5. Run the New-SPProfileServiceApplicationProxy PowerShell command passing in parameters for: ServiceApplication and Name.   Also include the DefaultProxyGroup parameter.
  6. Start the User Profile Service on all servers in the farm
  7. Run an IISReset command on each server.
  8. 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.
  9. 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.