Patching and Upgrades for RDS SQL Server

RDS patches SQL Server for you, but “for you” still means a restart in a window you pick, and a major version jump only starts when you start it. A well-run RDS SQL Server upgrade is a boring one, with a planned window, a test on a copy, the new groups ready and a rollback snapshot sitting there in case you need it.

First you’ll look at saat-sql’s maintenance settings and pending actions and set a sensible window. After that you’ll build a small SQL Server 2019 “legacy” instance and move it to 2022 the careful way (snapshot, test copy, upgrade, check, and only then production), and on the way you’ll run into the two errors nearly every team meets on its first major upgrade.

TimeYou needBy the end you can
120 minutes (mostly waiting for upgrades)Lessons 42 to 52 done (saat-sql, saat-sqlserver-ex-16 parameter group and saat-sqlserver-ex-16-og option group, Start-SqlLab.ps1), your laptop signed in as saat-admin. Cost: under USD 1 (two small Express instances for about two hours). Everything you create is deleted at the end.Read maintenance windows and pending actions, decide on an auto minor upgrade policy, find which upgrade targets are valid, rehearse a major upgrade on a snapshot copy, deal with parameter and option groups, and handle compatibility levels.

What it is, in one line

An RDS SQL Server upgrade takes an instance to a newer minor version (a cumulative update) or a newer major version, either in a maintenance window or right away.

In Simple Words

Servicing a car

Think of your car. A small service like an oil change happens often, it’s quick, and the garage does it at a time you book, which is what a minor version update is like. Putting in a newer engine is a much bigger job, so you’d fit it in a spare car first, check every switch still works and only then touch your own car, and that’s a major version upgrade tested on a copy.

The new engine needs its own parts list, and trying to use the old one is the error most people hit on their first major upgrade.

Engineer's View

How RDS SQL Server maintenance works

Each instance gets a weekly maintenance window (30 minutes or more) and a daily backup window, and the two shouldn’t overlap. Minor versions (cumulative updates) are applied by you, or automatically during the window if AutoMinorVersionUpgrade is on. OS and hardware updates turn up as pending maintenance actions, which you can apply now or leave for the window.

Major versions (2019 to 2022, 2022 to 2025) happen only when you ask for them with --allow-major-version-upgrade. If the instance uses custom parameter or option groups, you have to supply new ones for the target family (sqlserver-ex-16.0, and option group major version 16.00).

RDS takes a snapshot before and after the upgrade, and that’s your only way back, because there’s no in-place rollback, just restoring the pre-upgrade snapshot. On Multi-AZ the upgrade is rolling, so the outage is roughly one failover.

describe-db-engine-versions shows the valid targets for the version you’re on. Databases keep their compatibility level after an upgrade, so you raise it later with Query Store switched on to catch plan regressions, and you always rehearse on a restored snapshot first.

How it works, step by step

This is the safe route for a major upgrade.

1Rehearse on a copy

Snapshot production, restore it as a test instance and upgrade that copy with the new groups. Keep an eye on the clock while it runs, because that tells you how long production will take.

Safe RDS SQL Server major upgrade tested on a snapshot copy

2Test what matters

Run the app’s main queries, jobs and reports against the copy, and check logins, linked servers and options. Leave the compatibility level where it is until you’ve tested at the old one.

3Upgrade production in the window

Use the same command and the same groups, with a fresh snapshot taken just before. If something goes wrong, restore the pre-upgrade snapshot and point the app at it.

4Know the kinds of maintenance

Maintenance comes in a few different kinds:

Kinds of RDS maintenance: minor, major, OS updates and compatibility level

Most surprise outages come from maintenance nobody checked, like auto minor upgrades or pending OS updates landing in a window that nobody remembered setting.

✅ Checkpoint: You can explain the maintenance window, minor vs major upgrades, why custom groups have to be replaced and why the compatibility level doesn’t change.

Hands-on lab: take a 2019 instance to 2022 safely

Before you run any command, double-check it

Read every command twice before you press Enter. Check the target: the system or account, the IDs, the names and the sizes. These commands are for learning and were tested in our lab, not on your system. At work, run the read-only list commands first, follow your change process, make sure a backup exists, and ask a second person to check anything that changes or deletes data. You run them at your own risk.

Sign in and start the SQL lab (the instance has to be running before you can change its settings):

cd C:\aws-lab
aws login --profile saat-admin
$env:AWS_PROFILE = 'saat-admin'
$v = Get-Content C:\aws-lab\saat-vpc.json | ConvertFrom-Json
.\Start-SqlLab.ps1

1Check saat-sql’s maintenance settings

Paste this whole block:

