Im just finishing up on a project where i was upgrading a bunch of servers from 2012 R2 to 2019 or 2022 (depending on what the associated app supported), including a bunch of SQL clusters.
I’ve always been SQL adjacent – working wit/upgrading/installing SQL for other products to utilise… so i have some incidental knowledge – but its not my core skill set.
Things of note from the upgrades were:
When performing an in-place OS upgrade – upgrade speed can be significantly increased if you remove old user profiles
Some of the servers i was upgrading had hundreds of profiles on them that had not been used for a year or more….. all servers had at least 20 “Account unknown” profiles
SQL Error Logging
The best way to find the error log if any upgrade goes wrong is to look in the registry at
KEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\<instance/version>\MSSQLServer\Parameters\
You can then copy/paste the path to the error log and get some helpful errors out
SSISDB is the bane of SQL cluster upgrades
SQL 2014 and below don’t support replicating SSISDB via AAG, so before you service pack, this DB must be removed from the AAG replication and the passive nodes have the DB deleted.
SQL 2016 and above support replicating SSISDB – so service packs can be applied without having to remove SSISDB from anywhere
All SQL upgrades (e.g. SQL 2014 or 2016 to SQL 2019) do not allow SSISDB to be part of an AAG – so SSISDB must be removed from the replication group and have the copy on the passive nodes deleted first.
If you forget this, you will likely see an error message similar to
Script level upgrade for database ‘master’ failed because upgrade step ‘SSIS_hotfix_install.sql’ encountered error 15151, state 1, severity 16
Starting SQL to fix issues
So – you have run into an issue with the upgrade, as, for example, SSISDB was still replicated….. but now you cant start the SQL service to delete it
This is where /T902 comes in handy
- Get the short name of your SQL service (from services.msc)
- open a elevated command prompt
- net start MSSQL$Instancename /T902
You can then do what you need to the SQL configuration.
Reporting services
Reporting services in 2017 and above is not a straight upgrade from 2016 and below. There’s plenty of articles around the web on the upgrade process – but…..
During inventory, make sure your discover SSISDB and Reporting services instances
In hindsight, one of the things i would have focused on more in my pre-upgrade inventory script was to identify SSISDB and reporting services instances.
Many of these in the recent project were present but not actually needed/in-use and could just be uninstalled.
Cluster rolling upgrades
This is well documented – but just to make it nice and short (the MS doco makes it seem harder than it is)
- Ensure SQL AAG and cluster resource active node is node “X”
- Ensure failover is set to manual
- Verify SQL AAG is healthy and all databases are sync’ed
- Service pack the current version of SQL – so i will support server 2019
- Node Y – Upgrade 2012R2 to 2016 – Check node is still able to join cluster
- Node Z – Upgrade 2012R2 to 2016 – Check node is still able to join cluster
- Node X – Failover SQL AAG and cluster core resources to another node (e.g. Node Z)
- Node X – Upgrade 2012R2 to 2016 – Check node is still able to join cluster
- Upgrade cluster functional level
- Node X – Upgrade 2016 to 2019 – Check node is still able to join cluster
- Verify SQL AAG is healthy and all databases are sync’ed
- Node X – Upgrade SQL 20xx to SQL 2019 with current CU
- Node X – Failover SQL AAG and cluster core resources back to node Z
- Once you do this – you will not be able to fail over to other nodes until they are also upgraded. Replication will also stop to “lower” version nodes – don’t freak out when you see this (like i did on my first upgrade!)
- Node Y – Upgrade 2016 to 2019 – Check node is still able to join cluster
- Node Y – Upgrade SQL 20xx to SQL 2019 with current CU
- Node Z – Upgrade 2016 to 2019 – Check node is still able to join cluster
- Node Z – Upgrade SQL 20xx to SQL 2019 with current CU
- Upgrade cluster functional level
- On each database on Node Y an Node Z, you will need to go into SQL management studio and select “resume data movement” – this tells SQL to try again – which will now work – as the same version of SQL is in use across the cluster