SharePoint 2019 Upgrade Part 2 - SharePoint 2016 Upgrade

SharePoint 2016 Upgrade 

This is the second part of blog series SharePoint 2019 Upgrade, in this post we are going to upgrade service applications and Web application databases from SharePoint 2013 to SharePoint 2016:
  1. SharePoint 2016 Installation and Configuration.
  2. Upgrading Service Applications and Web Applications from SharePoint 2013 to 2016.
  3. SharePoint 2019 Installation and Configuration.
  4. Upgrading Service Applications Databases from SharePoint 2016 to 2019.
  5. Upgrading Content Databases and Site Collections from SharePoint 2016 to 2019.
  6. SharePoint Upgrade Issues

Upgrade Service Application

Referred following MSDN article to upgrade service applications
  1. https://docs.microsoft.com/en-us/sharepoint/upgrade-and-update/create-the-sharepoint-server-2016-farm-for-a-database-attach-upgrade
  2. https://docs.microsoft.com/en-us/sharepoint/upgrade-and-update/copy-databases-to-the-new-farm-for-upgrade-to-sharepoint-server-2016
  3. https://docs.microsoft.com/en-us/sharepoint/upgrade-and-update/upgrade-service-applications-to-sharepoint-server-2016
  4. https://docs.microsoft.com/en-us/sharepoint/upgrade-and-update/upgrade-content-databases

Restore Database backups

Before restoring below mentioned services and applications please make sure to restore corresponding database backups to SQL Server 2016 instance (SP16SQL01).

Backup Databases from SQL 2013 instance (SP13SQL01)

  1. Open SQL Server Management Studio on SP13SQL01 server.
  2. Run following command to take backup of database, or you can right click on database and take backup
  3. Repeat step#2 for all the databases that need to be backed-up.

Restore backups to SP16SQL01

  1. Copy backup files into SP16SQL01 server.
  2. Open SQL Server Management Studio on SP16SQL01 server.
  3. Create a RestoreDatabase.sql with commands for restoring all the backups.
  4. Open RestoreDatabase.sql file, I’ve updated the Database names with SP2019 prefix (as our final goal is to upgrade to 2019, you can leave the database name as it is).
  5. Check and update (if required) backup file location, data file location, log file location and execute command to restore backups
  6. Refresh the database list in Management Studio.

Upgrade Service Applications

Upgrade Secure Store Service

Save the content of table in Restore-SecureStoreService.ps1 file. Open SharePoint Management Shell in Administrator mode and run Restore-SecureStoreService.ps1 to create Secure Store Service.
Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue

#Restore Secure Store Service
$sssPassphrase = '<Secure Store Passphrase used in SP 2013>'
$appPoolName = 'SharePoint Web Services System'
$dbName ='SP2019_SecureStoreService'
$serviceName ='Secure Store Service Application'
$serviceProxyName ='Secure Store Service Application Proxy'

$applicationPool = Get-SPServiceApplicationPool -Identity $appPoolName

if($applicationPool -ne $null){

    #Create Secure Store Service from Restored Database
    $sss = New-SPSecureStoreServiceApplication -Name $serviceName -ApplicationPool $applicationPool -DatabaseName $dbName -AuditingEnabled
    Write-Host "Secure Store Service Created successfully $sss ..." -ForegroundColor Green

    #Create Secure Store Service Application Proxy
    $sssp = New-SPSecureStoreServiceApplicationProxy -Name $serviceProxyName -ServiceApplication $sss -DefaultProxyGroup
    Write-Host "Secure Store Service proxy Created successfully $sssp ..." -ForegroundColor Green

    Write-Host 'Updating Secure Store Passphrase...' -ForegroundColor Yellow
    Update-SPSecureStoreApplicationServerKey -Passphrase $sssPassphrase -ServiceApplicationProxy $sssp
    Write-Host 'Secure Store Passphrase updated successfully.' -ForegroundColor Green
}

Upgrade Business Connectivity Services

Save the content of table in Restore-BusniessConnectivityService.ps1 file. Open SharePoint Management Shell in Administrator mode and run Restore-BusniessConnectivityService.ps1 to create Business Connectivity Service.
Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue

#Restore Business Connectivity Service

$appPoolName = 'SharePoint Web Services System'
$dbName ='SP2019_BusinessConnectivityService'
$serviceName ='Business Connectivity Service Application'
$serviceProxyName ='Business Connectivity Service Application Proxy'

$applicationPool = Get-SPServiceApplicationPool -Identity $appPoolName