$cur = aws rds describe-db-instances --db-instance-identifier saat-sql --query "DBInstances[0].EngineVersion" --output text
aws rds describe-db-instances --db-instance-identifier saat-sql --query "DBInstances[0].[EngineVersion,AutoMinorVersionUpgrade,PreferredMaintenanceWindow,PreferredBackupWindow]" --output text
aws rds describe-pending-maintenance-actions --filters "Name=db-instance-id,Values=saat-sql" --query "PendingMaintenanceActions[].PendingMaintenanceActionDetails[].[Action,Description]" --output text
aws rds describe-db-engine-versions --engine sqlserver-ex --engine-version $cur --query "DBEngineVersions[0].ValidUpgradeTarget[].[EngineVersion,IsMajorVersionUpgrade]" --output text
aws rds modify-db-instance --db-instance-identifier saat-sql --preferred-maintenance-window sun:19:30-sun:20:30 --query "DBInstance.PreferredMaintenanceWindow" --output text

You should see something like this:

16.00.4265.3.v1 True    thu:21:16-thu:21:46     18:30-19:00
system-update   New Operating System update is available
16.00.4275.1.v1 False
sun:19:30-sun:20:30

When saat-sql was created, RDS gave it a random Thursday window, and now it’s Monday 1:00 to 2:00 India time, after the backup window. There’s one newer minor version and a pending OS update, and since auto minor upgrade is on, that minor version would turn up in a later window by itself.

2Build a “legacy” SQL Server 2019 instance

Paste this whole block. It creates 2019 groups and a 2019 Express instance with a small database, which takes about 20 minutes:

$v19 = aws rds describe-db-engine-versions --engine sqlserver-ex --query "DBEngineVersions[?starts_with(EngineVersion, '15.00')].EngineVersion | [-1]" --output text
aws rds create-db-parameter-group --db-parameter-group-name saat-sqlserver-ex-15 --db-parameter-group-family sqlserver-ex-15.0 --description "Legacy 2019 parameters" | Out-Null
aws rds create-option-group --option-group-name saat-sqlserver-ex-15-og --engine-name sqlserver-ex --major-engine-version 15.00 --option-group-description "Legacy 2019 options" | Out-Null
aws rds create-db-instance --db-instance-identifier saat-legacy --engine sqlserver-ex --engine-version $v19 --license-model license-included --db-instance-class db.t3.micro --allocated-storage 20 --storage-type gp3 --storage-encrypted --master-username saatadmin --manage-master-user-password --db-subnet-group-name saat-db-subnets --vpc-security-group-ids $v.DbSg --no-publicly-accessible --db-parameter-group-name saat-sqlserver-ex-15 --option-group-name saat-sqlserver-ex-15-og --backup-retention-period 1 --tags Key=course,Value=saatvedha-aws Key=lesson,Value=53 --query "DBInstance.DBInstanceStatus" --output text
.\Start-SqlLab.ps1 -Db saat-legacy -LocalPort 11436
sqlcmd -S "127.0.0.1,11436" -U saatadmin -C -Q "CREATE DATABASE LegacyShop;"
sqlcmd -S "127.0.0.1,11436" -U saatadmin -C -d LegacyShop -Q "CREATE TABLE dbo.Invoices (InvoiceId int IDENTITY PRIMARY KEY, Customer nvarchar(100), Total decimal(10,2)); INSERT dbo.Invoices (Customer, Total) VALUES (N'Asha', 1200.00), (N'Ravi', 860.50); SELECT SERVERPROPERTY('ProductVersion') AS version, (SELECT compatibility_level FROM sys.databases WHERE name = 'LegacyShop') AS compat;"

You should see something like this:

creating
Tunnel ready on 127.0.0.1,11436 for saatadmin (password is in SQLCMDPASSWORD for this window)
version          compat
---------------- ------
15.0.4430.1         150

This plays the part of the old instance every company seems to have: SQL Server 2019, custom groups and a database at compatibility level 150. Backups are on, so RDS can take its pre-upgrade snapshot later.

3Rehearse the upgrade on a snapshot copy

Paste this whole block. It snapshots saat-legacy, restores a test copy and upgrades that copy to the newest 2022 target, which takes about 40 minutes:

