Wednesday, July 11, 2012

Backup and Restore User Profile Service application using PowerShell

Recently User Profile Service application stopped working. User Profile Service was stuck on Starting state. I thought of deleting UPS application but then I realized if I delete User Profile Service application, we are going to lose social tags, notes, status updates etc., as those are part of the "Social tagging database" which is part of User Profile application. I used PowerShell to backup and restore of UPS application. This can be done using Central administration as well.

Run these commands in SharePoint 2010 Management Shell.

To back up the User Profile Service application
Backup-SPFarm -Directory <BackupFolderAtLocalComputer> -BackupMethod Full -Item “Shared Services\Shared Services Applications\<NameOfUserProfileServiceApplication>” [-Verbose]

You must also back up the service application proxy.
Backup-SPFarm -Directory < BackupFolderAtLocalComputer > -BackupMethod Full -Item 
“Shared Services\Shared Services Proxies\<NameOfUserProfileServiceApplicationProxy>” 
[-Verbose]

To restore the User Profile Service application
Restore-SPFarm -Directory <PathOfBackupFolder> -Item 
Shared Services\Shared Services Applications\<NameOfUserProfileServiceApplication> 
-RecoveryMethod Overwrite [-BackupId <GUID>] [-Verbose]

<GUID> is the identifier of the backup to use in the restore process.

No comments:

Post a Comment