if($applicationPool -ne $null){

    #Create Business Connectivity Service from Restored Database
    $bcs = New-SPBusinessDataCatalogServiceApplication -Name $serviceName -ApplicationPool $applicationPool -DatabaseName $dbName
    Write-Host "Business Connectivity Service Created successfully $bcs ..." -ForegroundColor Green
}

Upgrade Managed Metadata Service

Save the content of table in Restore-ManagedMetadataService.ps1 file. Open SharePoint Management Shell in Administrator mode and run Restore-ManagedMetadataService.ps1 to create Managed Metadata Service.
Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue

#Restore Managed Metadata Service

$appPoolName = 'SharePoint Web Services System'
$dbName ='SP2019_ManagedMetadataService'
$serviceName ='Managed Metadata Service Application'
$serviceProxyName ='Managed Metadata Service Application Proxy'

$applicationPool = Get-SPServiceApplicationPool -Identity $appPoolName

if($applicationPool -ne $null){

    #Create Managed Metadata Service from Restored Database
    Write-Host "Creating Managed Metadata Service" -ForegroundColor Yellow
    $mms = New-SPMetadataServiceApplication -Name $serviceName -ApplicationPool $applicationPool -DatabaseName $dbName
    Write-Host "Managed Metadata Service Created successfully: $mms" -ForegroundColor Green


    Write-Host "Creating Managed Metadata Service Proxy..." -ForegroundColor Yellow
    New-SPMetadataServiceApplicationProxy -Name $serviceProxyName -ServiceApplication $mms -DefaultProxyGroup
    Write-Host "Managed Metadata Service proxy Created successfully" -ForegroundColor Green
}

Upgrade User Profile Service

Save the content of table in Restore-UserProfileService.ps1 file. Open SharePoint Management Shell in Administrator mode and run Restore-UserProfileService.ps1 to create User Profile Service.
Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue

#Restore User Profile Service

$appPoolName = 'SharePoint Web Services System'
$serviceName ='User Profile Service Application'
$serviceProxyName ='User Profile Service Application Proxy'

$dbProfile ='SP2019_UPSA_ProfileDB'
$dbSocial ='SP2019_UPSA_SocialDB'
$dbSync ='SP2019_UPSA_SyncDB'


$applicationPool = Get-SPServiceApplicationPool -Identity $appPoolName

if($applicationPool -ne $null){

    #Create User Profile Service from Restored Database
    Write-Host "Creating User Profile Service..." -ForegroundColor Yellow
    $upsa = New-SPProfileServiceApplication -Name $serviceName -ApplicationPool $applicationPool -ProfileDBName $dbProfile -SocialDBName $dbSocial -ProfileSyncDBName $dbSync
    Write-Host "User Profile Service Created successfully: $upsa" -ForegroundColor Green


    Write-Host "Creating User Profile Service Proxy..." -ForegroundColor Yellow
    $proxy = New-SPProfileServiceApplicationProxy -Name $serviceProxyName -ServiceApplication $upsa
    Write-Host "User Profile Service proxy Created successfully" -ForegroundColor Green


    Add-SPServiceApplicationProxyGroupMember -member $proxy -identity ""
    Write-Host "$proxy added to defult group" -ForegroundColor Green
}

Upgrade Search Service

Save the content of table in Restore-SearchService.ps1 file. Open SharePoint Management Shell in Administrator mode and run Restore-SearchService.ps1 to create Search Service Application. This script will attach only Search DB to application. 
Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue

#Restore Search Service Application

$appPoolName = 'SharePoint Web Services System'
$serviceName ='Search Service Application'
$serviceProxyName ='Search Service Application Proxy'

$dbServer = 'SP16SQLAlias'
$searchDB ='SP2019_SearchService_DB'


$applicationPool = Get-SPServiceApplicationPool -Identity $appPoolName

if($applicationPool -ne $null){

    #Create Search Service Application from Restored Database
    Write-Host "Creating Search Service Application..." -ForegroundColor Yellow
    $searchInst = Get-SPEnterpriseSearchServiceInstance -local
    # Gets the Search service instance and sets a variable to use in the next command
    Restore-SPEnterpriseSearchServiceApplication -Name $serviceName -applicationpool $applicationPool -databasename $searchDB -databaseserver $dbServer -AdminSearchServiceInstance $searchInst

    Write-Host "Search Service Application Created successfully" -ForegroundColor Green

    $ssa = Get-SPEnterpriseSearchServiceApplication

    Write-Host "Creating Search Service Application Proxy..." -ForegroundColor Yellow
    New-SPEnterpriseSearchServiceApplicationProxy -Name $serviceProxyName -SearchApplication $ssa
    Write-Host "Search Service Application proxy Created successfully" -ForegroundColor Green

    $ssap = Get-SPEnterpriseSearchServiceApplicationProxy
    Add-SPServiceApplicationProxyGroupMember -member $ssap -identity ""
    Write-Host "$ssap added to defult group" -ForegroundColor Green
}

