SharePoint High Availability and Disaster Recovery based on SQL Server Options

Microsoft provides many solutions to enable High Availability (HA) or Disaster Recovery (DR) for SharePoint based on SQL Server solutions.

At the high level, these options are:

  • Backup and Restore
  • Log Shipping
  • Replication
  • Mirroring
  • Failover Cluster
  • AlwaysOn Availability Group

There are solutions out of SQL Server product like SAN replication, Hyper-V replication and other solutions but these types of replications are not supported by Microsoft because they may cause consistency issues especially for search index and timer jobs.

The only exception for Virtual machine replication is Azure Site Recovery, which does support replication of virtual machines into Azure for the purposes of Disaster Recovery, you can find more information in these links:
https://docs.microsoft.com/en-us/azure/site-recovery/site-recovery-sharepoint

https://docs.microsoft.com/en-us/office365/enterprise/sharepoint-server-2013-disaster-recovery-in-microsoft-azure

Backup and Restore

The purpose of creating SQL Server backups is to enable you to recover a damaged database. We can summarize the Pros and Cons in the following points:

  • There is a possibility to lose Data
  • Inexpensive solution for DR
  • It doesn’t provide HA
  • Protection at database level

Log Shipping

SQL Server Log shipping allows you to automatically send transaction log backups from a primary database on a primary server instance to one or more secondary databases on separate secondary server instances. We can summarize the Pros and Cons in the following points:

  • Can be HA or DR
  • No automatic failover
  • Protection at database level
  • Inexpensive solution
  • There is a possibility to lose Data

Replication

Replication is a set of technologies for copying and distributing data and database objects from one database to another and then synchronizing between databases to maintain consistency. We can summarize the Pros and Cons in the following points:

  • Protection at database level
  • No automatic failover
  • Inexpensive solution
  • Can be used as load balancing
  • Can be HA or DR

Mirroring

Database mirroring is a primarily software solution for increasing database availability by replicate the data between primary and secondary servers. We can summarize the Pros and Cons in the following points:

  • Can be HA or DR
  • Limited to two servers
  • It supports automatic failover but it needs witness server for this purpose
  • Replaced with AlwaysOn in SQL Server 2012 and higher releases

Note:

Not all databases can be configured with Failover database server from central administration but you can add this property from PowerShell for these database like configuration database using the below commands:
$database = Get-SPDatabase | where { $_.Name -eq “SomeSharePointDB” }

$database.AddFailoverServiceInstance(“SQLSecond”)

$database.Update();

Failover Cluster

A Windows Server Failover Clustering (WSFC) cluster is a group of independent servers that work together to increase the availability of applications and services. SQL Server takes advantages of WSFC services to provide local high availability through redundancy at the server-instance level. We can summarize the Pros and Cons in the following points:

  • HA
  • Expensive Solution
  • Protection at instance level
  • It supports automatic failover

AlwaysOn Availability Group

This is the latest solution provided by Microsoft from SQL Server 2012 and higher releases which has the features of Database Mirroring and Failover Cluster with many enchantments and new features. We can summarize the Pros and Cons in the following points:

  • Can have up to 4 replicas or more based on SQL Server versions (In Mirroring , only one primary and one secondary servers)
  • Can be HA and DR (HA = Sync mode , DR = Async mode)
  • No need for SAN storage (In Failover cluster , SAN storage or other network disks are required)
  • Can be deployed in geographical (like in Failover Cluster but with more enchantments)
  • No need for witness Server
  • You can use Availability Group Listener (Virtual IP and Name like in Failover cluster)
  • Replica Servers can be accessed for backup or reporting service operations … etc.
  • Supports automatic failover (In case of Sync mode)
  • Needs SQL Server enterprise edition

So in this case you can use one solution to provide HA and DR instead of using multiple solutions like what it was in previous versions for example, using Database Mirroring for remote DR (or log shipping) and Failover cluster for HA.

 Terms

AlwaysOn Failover Cluster instance (FCI) = SQL Server Failover Cluster Instance

AlwaysOn Availability Group = like Database mirroring in old version but with many enhancements

This table from Microsoft whitepaper to show the differences between these solutions (Based on SQL Server 2012 version):

1

 

Advertisements

Scale out Search index in SharePoint Server

In order to scale out SharePoint search index component, first make sure to have an existing search topology already configured and deployed then for scaling there is two options as following:

  1. Add an index replica to an existing index partition in order to achieve fault tolerance for an existing index partition (place it on separate servers)
  2. Add a new index partition for scaling (Recommended is 10M items for each index partition)