aws rds create-db-snapshot --db-instance-identifier saat-legacy --db-snapshot-identifier saat-legacy-pre --query "DBSnapshot.Status" --output text
aws rds wait db-snapshot-available --db-snapshot-identifier saat-legacy-pre
aws rds restore-db-instance-from-db-snapshot --db-instance-identifier saat-legacy-test --db-snapshot-identifier saat-legacy-pre --db-instance-class db.t3.micro --db-subnet-group-name saat-db-subnets --vpc-security-group-ids $v.DbSg --no-publicly-accessible --db-parameter-group-name saat-sqlserver-ex-15 --option-group-name saat-sqlserver-ex-15-og --manage-master-user-password --query "DBInstance.DBInstanceStatus" --output text
aws rds wait db-instance-available --db-instance-identifier saat-legacy-test
$target = aws rds describe-db-engine-versions --engine sqlserver-ex --engine-version $v19 --query "DBEngineVersions[0].ValidUpgradeTarget[?IsMajorVersionUpgrade && starts_with(EngineVersion, '16.00')].EngineVersion | [-1]" --output text
$start = Get-Date
aws rds modify-db-instance --db-instance-identifier saat-legacy-test --engine-version $target --allow-major-version-upgrade --db-parameter-group-name saat-sqlserver-ex-16 --option-group-name saat-sqlserver-ex-16-og --apply-immediately --query "DBInstance.PendingModifiedValues.EngineVersion" --output text
Start-Sleep 60
aws rds wait db-instance-available --db-instance-identifier saat-legacy-test
"upgrade took $([int]((Get-Date) - $start).TotalMinutes) minutes"

You should see something like this:

creating
creating
16.00.4275.1.v1
upgrade took 24 minutes

The copy is upgraded, and now you know production will need about the same time plus some margin. It uses the 2022 groups you built for saat-sql, so it picks up forced TLS and your backup option as well.

RDS SQL Server upgrade lab output: test copy on 2022 with compatibility level 150
Here’s the upgraded copy with its compatibility level, roughly like this.

4Test the copy, then raise the compatibility level

Paste this whole block:

.\Start-SqlLab.ps1 -Db saat-legacy-test -LocalPort 11437
sqlcmd -S "127.0.0.1,11437" -U saatadmin -C -d LegacyShop -Q "SELECT SERVERPROPERTY('ProductVersion') AS version, (SELECT compatibility_level FROM sys.databases WHERE name = 'LegacyShop') AS compat, (SELECT COUNT(*) FROM dbo.Invoices) AS invoices;"
sqlcmd -S "127.0.0.1,11437" -U saatadmin -C -Q "ALTER DATABASE LegacyShop SET QUERY_STORE = ON; ALTER DATABASE LegacyShop SET COMPATIBILITY_LEVEL = 160; SELECT name, compatibility_level FROM sys.databases WHERE name = 'LegacyShop';"

You should see something like this:

version          compat invoices
---------------- ------ --------
16.0.4275.1         150        2
name        compatibility_level
----------- -------------------
LegacyShop                  160

The engine is now 2022, but the database stayed at 150 until you changed it, as the documentation says it will. At work you’d run the app’s workload at 150 first, capture a baseline in Query Store, and then switch to 160 and compare.

RDS console for saat-legacy after the major version upgrade to SQL Server 2022 with upgrade events
saat-legacy in the RDS console after the upgrade shows engine 16.00 (SQL Server 2022), and each upgrade step is in its event log.

✅ Checkpoint: saat-sql’s maintenance window is sun:19:30-sun:20:30, saat-legacy runs 2019, the test copy runs 2022 with LegacyShop at 160, and you know how long the upgrade took.

Break It, Then Fix It

Now it’s time to upgrade “production” (saat-legacy). The first two tries fail in the same way they do for most teams.

1Break it: upgrade without a new parameter group

Try the upgrade with only the version:

aws rds modify-db-instance --db-instance-identifier saat-legacy --engine-version $target --allow-major-version-upgrade --apply-immediately

You’ll get an error like this:

An error occurred (InvalidParameterCombination) when calling the ModifyDBInstance operation: Current Parameter Group (saat-sqlserver-ex-15) is non-default. You need to explicitly specify a new Parameter Group in this case (default or custom)

A parameter group belongs to one family (sqlserver-ex-15.0), so it can’t go with the instance to 2022, and RDS won’t guess which settings you’d want there. Fix: supply a group for the new family, which you’ll do in the next step.

2Break it: the old option group

Try once more with a 2022 parameter group but without an option group:

aws rds modify-db-instance --db-instance-identifier saat-legacy --engine-version $target --allow-major-version-upgrade --db-parameter-group-name saat-sqlserver-ex-16 --apply-immediately

You’ll get an error like this:

An error occurred (InvalidParameterCombination) when calling the ModifyDBInstance operation: The option group saat-sqlserver-ex-15-og is not valid for the requested engine version. Specify an option group for major engine version 16.00.
RDS SQL Server upgrade errors: custom parameter group and option group
Here are both problems and their fixes, something like this.

