Backups and DR for RDS SQL Server
-
Phase 0: Before you start
-
Phase 1: The foundation
-
Phase 2: Operations and security
-
Phase 3: SQL Server on AWS
-
Phase 4: Troubleshooting step by step
-
Phase 5: Final project and career
Sooner or later somebody runs a DELETE without a WHERE clause on production. With RDS SQL Server backup features that becomes a 40-minute job instead of a disaster, because automated backups let you restore to any second in the retention period and cross-Region backups cover you when a whole Region has a bad day.
You’ll set a proper retention and backup window, start copying saat-sql’s backups to Singapore, delete rows “by accident” and bring them back with point-in-time restore, and then run a real DR restore in Singapore. After that come two problems teams usually only find during their first real recovery.
| Time | You need | By the end you can |
|---|---|---|
| 150 minutes (much of it waiting for restores) | You need Lessons 42 to 51 finished (saat-sql with 100,003 orders, Start-SqlLab.ps1, Stop-SqlLab.ps1) and Windows PowerShell 5.1 on your laptop, signed in as saat-admin. It costs about USD 1 for two small extra instances running an hour or so, plus a little cross-Region transfer, and the copies get deleted at the end. | You’ll set backup retention and windows, restore to a point in time, copy lost rows back with SqlBulkCopy, replicate automated backups to another Region, run and check a DR restore, and learn the gaps that break real recoveries. |
What it is, in one line
RDS SQL Server backup uses daily snapshots plus 5-minute transaction log backups, so you can restore to any second in the retention period, in the same Region or in another one.
In Simple Words
The CCTV recording
A shop’s CCTV keeps the last seven days, so when something goes missing you can rewind to the minute before and see what was there. Point-in-time restore is that rewind, with one difference: you can’t rewind the real shop, so you get a second shop that looks just as the first one did at that minute, and you walk over, pick up what was lost and carry it back. Keeping a copy of the recordings in another city (cross-Region backups) helps if the first shop burns down, though only if you’ve practised opening that second shop.
Engineer's View
How RDS backups work
When backup retention is set to anything from 1 to 35 days, RDS takes a daily storage snapshot during the backup window and uploads transaction log backups to S3 every 5 minutes, so LatestRestorableTime is normally within 5 minutes of now.
A point-in-time restore always creates a new instance and never overwrites the one you have. Pass the subnet group, security groups, parameter group and option group yourself, or you’ll get the defaults.
Cross-Region automated backups copy snapshots and logs to another Region (from Mumbai that’s Singapore or Hyderabad, which is an opt-in Region), so you can do a point-in-time restore there. Encrypted instances need a KMS key in the destination. You pay for the cross-Region transfer and storage, and that Region needs a DB subnet group, security groups and matching parameter and option groups ready to go.
Manual snapshots stay until you delete them and can be copied or shared, which makes them handy before upgrades. AWS Backup adds backup plans, cross-Region and cross-account copies, Vault Lock and org-wide backup policies (Lesson 29).
Native .bak files (Lesson 46) cover single databases. Setting retention to 0 switches automated backups off and deletes them, so treat that change as dangerous.
How it works, step by step
This is what happens during a point-in-time restore.
1Pick a time
You pick a second between the earliest restorable time and LatestRestorableTime, ideally just before the mistake happened.
2RDS builds a new instance
RDS restores the snapshot taken before that time, replays log backups up to the exact second and brings up a new instance with its own endpoint.
3Recover what was lost
Copy the missing rows back into production, or if the damage is widespread, move the app over to the restored instance.
4Choose the right protection
Each option protects you from a different kind of disaster:
Until you’ve restored a backup, you’re only hoping it works, so put a restore test on the calendar in both Regions.
✅ Checkpoint: You can explain how snapshots and 5-minute log backups make point-in-time restore possible, why it creates a new instance, and what cross-Region backups add.
Hands-on lab: undo a DELETE and restore saat-sql in Singapore
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:
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.ps11Set retention and start cross-Region backups
Paste this whole block. It raises retention from 1 to 7 days, moves the backup window to midnight India time and starts copying backups to Singapore:
aws rds modify-db-instance --db-instance-identifier saat-sql --backup-retention-period 7 --preferred-backup-window 18:30-19:00 --apply-immediately --query "DBInstance.DBInstanceStatus" --output text
Start-Sleep 30
aws rds wait db-instance-available --db-instance-identifier saat-sql
$srcArn = aws rds describe-db-instances --db-instance-identifier saat-sql --query "DBInstances[0].DBInstanceArn" --output text
$drKey = aws kms describe-key --key-id alias/aws/rds --region ap-southeast-1 --query KeyMetadata.Arn --output text
aws rds start-db-instance-automated-backups-replication --region ap-southeast-1 --source-region ap-south-1 --source-db-instance-arn $srcArn --kms-key-id $drKey --backup-retention-period 7 --query "DBInstanceAutomatedBackup.Status" --output text
aws rds describe-db-instances --db-instance-identifier saat-sql --query "DBInstances[0].[BackupRetentionPeriod,PreferredBackupWindow,LatestRestorableTime]" --output textYou should see something like this:
modifying
pending
7 18:30-19:00 2026-10-20T10:55:00+00:0018:30 UTC is midnight in India, when SaatShop is quiet, and changing retention from one non-zero value to another causes no outage. The Singapore copy needs a while to build its first snapshot, and you’ll use it in step 4.
2Make the mistake, then restore to just before it
Paste this whole block. It notes the time, deletes nearly every order and then restores a copy from before the DELETE, which takes about 30 minutes:
Start-Sleep 60
$t = (Get-Date).ToUniversalTime().ToString('yyyy-MM-ddTHH:mm:ssZ')
Start-Sleep 60
sqlcmd -S "127.0.0.1,11433" -U saatadmin -C -d SaatShop -Q "DELETE dbo.Orders WHERE OrderId > 100; SELECT COUNT(*) AS left_over FROM dbo.Orders;"
do { Start-Sleep 60; $lrt = aws rds describe-db-instances --db-instance-identifier saat-sql --query "DBInstances[0].LatestRestorableTime" --output text } until ([datetime]$lrt -gt [datetime]$t)
aws rds restore-db-instance-to-point-in-time --source-db-instance-identifier saat-sql --target-db-instance-identifier saat-sql-pitr --restore-time $t --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-16 --option-group-name saat-sqlserver-ex-16-og --manage-master-user-password --tags Key=course,Value=saatvedha-aws Key=lesson,Value=52 --query "DBInstance.DBInstanceStatus" --output text
aws rds wait db-instance-available --db-instance-identifier saat-sql-pitr
"restored to $t"You should see something like this:
left_over
-----------
100
creating
restored to 2026-10-20T11:02:41ZProduction lost 99,903 orders, and saat-sql-pitr is a copy of saat-sql as it stood a minute before the DELETE. Because the restore got the same subnet group, security group, parameter group and option group, it’s set up just like production.
3Copy the lost rows back
Paste this whole block. It opens a second tunnel to the copy and streams the missing rows into saat-sql with SqlBulkCopy, keeping their original IDs:
.\Start-SqlLab.ps1 -Db saat-sql-pitr -LocalPort 11435
function Get-SqlPw([string]$Db) {
$a = aws rds describe-db-instances --db-instance-identifier $Db --query "DBInstances[0].MasterUserSecret.SecretArn" --output text
(aws secretsmanager get-secret-value --secret-id $a --query SecretString --output text | ConvertFrom-Json).password
}
function New-Cs([int]$Port, [string]$Db) {
$b = New-Object System.Data.SqlClient.SqlConnectionStringBuilder
$b['Data Source'] = "127.0.0.1,$Port"; $b['Initial Catalog'] = 'SaatShop'; $b['User ID'] = 'saatadmin'; $b['Password'] = (Get-SqlPw $Db)
$b['Encrypt'] = $true; $b['TrustServerCertificate'] = $true
$b.ConnectionString
}
function Get-Rows([int]$Port) {
$db = if ($Port -eq 11433) { 'saat-sql' } else { 'saat-sql-pitr' }
$cn = New-Object System.Data.SqlClient.SqlConnection (New-Cs $Port $db); $cn.Open()
$cm = $cn.CreateCommand(); $cm.CommandText = 'SELECT COUNT(*) FROM dbo.Orders'; $n = $cm.ExecuteScalar(); $cn.Close(); $n
}
"saat-sql $(Get-Rows 11433) pitr $(Get-Rows 11435)"
$src = New-Object System.Data.SqlClient.SqlConnection (New-Cs 11435 'saat-sql-pitr'); $src.Open()
$cmd = $src.CreateCommand(); $cmd.CommandText = 'SELECT OrderId, Customer, Amount, CreatedAt FROM dbo.Orders WHERE OrderId > 100'
$rdr = $cmd.ExecuteReader()
$bulk = New-Object System.Data.SqlClient.SqlBulkCopy((New-Cs 11433 'saat-sql'), [System.Data.SqlClient.SqlBulkCopyOptions]::KeepIdentity)
$bulk.DestinationTableName = 'dbo.Orders'; $bulk.BulkCopyTimeout = 600
foreach ($col in 'OrderId', 'Customer', 'Amount', 'CreatedAt') { [void]$bulk.ColumnMappings.Add($col, $col) }
$bulk.WriteToServer($rdr); $rdr.Close(); $src.Close()
"saat-sql $(Get-Rows 11433)"You should see something like this:
Tunnel ready on 127.0.0.1,11435 for saatadmin (password is in SQLCMDPASSWORD for this window)
saat-sql 100 pitr 100003
saat-sql 100003All 99,903 rows are back with their original OrderIds, and nothing written to production after the mistake was lost. DBAs use this “restore aside, copy back” approach whenever only part of the data is damaged.