Steps to add an index replica:

  1. Open SharePoint Management Shell with SharePoint farm account
  2. Start a search service instance on the server that you want to create the index replica
    $hostA = Get-SPEnterpriseSearchServiceInstance -Identity “Server1”
    Start-SPEnterpriseSearchServiceInstance -Identity $hostA
  3. Wait until the search service instance is running, you can check the status by
    Get-SPEnterpriseSearchServiceInstance -Identity $hostA
  4. Clone the current active search topology
    $ssa = Get-SPEnterpriseSearchServiceApplication
    $active = Get-SPEnterpriseSearchTopology -SearchApplication $ssa -Active
    $clone = New-SPEnterpriseSearchTopology -SearchApplication $ssa -Clone -SearchTopology $active
  5. Add a new index component and associate it with a partition
    New-SPEnterpriseSearchIndexComponent -SearchTopology $clone -SearchServiceInstance $hostA -IndexPartition 0
  6. Where “0” is is the number of the existing index partition that you are creating a replica of
  7. Finally, Activate the clone topology
    Set-SPEnterpriseSearchTopology -Identity $clone
  8. Monitor the distribution of the existing index to the new replica. The added index replica will have the state Degraded until the distribution is finished

 

Steps to Add a new index partition:

  1. Open SharePoint Management Shell with SharePoint farm account
  2. Start a search service instance on all the servers where you want to add an index replica for the new index partition
    $hostC = Get-SPEnterpriseSearchServiceInstance -Identity “Server2”
    Start-SPEnterpriseSearchServiceInstance -Identity $hostC
    $hostD = Get-SPEnterpriseSearchServiceInstance -Identity “Server3”
    Start-SPEnterpriseSearchServiceInstance -Identity $hostD
  3. Wait until the search service instance is running, you can check the status by
    Get-SPEnterpriseSearchServiceInstance
  4. Clone the active search topology
    $ssa = Get-SPEnterpriseSearchServiceApplication $active = Get-SPEnterpriseSearchTopology -SearchApplication $ssa -Active $clone = New-SPEnterpriseSearchTopology -SearchApplication $ssa -Clone -SearchTopology $active
  5. Add a new index partition by adding one or more index components and associate them with the new index partition, For example, if you have an existing index partition 0 with index replicas on Host A and Host B, and you want to add a new index partition with index replicas on Host C and Host D:
    New-SPEnterpriseSearchIndexComponent -SearchTopology $clone -SearchServiceInstance $hostC -IndexPartition 1 New-SPEnterpriseSearchIndexComponent -SearchTopology $clone -SearchServiceInstance $hostD -IndexPartition 1
  6. Verify that the Search service application is running
    $ssa.IsPaused() -ne 0
  7. If the Search service application is paused, find out why and if you have to wait for any operation to complete before you can continue
  8. Start the activation of the clone topology
    $ssa.PauseForIndexRepartitioning()
    Set-SPEnterpriseSearchTopology -Identity $clone
  9. Monitor the progress of the index repartitioning process
  10. Resume the Search service application
    $ssa.ResumeAfterIndexRepartitioning()

 

Error in the Microsoft SharePoint Server People Protocol Handler

To configure SharePoint user profile with search service in order to create employee directory with search functionalities, make sure to have the following points is configured:

  1. Configuring User Profile and Managed Metadata services
  2. Configuring Synchronization Connections
  3. Starting Profile Synchronization with full Synchronization (user need Replicating Directory Changes permissions)
  4. Adding User Profile and Managed Metadata services to web application Service Connections
  5. Grant search Default content access account permission in user profile serviceUntitled
  6. Creating search content source with this link format sps3://URL
  7. Run full Crawal

If you get this error “Error in the Microsoft SharePoint Server People Protocol Handler” in search logs then make sure to add value in My Site Host location in user profile.

Untitled2.png

 

 

Microsoft SharePoint Server 2016 on AWS

AWS is a great place to host SharePoint Server 2016 on the cloud and even AWS created cloudformation template to create high available environment for SharePoint Server 2016.

You can find cloudformation template and its documentation in this link:

https://aws.amazon.com/windows/products/sharepoint/

Untitled