Option groups are tied to a major version as well, so teams using native backup, TDE or SSRS options have to rebuild those same options in a 16.00 group before the window. Fix: pass both groups and wait for the upgrade to finish:

aws rds modify-db-instance --db-instance-identifier saat-legacy --engine-version $target --allow-major-version-upgrade --db-parameter-group-name saat-sqlserver-ex-16 --option-group-name saat-sqlserver-ex-16-og --apply-immediately --query "DBInstance.PendingModifiedValues.EngineVersion" --output text
Start-Sleep 60
aws rds wait db-instance-available --db-instance-identifier saat-legacy
aws rds describe-db-instances --db-instance-identifier saat-legacy --query "DBInstances[0].[EngineVersion,DBParameterGroups[0].DBParameterGroupName,OptionGroupMemberships[0].OptionGroupName]" --output text
aws rds describe-db-snapshots --db-instance-identifier saat-legacy --snapshot-type automated --query "DBSnapshots[].[DBSnapshotIdentifier,EngineVersion]" --output text

You should see something like this:

16.00.4275.1.v1
16.00.4275.1.v1 saat-sqlserver-ex-16    saat-sqlserver-ex-16-og
rds:saat-legacy-2026-10-20-13-41        15.00.4430.1.v1
rds:saat-legacy-2026-10-20-14-08        16.00.4275.1.v1

Production is now on 2022, and RDS kept a snapshot from just before the upgrade (still on 15.00) as your way back. Restoring that snapshot to a new instance is the only rollback you have.

Now clean up; saat-sql keeps its new maintenance window:

aws rds delete-db-instance --db-instance-identifier saat-legacy-test --skip-final-snapshot --delete-automated-backups | Out-Null
aws rds delete-db-instance --db-instance-identifier saat-legacy --skip-final-snapshot --delete-automated-backups | Out-Null
aws rds delete-db-snapshot --db-snapshot-identifier saat-legacy-pre | Out-Null
aws rds wait db-instance-deleted --db-instance-identifier saat-legacy-test
aws rds wait db-instance-deleted --db-instance-identifier saat-legacy
aws rds delete-option-group --option-group-name saat-sqlserver-ex-15-og
aws rds delete-db-parameter-group --db-parameter-group-name saat-sqlserver-ex-15
.\Stop-SqlLab.ps1

✅ Checkpoint: You fixed both upgrade errors by giving 2022 parameter and option groups, and saat-legacy is on 2022 with a 15.00 snapshot taken before. Both legacy instances, the manual snapshot and the 2019 groups are gone, and saat-sql is stopping.

This happened at work

The Sunday upgrade that ran into Monday

A retailer had planned a SQL Server 2017 to 2019 upgrade on RDS for a Sunday at 2 a.m. They’d rehearsed it on a copy a few weeks before and it had taken 25 minutes, so nobody was worried. On the night the command failed, because someone had added a custom option group with the SSRS option to the production instance after the rehearsal. Building a new 2019 option group with SSRS, its certificate and its settings ate three hours, and the upgrade itself then took its 25 minutes and finished just as the first stores were opening. Since then their checklist compares production’s parameter and option groups with the rehearsal copy the day before, and the new groups are created and checked before the window starts instead of during it.

Common mistakes and troubleshooting

MistakeWhat happensWhat to do
Ignoring the default maintenance windowRestart at a random busy timeSet a quiet window that doesn’t overlap backups
No new parameter groupInvalidParameterCombination: non-default groupCreate a group for the new family first
Old option groupUpgrade refusedRecreate the options in a group for the new major version
No rehearsal on a copyUnknown duration, surprises in productionSnapshot, restore, upgrade, time it
Raising compatibility level at oncePlan regressions on day oneTest at the old level, use Query Store, then raise
Backup retention 0No pre-upgrade snapshot, no way backKeep backups on; take a manual snapshot too

Interview questions

Click a question to open it. Each one is phrased the way an interviewer would ask it, and underneath you’ll find why they ask it and one way you could answer in your own words.

Fresher level

1. Can you explain the difference between a minor and a major upgrade on RDS SQL Server?

Why they ask this: They’re checking that you know which upgrades are routine and which ones need planning and testing.

How you might answer: A minor upgrade is a cumulative update within the same version, and RDS can put it on automatically. A major one moves you to a new version, say 2019 to 2022, and RDS never does that by itself, so you start it with --allow-major-version-upgrade in the CLI.

2. What is the maintenance window on RDS, and how would you pick a time for it?

Why they ask this: They want to see you understand when RDS can touch your instance and that you think about users and backups when you choose the time.

