Ask Learn
Preview
Ask Learn is an AI assistant that can answer questions, clarify concepts, and define terms using trusted Microsoft documentation.
Please sign in to use Ask Learn.
Sign inThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
So now we’ve got an active/passive SharePoint farm solution setup, the next question that is how to patch both farms with as little drama as possible. We need to patch one farm while the other’s in use so that our beloved users don’t notice anything’s even happened to SharePoint – one of the key reasons to have passive/active farms in fact.
How to patch with no downtime with SQL Server AlwaysOn has been covered already, but not with service-applications in sync too. This is a complex subject so be prepared!
It helps greatly if content & service-applications are in different SQL Server Availability Groups, but that’s not always how the back-end is setup; quite often all SharePoint databases are on the same one. This post outlines the process for both cases.
Some key terms here:
Note: you can do this either way round; swap farm1 for farm2 if you like, and the processes are the same, just in reverse.
First though, a bit about the challenge we’re up against. It’s quite epic if I don’t say so myself…
In short, we have two distinct farms that share databases in active/passive mode. We need to upgrade both farms without users suffering any downtime.
With a setup whereby service application databases are synchronised between two separate farms, you have an issue where you’ll need to upgrade the service application databases at some point – how to do so while also keeping them operational 100% of the time?
PSConfig will obviously have issues if it has to upgrade a read-only service-application database, so we can’t just run this on the inactive farm without some tricks & workarounds to side-step these roadblocks.
Finally, given we want to try and keep users in read/write mode in all SharePoint sites, the challenge becomes harder still. How to let users continue working normally but also locking databases for upgrades, especially given they’re synchronised between two (temporarily) disjointed SharePoint versions?
There’s a few strategies to attack this “how to upgrade synced farms” challenge:
The first strategy is the easiest, but rarely acceptable for the business needs – users need to update, and if they can’t it shouldn’t be for long. SharePoint patching can potentially be a long process!
The second strategy is more commonplace, but with a couple of different approaches to getting there.
Two approaches to patching SharePoint while users can still edit content:
The first approach basically involves upgrading each farm without anything attached & mounting the service-apps again with the yet-to-be-upgraded databases:
I don't think this is the best way so I’m focusing on the last option because it doesn’t involve recreating service-applications, which can be quite a big task admin task potentially. Also, it is (in my opinion) safer as there's more chance to react & rollback should you have any upgrade problems, even if both methods are valid.
As if it wasn't complicated enough already, how then to upgrade via my preferred approach also depends on if you’ve put all your SharePoint databases in a single SQL Server Availability Group or not (probably you have)…
This is the most common setup, but the most complex to update. For this configuration, we’ll patch the farm2 service-application DBs while users are still on farm1 (in full read/write mode for content databases). That does means we have to make sure farm1 doesn’t allow updates to (only) service-applications while we upgrade the same service-apps on farm2. This is easily done by making the service-apps read-only on farm1 during farm2s’ upgrade.
Short version:
We need to make service-app DBs read-only on the active farm (farm1) because farm2 service-app databases will ultimately overwrite them, so any data we change on farm1 in any service-app during upgrade would be lost. Users can still edit content while farm2 is being patched, just not taxonomies, user profiles, etc. Small note: this doesn’t include search btw; that’s a whole different game.
So far so good. But the complication is that farm1 has read/write access to the AG while we patch farm2 so our beloved users can still keep working in normal read/write mode for their content & sites. Of course though farm1 having full read/write access to the synced databases means therefore farm2 only has read-only access to everything in the AG, which will break the PSConfig stage of the upgrade if we don’t workaround this.
So in this example, our users keep using the normal primary site & we’re patching the secondary (farm2) in preparation.
In the meantime, we have farm1 to handle traffic and farm2 will have read-only access to everything not configuration.
Next-up, how to deal with service-app upgrades.
As mentioned above, we now have the issue that read-only service app DBs aren’t upgradable in PSConfig, which is a problem as we’re currently upgrading a farm with everything in read-only.
We’re going to deal with this by actually upgrading our service-apps now. That’s a bit awkward given we can’t do so easily as we’re in one AG for all databases, so time to remove the service-app databases from the AG sow farm2 can upgrade them.
ALTER AVAILABILITY GROUP [SP2013]
REMOVE DATABASE [App_Management];
GO
ALTER DATABASE [App_Management] SET READ_ONLY WITH ROLLBACK IMMEDIATE
GO
RESTORE DATABASE [App_Management]
GO
Make sure you repeat this process for all service-app DBs.
Now farm2 should have full read/write access to the service-application DBs & farm1 with read-only access to the same databases. Farm1 still has full read/write access to content databases.
This is how your farm1 SQL instance should look like. Nobody can edit these service-apps, which is good for the time-being. Content databases are in read/write mode at least, so unlikely to be a big deal.
Congratulations, farm2 is all upgraded (minus the content DB).
With one down, there’s one to go. This is a bit simpler.
Once everything’s been installed & rebooted (if necessary), we need to run PSConfig. But this time we don’t need to upgrade the service-app databases as we did that already, so…
DROP DATABASE [App_Management]
GO
When this completes, farm 1 will also have the upgraded service-application databases, and they’ll be back in sync again.
Congratulations! Farm1 is now also upgraded. Finish off the process with:
If you have your service-app DBs & content DBs in separate Availability Groups, then well done you for forward-thinking - it'll now pay off. This is the better setup as it gives greater failover dexterity – one SharePoint farm can have service-applications in read-only but content in full-read/write at the same time. Each group fails-over independently; very handy for patching & upgrading SharePoint databases!
Short version:
Ah, so much cleaner!
That’s it for now. If anything’s not clear, let me know in the comments below – it’s a complex subject so it’s possible.
Cheers,
Sam Betts
Ask Learn is an AI assistant that can answer questions, clarify concepts, and define terms using trusted Microsoft documentation.
Please sign in to use Ask Learn.
Sign in