Here I want to mention some points to consider when using AWS services:

  1. Hosting SharePoint Server 2016 on AWS could provide 40% savings over the typical cost to deploy an on-premises SharePoint solution.
    [Based on many factors like topology design, region, ec2 types and High available solutions]
  2. Instead of using EC2 as domain server, with AWS Managed Microsoft AD, you can run directory-aware workloads in the AWS Cloud, including Microsoft SharePoint and custom .NET and SQL Server-based applications
    https://docs.aws.amazon.com/directoryservice/latest/admin-guide/directory_microsoft_ad.html
    https://aws.amazon.com/blogs/security/introducing-aws-directory-service-for-microsoft-active-directory-standard-edition/
  3.  It’s recommended to use SQL Server AlwaysOn Availability Groups , but if you want to use Native SQL Server Failover Clustering then you need third party tools and services.

standardedition_usecases_1017_large

SharePoint 2013 Prerequisites Wizard failed because of Application Server Role and Web Server (IIS) Role

Sometimes SharePoint 2013 Prerequisites Wizard failed with the following error:

The tool was unable to install Application Server Role, Web Server (IIS) Role.

sQp7v

In most cases the reason for this error two things:

  1. Unable to install .NET Framework 3.5
  2. Or Current SharePoint setup is not compatible with Windows version, for example to install SharePoint 2013 in Windows Server 2012 R2 then you need to have SharePoint Server 2013 with Service Pack 1

To fix the first reason, follow the notes in this post https://fabdulwahab.com/2018/01/11/install-sharepoint-2016-prerequisites-offline-manually/

For the second reason, try the following solution:

Go to C:\windows\System32 folder, find and copy  “ServerManager.exe” as “ServerManagerCMD.exe” then run the prerequisite installer for SharePoint again.

 

Cleaning content database from missing files after upgrading

General Notes:

  1. Take backup form content database
  2. Run it in testing server before go production
  3. Run Test-SPContentDatabase again and again and make sure all issues are fixed
  4. Sometimes missing files issues could be in pages in recycle bin or in old page versions

Issue 1: MissingFeature

Fix: Follow steps in this article

http://get-spscripts.com/2011/06/removing-features-from-content-database.html

Or use this tool SharePoint Feature Administration and Clean Up Tool to find and delete broken features in a SharePoint farm

https://github.com/achimismaili/featureadmin

Issue 2: MissingSetupFile

Fix: Follow steps in this article

http://get-spscripts.com/2011/06/diagnosing-missingsetupfile-issues-from.html

Issue 3 & 4 : MissingWebPart & MissingAssembly

Fix: Follow steps in this article

http://get-spscripts.com/2011/08/diagnose-missingwebpart-and.html

 

Updated – Maximizing SharePoint Security Whitepaper 2.0

I updated Maximizing SharePoint Security whitepaper with points and topics related to SharePoint 2016 as the following:

  • Added CIS SharePoint 2016 benchmark
  • Added New features of SharePoint 2016 which related to security like
    • Data Loss Prevention
    • Outgoing SMTP Encryption
    • TLS 1.2 support
    • Patching with Zero downtime
    • New changes for SharePoint 2016 service accounts

You can download the document from this URL https://gallery.technet.microsoft.com/Maximizing-SharePoint-cf7f7efc

SharePoint Search result Page throw Error for anonymous User

When anonymous user go to SharePoint search , he got an error with correlation id, when checked the logs I found the following error related to Security Token and SPContext:

Untitled2

To fix the issue, you have to change impersonate=”true” as it’s the default value in web.config:

</authentication>
<identity impersonate=”true” />

and to resolve custom code that need to use impersonate=”false”, run you code with evaluated privilege.

Install SharePoint 2016 Prerequisites Offline/Manually

Nothing new in installing SharePoint 2013/2016 prerequisites offline or manually and you can find many articles for how to do it like for example https://gallery.technet.microsoft.com/office/PreRequisites-for-7f719ff3  but here just some notes to be considered.

  1. You can install all SharePoint prerequisites manually except for Windows Server App Fabric, you need to install it using the following command:
    WindowsServerAppFabricSetup_x64.exe /i CacheClient,CachingService,CacheAdmin /gac
  2. Or by running the following command using  prerequisite installer
    prerequisiteinstaller.exe /AppFabric:path\appFabric1.1-RTM-KB2671763.exe
  3. To install .NET Framework manually, make sure to enable this policy Specify settings for optional component installation and component repair if you want to install it from the internet.
    Dism /online /enable-feature /featurename:NetFX3 /All
  4. Or to install it from the ISO windows server
    Dism /online /enable-feature /featurename:NetFX3 /All /Source:D:\sources\SxS /LimitAccess
  5. Install WcfDataServices by command:
    prerequisiteinstaller.exe /wcfdataservices56: WcfDataServices.exe location