To attach addition DB, ex. analytics use move database method as described in this MSDN article.
Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue

#Add other databases to Search Service Application
    $analyticsDB ='SP2019_SearchService_AnalyticsReportingDB'
    $ssa = Get-SPEnterpriseSearchServiceApplication
   
    Add-SPServerScaleOutDatabase -ServiceApplication $ssa -DatabaseServer $dbServer -DatabaseName $analyticsDB
    $temp = Get-SPServerScaleOutDatabase -ServiceApplication $ssa
    Remove-SPServerScaleOutDatabase -Database $temp[0] -ServiceApplication $ssa


I haven't figured out how to add SP2013 Crawl DB and link DB to Search Service application.

Upgrade Web Applications

Install Custom Solutions

Install all the custom solution(if any) to SharePoint 2016 environment.

Upgrade default web application

  1. Create Web application at port 80 using Create-WebApplication.ps1 PowerShell script.
    Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue

    $siteName ="SharePoint-2016";
    $siteUrl ="http://Sharepoint16";
    $hostheader =" Sharepoint16";
    $appPoolName ="SharePoint-AppPool";

    $ap = New-SPAuthenticationProvider
    $account = Get-SPManagedAccount "domain\username"

    New-SPWebApplication -Name $siteName -Port 80 -HostHeader $hostheader -URL $siteUrl -ApplicationPool $appPoolName -ApplicationPoolAccount $account -AuthenticationProvider $ap


  2. Create Managed Paths
  3. Remove Content Database
  4. Run PowerShell script to test-content database.
    Test-SPContentDatabase –WebApplication http://sharepoint16 –Name “SP2019_Content” –DatabaseServer “SP16SQLAlias”
  5. Check the output for missing features and resolve the issues.
  6. Attach the Content database to web application
    Mount-SPContentDatabase –WebApplication http://sharepoint16 –Name “SP2019_Content” –DatabaseServer “SP16SQLAlias”

    On Completion it’ll display 100%
  7. Go to Central Admin > Application Management > Change Site Collection Administrators and update Site Collection admin account.
  8. Restart IIS
  9. Try accessing site with url.
  10. If site throws access denied error, then disable loopback check and restart the server and try again.

Upgrade My Site web application

  1. Create Web application at port 80 using Create-MySiteHost.ps1 PowerShell script.
    Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue

    $siteName ="MySite-2016";
    $siteUrl ="http://mysite.com";
    $hostheader =" mysite.com";
    $appPoolName ="MySite-AppPool";

    $ap = New-SPAuthenticationProvider -UseWindowsIntegratedAuthentication -DisableKerberos
    $account = Get-SPManagedAccount "domain\username"

    New-SPWebApplication -Name $siteName -Port 80 -HostHeader $hostheader -URL $siteUrl -ApplicationPool $appPoolName -ApplicationPoolAccount $account -AuthenticationProvider $ap 

  2. Create Managed Path “Personal”
  3. Remove Content Database
  4. Run PowerShell script to test-content database.
    Test-SPContentDatabase –WebApplication "http://mysite.com" –Name "SP2019_MySiteHost_Content" –DatabaseServer "SP16SQLAlias"
  5. Check the output for missing features and resolve the issues (if possible or ignore).
  6. Attach the Content database to web application
    Mount-SPContentDatabase –WebApplication http://mysite.com –Name "SP2019_MySitehost_Content" –DatabaseServer "SP16SQLAlias"
    On complete it’ll display 100%
  7. Go to Central Admin > Application Management > Change Site Collection Administrators and update Site Collection admin account.
  8. Restart IIS
  9. Try accessing site with url.
  10. Go to Central Admin > Manage Service Application > User Profile Service Application
  11. Update Search Centre url and My Site url.

Verify upgrade status for databases

You can check the status from Upgrade Status page to monitor progress and verify that the upgrade process is complete. Review the log file to identify any other issues.

Configure other services

Go to Central Admin > Configuration Wizard and start the Wizard to configure other services that you want to be running in your farm.

Congratulation!!! You have upgraded to SharePoint 2016. We are half way to completing our task to upgrade to 2019. Stay tuned for next post about SharePoint 2019 Installation and configuration... 

Comments

Popular posts from this blog

Installation and Configuration of Office Online Server with SharePoint 2019

Workflow Manager 1.0- Installation, Configuration and Issues

SharePoint 2019 Upgrade Part 6: SharePoint Upgrade Issues