How you might answer: It’s the weekly slot where RDS applies pending updates like OS patches or automatic minor upgrades. I’d pick a time that’s quiet for the business, early Sunday morning for example, and I’d make sure it doesn’t overlap the backup window.

3. A major upgrade went badly. Can you roll it back?

Why they ask this: They want to know you see the risk before you start and that you know the real way back.

How you might answer: Not in place, there’s no undo. RDS takes a snapshot before the upgrade and I usually take one of my own too, so going back means restoring that snapshot to a new instance and pointing the app at it.

2–5 years experience

4. Your major upgrade fails with “Current Parameter Group is non-default”. What’s going on?

Why they ask this: They’re checking whether you know parameter groups are tied to a version family, which trips up a lot of people on their first upgrade.

How you might answer: A custom parameter group belongs to one engine family, so the old one can’t be used on the new version. I’d create a parameter group for the target family with the same settings and pass it in the upgrade command, along with an option group for the new major version.

5. You’ve upgraded RDS SQL Server to a new version. What happens to the compatibility level of the databases?

Why they ask this: They want to know you see the engine version and the database behaviour as two separate steps, and that you can change them safely.

How you might answer: They keep their old compatibility level, so queries behave the same at first. I’d let Query Store capture a baseline and only then raise the level after testing, and if a query slows down afterwards I can spot it and fix it quickly.

6. You see pending OS updates on several RDS instances. How do you handle them?

Why they ask this: They want to see you know the commands and that you’d warn people about the short failover on Multi-AZ.

How you might answer: I’d list them first with describe-pending-maintenance-actions, then either leave them for the maintenance window or apply them right away with apply-pending-maintenance-action. On Multi-AZ instances I expect a failover, so I’d tell the app team there’ll be a short blip.

Senior level

7. You find 40 RDS SQL Server instances still on 2017. How would you plan their upgrades?

Why they ask this: They want to see whether you can run an upgrade programme across many teams, with testing, waves and a rollback plan.

How you might answer: I’d start with an inventory of versions, features and parameter and option groups, and build the target groups in IaC. Every app gets a rehearsal on a snapshot copy where we note how long it takes, and then we schedule waves by how critical the apps are, use Multi-AZ to cut downtime and agree a rollback plan. Compatibility level changes we track as a separate step.

8. How would you keep RDS minor versions up to date without surprising anyone?

Why they ask this: They’re looking for a clear patch policy you can repeat, one that catches problems before they reach production.

How you might answer: I’d turn on auto minor upgrade in non-production first and have production follow a week or two later in fixed maintenance windows. Everyone gets RDS event notifications, and each production upgrade has its own change record.

Quick quiz

Q1. Which flag is needed for a major upgrade?

  1. --force
  2. --allow-major-version-upgrade
  3. --apply-later
  4. --no-reboot
Show answer

B — Major upgrades must be explicit.

Q2. Why did the first upgrade attempt fail?

  1. Wrong password
  2. Custom parameter group for the old family
  3. Express edition
  4. No snapshot
Show answer

B — Give a group for sqlserver-ex-16.0.

Q3. What happens to a database’s compatibility level after upgrade?

  1. Raised automatically
  2. Stays the same
  3. Set to 100
  4. Database is dropped
Show answer

B — You raise it yourself.

Q4. What is the rollback for a major upgrade?

  1. Downgrade command
  2. Restore the pre-upgrade snapshot
  3. Reboot
  4. Change the option group
Show answer

B — No in-place rollback.

Q5. Where do OS updates show up?

  1. CloudTrail
  2. Pending maintenance actions
  3. S3
  4. SQL error log
Show answer

B — describe-pending-maintenance-actions.

Quick recap

  • Pick a quiet maintenance window that doesn’t overlap backups.
  • Minor versions can be automatic, but a major one only starts when you start it.
  • Major upgrades need parameter and option groups for the new version.
  • Rehearse on a snapshot copy and time it, and remember that rollback means restoring the snapshot.
  • The compatibility level doesn’t change until you raise it, after testing.

Next lesson

Lesson 54: High availability: RDS Multi-AZ for SQL Server → Next you’ll watch Multi-AZ fail over, see how long it takes and find out what clients need to ride through it.

Further reading: RDS SQL Server upgrade

If you want to go further with RDS SQL Server upgrade, read Upgrading the Microsoft SQL Server DB engine and Maintaining a DB instance. The full plan for this course is on the AWS Cloud Administration course page.

Scroll to Top

This website uses cookies

We use a few cookies to keep this site working. If you allow it, we also use Google Analytics to count visits so we can improve our lessons. You can accept all, deny the optional ones, or choose what to allow.