4Run a DR restore in Singapore
Paste this whole block. It waits until the Singapore copy is ready to restore and then restores it, so allow up to an hour:
do { Start-Sleep 120; $ab = aws rds describe-db-instance-automated-backups --region ap-southeast-1 --db-instance-identifier saat-sql --query "DBInstanceAutomatedBackups[0].[DBInstanceAutomatedBackupsArn,Status,RestoreWindow.LatestTime]" --output text; $ab } until ($ab -match 'replicating' -and $ab -notmatch 'None$')
$abArn = ($ab -split '\s+')[0]
aws rds restore-db-instance-to-point-in-time --region ap-southeast-1 --source-db-instance-automated-backups-arn $abArn --target-db-instance-identifier saat-sql-dr --use-latest-restorable-time --db-instance-class db.t3.micro --no-publicly-accessible --manage-master-user-password --tags Key=course,Value=saatvedha-aws Key=lesson,Value=52 --query "DBInstance.DBInstanceStatus" --output text
aws rds wait db-instance-available --region ap-southeast-1 --db-instance-identifier saat-sql-dr
aws rds describe-db-instances --region ap-southeast-1 --db-instance-identifier saat-sql-dr --query "DBInstances[0].[DBInstanceStatus,Endpoint.Address,StorageEncrypted]" --output textYou should see something like this:
arn:aws:rds:ap-southeast-1:111122223333:auto-backup:ab-abc123def456 replicating 2026-10-20T11:58:00+00:00
creating
available saat-sql-dr.c7d8e9f0a1b2.ap-southeast-1.rds.amazonaws.com TrueYou now have a working copy of saat-sql in another country, restored from replicated backups and encrypted with Singapore’s key, with an RPO of minutes. In a real DR you’d also need the app, DNS and networking in that Region.

