Migrating Service Applications from SharePoint 2010 to 2013

Migrating and upgrading our service applications and web applications to SharePoint 2013 is to restore the databases from the SharePoint 2010 environment to our SharePoint 2013 environment. This can be accomplished with the SQL Server Management Studio using the UI tools or a SQL query.

  • To restore a database with the UI tools:
  • Right-click Databases in the SQL Server Management Studio
  • Select Restore Database
  • For the Device, select the backup file to restore
  • Select OK
  • To restore a database with a SQL query:
  • Create a new SQL query in the SQL Server Management Studio
  • Enter and execute the following SQL query:
    RESTORE DATABASE database_name
    FROM DISK = ‘C:\Backups\database_name.bak’
    WITH RECOVERY
    GO

Next we need to set the databases to be read-write. Setting databases to be read-write can also be done using the SQL Server Management Studio using the UI tools or with SQL queries.

  • To set a database to be read-write with the UI tools:
  • Right-click the database name in the SQL Server Management Studio
  • Select Properties
  • In the Options page, set the Database Read-Only property to FALSE
  • Select OK
  • To set a database to be read-write with a SQL query:
  • Create a new SQL query in the SQL Server Management Studio
  • Enter and execute the following SQL query:
    USE master
    GO
    ALTER DATABASE database_name
    SET READ_WRITE
    GO

With the databases migrated we now need to update the farm identifier in the Social Sites database with the farm identifier of the SharePoint 2013 farm. We will first obtain the farm identifier from the SharePoint 2013 farm using PowerShell. Then we will use a SQL query in the SQL Server Management Studio to replace the farm identifier we obtained from the 2010 farm with the one obtained from the 2013 farm.

  1. Open the SharePoint 2013 Management Shell as administrator
  2. Enter “(Get-SPFarm).Id”
  3. Record the GUID output by the command
  4. Create a new SQL query in the SQL Server Management Studio
  5. Enter and execute the following SQL query, replacing “oldfarmid” with the farm identifier from SharePoint 2010, “newfarmid” with the farm identifier from SharePoint 2013, and “NewsGator_SocialServices” with the name of your Social Sites database if it is different:
    USE NewsGator_SocialServices
    GO
    UPDATE dbo.SocialGroups
    SET FarmId = ‘newfarmid’
    WHERE FarmId = ‘oldfarmid’
    GO
    UPDATE dbo.FarmConfiguration
    SET FarmId = ‘newfarmid’
    WHERE FarmId = ‘oldfarmid’
    GO

Next we will create a User Profile service application with the databases we migrated.

  1. Navigate to the Services on Server page in Central Administration and start the User Profile Service
  2. Open the SharePoint 2013 Management Shell
  3. Get or create a service application pool using the Get-SPServiceApplicationPool or New-SPServiceApplicationPool Cmdlet. For example:
    $appPool = Get-SPServiceApplicationPool “SharePoint Web Services System”
  4. Create the User Profile service application with the New-SPProfileServiceApplication Cmdlet using the database names of the databases we migrated from SharePoint 2010. For example:
    $upa = New-SPProfileServiceApplication –Name “User Profile Service Application” –ApplicationPool $appPool –ProfileDBName “MigratedProfileDBName” –SocialDBName “MigratedSocialDBName” –ProfileSyncDBName “MigratedSyncDBName”
  5. Create a service application proxy for the new User Profile service application with the New-SPProfileServiceApplicationProxy Cmdlet. For example:
    New-SPProfileServiceApplicationProxy –Name “User Profile Service Application Proxy” –ServiceApplication $upa –DefaultProxyGroup
  6. Navigate to the Service Applications page in Central Administration and provide the current user account with Administrator and Connection permissions to the new User Profile service application
  7. Navigate to the Services on Server page in Central Administration and start the User Profile Synchronization Service
  8. Lastly, import the encryption keys using the miiskmu.exe utility. For example:
    C:\Program Files\Microsoft Office Servers\15.0\Synchronization Service\Bin\miiskmu.exe /i C:\Backups\miiskeys-1.bin {0E19E162-827E-4077-82D4-E6ABD531636E}

Note that if you receive an error while trying to import your encryption keys it is usually because the User Profile Synchronization Service has not been started.

With our databases migrated and User Profile service application restored, we can now create our web applications. If your SharePoint 2010 web applications were using claims authentication, you can create the web applications in Central Administration. However, if they were using classic authentication mode, you will need to create classic authentication mode web applications in PowerShell, see :
http://technet.microsoft.com/en-us/library/gg276326.aspx.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s