✅ Checkpoint: saat-sql keeps 7 days of backups, saat-sql-pitr was restored from before the DELETE, saat-sql is back to 100,003 orders and saat-sql-dr is available in ap-southeast-1.
Break It, Then Fix It
These are two problems teams usually discover halfway through a real recovery.
1Break it: restore to “now”
Ask for a restore to the current time:
$now = (Get-Date).ToUniversalTime().ToString('yyyy-MM-ddTHH:mm:ssZ')
aws rds restore-db-instance-to-point-in-time --source-db-instance-identifier saat-sql --target-db-instance-identifier saat-sql-now --restore-time $now --db-subnet-group-name saat-db-subnetsYou’ll get an error like this:
An error occurred (InvalidRestoreFault) when calling the RestoreDBInstanceToPointInTime operation: The restore time must be before the latest restorable time.Logs reach S3 every 5 minutes, so the latest few minutes can’t be restored yet, and in an incident people often type in the time the alert fired, which can be too recent. Fix: check LatestRestorableTime and pick a time at or before it, or use --use-latest-restorable-time:
aws rds describe-db-instances --db-instance-identifier saat-sql --query "DBInstances[0].LatestRestorableTime" --output textYou should see something like this:
2026-10-20T12:05:00+00:002Break it: the DR copy isn’t configured like production
Compare the groups on the Singapore copy with production:
aws rds describe-db-instances --db-instance-identifier saat-sql --query "DBInstances[0].[DBParameterGroups[0].DBParameterGroupName,OptionGroupMemberships[0].OptionGroupName]" --output text
aws rds describe-db-instances --region ap-southeast-1 --db-instance-identifier saat-sql-dr --query "DBInstances[0].[DBParameterGroups[0].DBParameterGroupName,OptionGroupMemberships[0].OptionGroupName]" --output textYou’ll get something like this:
saat-sqlserver-ex-16 saat-sqlserver-ex-16-og
default.sqlserver-ex-16.0 default:sqlserver-ex-16-00
The DR copy came up with default groups because your custom ones only exist in Mumbai. That means TLS isn’t forced, ad hoc plan caching is off and native backups wouldn’t work, and nobody notices until an auditor or an app complains, usually in the middle of a real DR.
Fix: create the same parameter group in Singapore, attach it and reboot. In real life you’d have built these ahead of time with CloudFormation in both Regions, along with the option group:
'[{"ParameterName":"rds.force_ssl","ParameterValue":"1","ApplyMethod":"pending-reboot"},{"ParameterName":"optimize for ad hoc workloads","ParameterValue":"1","ApplyMethod":"immediate"}]' | Set-Content dr-params.json
aws rds create-db-parameter-group --region ap-southeast-1 --db-parameter-group-name saat-sqlserver-ex-16 --db-parameter-group-family sqlserver-ex-16.0 --description "Same as Mumbai" | Out-Null
aws rds modify-db-parameter-group --region ap-southeast-1 --db-parameter-group-name saat-sqlserver-ex-16 --parameters file://dr-params.json | Out-Null
aws rds modify-db-instance --region ap-southeast-1 --db-instance-identifier saat-sql-dr --db-parameter-group-name saat-sqlserver-ex-16 --apply-immediately | Out-Null
Start-Sleep 60
aws rds wait db-instance-available --region ap-southeast-1 --db-instance-identifier saat-sql-dr
aws rds reboot-db-instance --region ap-southeast-1 --db-instance-identifier saat-sql-dr | Out-Null
Start-Sleep 60
aws rds wait db-instance-available --region ap-southeast-1 --db-instance-identifier saat-sql-dr
aws rds describe-db-instances --region ap-southeast-1 --db-instance-identifier saat-sql-dr --query "DBInstances[0].DBParameterGroups[0].[DBParameterGroupName,ParameterApplyStatus]" --output textYou should see something like this:
saat-sqlserver-ex-16 in-syncNow clean up. saat-sql keeps its 7-day retention, and the copies, the replication and the Singapore parameter group are removed:
aws rds delete-db-instance --db-instance-identifier saat-sql-pitr --skip-final-snapshot --delete-automated-backups | Out-Null
aws rds delete-db-instance --region ap-southeast-1 --db-instance-identifier saat-sql-dr --skip-final-snapshot --delete-automated-backups | Out-Null
aws rds stop-db-instance-automated-backups-replication --region ap-southeast-1 --source-db-instance-arn $srcArn | Out-Null
aws rds wait db-instance-deleted --region ap-southeast-1 --db-instance-identifier saat-sql-dr
Start-Sleep 120
$abArn = aws rds describe-db-instance-automated-backups --region ap-southeast-1 --db-instance-identifier saat-sql --query "DBInstanceAutomatedBackups[0].DBInstanceAutomatedBackupsArn" --output text
if ($abArn -and $abArn -ne 'None') { aws rds delete-db-instance-automated-backup --region ap-southeast-1 --db-instance-automated-backups-arn $abArn | Out-Null }
aws rds delete-db-parameter-group --region ap-southeast-1 --db-parameter-group-name saat-sqlserver-ex-16
Remove-Item dr-params.json
.\Stop-SqlLab.ps1 -Db saat-sql-pitr -KeepDbRunning
.\Stop-SqlLab.ps1✅ Checkpoint: You fixed a restore time that was too recent using LatestRestorableTime, and a misconfigured DR copy with a matching parameter group. saat-sql-pitr, saat-sql-dr, the replicated backups and the Singapore parameter group are deleted, and saat-sql is stopping with 7-day retention.
This happened at work
The restore that took two days instead of two hours
A payroll company had cross-Region backups for its RDS SQL Server databases and a DR plan written down. When a bad release corrupted data in Mumbai, they decided to restore from the replicated backups in the DR Region.
The restore itself only took 40 minutes, and that’s when the real trouble started. There was no DB subnet group in that Region and no security groups for the app, the default parameter group didn’t force TLS so the app’s driver wouldn’t connect, and there was no option group for the SSIS packages they depended on.
Rebuilding by hand what should have been ready took two days. These days all of it lives in CloudFormation for both Regions, and they run a DR restore test every quarter with a timer on the wall.
Common mistakes and troubleshooting
| Mistake | What happens | What to do |
|---|---|---|
| Retention left at 1 day | Mistakes found on Monday can’t be undone | 7 to 35 days for production |
| Restoring without groups | The copy comes up with defaults | Pass the subnet, SG, parameter and option groups |
| Picking a time after LatestRestorableTime | InvalidRestoreFault | Check LatestRestorableTime first |
| DR Region not prepared | Hours or days spent rebuilding networking and groups | IaC for both Regions, tested every quarter |
| Setting retention to 0 | The automated backups are deleted | Never do it on production, and protect it with SCPs |
| Never testing restores | Backups that fail when you need them | Scheduled restore tests with the times measured |
Interview questions
Click a question to open it. Each one is worded the way an interviewer would ask it, and underneath you’ll find why they ask and one way you could answer in your own words.
Fresher level
1. Can you explain in simple words what point-in-time restore means on RDS?
Why they ask this: They want to check you understand how RDS backups work underneath, not just that there’s a restore button.
How you might answer: It lets you restore a database to any second inside the retention window, which RDS manages by combining the daily snapshot with the transaction log backups it takes every 5 minutes.
So if something breaks at 3:10, I can go back to 3:09.
2. If you do a point-in-time restore, what happens to the instance that’s running now?
Why they ask this: The restore doesn’t behave the way many people expect, and they want to be sure it won’t surprise you in an incident.
How you might answer: Nothing happens to it, because a point-in-time restore always creates a new instance with a new endpoint.
So I either point the app at the new endpoint or copy the data I need back to the original.
3. A manager asks you to keep automated RDS backups for a full year. What would you tell them?
Why they ask this: They want to see you know the retention limit and can suggest the right option when a request goes beyond it.
How you might answer: I’d tell them automated backups can only be kept for 35 days, so for a year we’d need manual snapshots or a plan in AWS Backup.
I’d go with AWS Backup, since it takes care of the schedule and the deletion for us.
2–5 years experience
4. A user deleted some rows by mistake two hours ago. Walk me through how you’d get them back.
Why they ask this: They want a calm, safe recovery that doesn’t overwrite good data written since the mistake.
How you might answer: I’d get the exact time of the delete from the app logs, then restore a new instance to just before it with the same parameter, option and security groups.
Then I’d compare the data and copy only the missing rows back with SqlBulkCopy, a native backup or SSIS, check the result, and delete the restored copy.
5. What’s the difference between cross-Region automated backups and simply copying snapshots to another Region?
Why they ask this: They want to know you understand what each option gives you in a real disaster, and above all how much data you could lose.
How you might answer: Cross-Region automated backups copy both the snapshots and the transaction logs continuously, so I can do a point-in-time restore in the DR Region.
A snapshot copy only gives me the moment the snapshot was taken, so anything written after that could be lost.
6. Your team says DR is ready because backups go to another Region. What else would you check is already built there?
Why they ask this: A lot of DR plans fail here, so they want to see you think about everything the database needs to run and not only the data.
How you might answer: I’d check the VPC, subnets, DB subnet group and security groups exist there, along with the parameter and option groups, and that the KMS keys and secrets are in that Region as well.
The app infrastructure and DNS failover need to be ready too. Ideally it’s all built from the same IaC as production so nothing gets forgotten.
Senior level
7. Design backup and DR for a payments database where you can lose at most 5 minutes of data and must be back within an hour.
Why they ask this: They want to see you map RPO and RTO onto real AWS features, and that you include testing and protecting the backups themselves.
How you might answer: Multi-AZ would handle local failures, with 35 days of retention. For a Region failure I’d use cross-Region automated backups, or a cross-Region read replica where that’s supported.
AWS Backup would add copies in another account with Vault Lock, the DR Region would be built from IaC, and we’d run timed DR tests every quarter using written runbooks.
8. How would you protect your database backups from ransomware or a rogue admin?
Why they ask this: Backups are often the first thing attackers go after, so they want to see you plan for threats from inside as well as outside.
How you might answer: I’d use AWS Backup Vault Lock in compliance mode so nobody can delete the backups early, with copies going to a separate account.
I’d also add SCPs that deny backup deletion and retention changes, tight KMS key policies, and alerts whenever someone touches a backup setting.
Quick quiz
Q1. How often does RDS upload transaction log backups?
- Every hour
- Every 5 minutes
- Daily
- Never
Show answer
B: that’s why LatestRestorableTime runs a few minutes behind.
Q2. What does point-in-time restore create?
- An overwrite
- A new instance
- A .bak file
- A snapshot only
Show answer
B: you recover from the copy.
Q3. Why did restoring to “now” fail?
- No permission
- It was after LatestRestorableTime
- Wrong edition
- No KMS key
Show answer
B: the last few minutes aren’t restorable yet.
Q4. Why did saat-sql-dr have default groups?
- A bug
- Custom groups didn’t exist in Singapore
- Express edition
- Encryption
Show answer
B: groups belong to one Region.
Q5. Which tool kept the original OrderIds when copying back?
- sqlcmd
- SqlBulkCopy with KeepIdentity
- Excel
- DMS
Show answer
B: KeepIdentity keeps the identity values.
Quick recap
- Automated backups plus 5-minute logs give you point-in-time restore for 1 to 35 days.
- PITR creates a new instance, so pass every group explicitly.
- Copy back only what was lost, or move over to the restored copy.
- Cross-Region automated backups protect you against Region problems.
- Get the DR Region ready and tested before you need it.
Next lesson
Lesson 53: Patching and upgrades for RDS SQL Server → Next you’ll manage maintenance windows and minor versions and test a major upgrade on a snapshot copy.
Further reading: RDS SQL Server backup
Want to go deeper into RDS SQL Server backup? Read Restoring a DB instance to a specified time and Replicating automated backups to another AWS Region. You can also see the full plan for this course on the AWS Cloud Administration course page.
