Skip to main content

Backup, Restore, PITR & LTR

Backup and restore is not the same as HA/DR — it's your last line of defense when everything else fails. HA/DR keeps you running during failures. Backup/restore recovers you from data corruption, accidental deletion, compliance needs, and disasters where HA/DR can't help.

Why Backup ≠ HA/DR

ScenarioHA/DR Helps?Backup/Restore Helps?
Server hardware failure❌ (too slow)
Region outage✅ (Failover Groups)✅ (Geo-restore)
Accidental DELETE / DROP TABLE❌ (replicates the mistake)✅ (PITR)
Data corruption❌ (corruption replicates)✅ (restore pre-corruption point)
Ransomware / malicious change❌ (encrypted data replicates)✅ (restore clean backup)
Compliance (retain 7 years)✅ (LTR)
Dev/test environment clone✅ (restore copy)
🎯 Exam Focus

DP-300 trap: Many exam questions describe a corruption or accidental deletion scenario and offer Failover Groups as an option. Failover Groups replicate corruption too — they protect against infrastructure failure, not data-level mistakes. The answer is always PITR or backup restore.

What Microsoft Manages vs What You Manage

AspectAzure SQL DBSQL MISQL on VM
Full backups✅ Auto (weekly)✅ Auto (weekly)❌ You configure
Differential backups✅ Auto (12-24h)✅ Auto (12-24h)❌ You configure
Log backups✅ Auto (5-10 min)✅ Auto (5-10 min)❌ You configure
Backup storage✅ Managed✅ Managed❌ You configure
Encryption at rest✅ Auto (TDE)✅ Auto (TDE)❌ You configure
Retention periodYou set (7-35 days)You set (7-35 days)You manage entirely
LTR policiesYou configureYou configureYou manage (backup to Blob)
Backup verification✅ Auto✅ Auto❌ You run RESTORE VERIFYONLY
Point-in-time restore✅ Built-in✅ Built-in❌ You restore manually
🏢 Real-World DBA Note

The biggest PaaS advantage: On Azure SQL DB and MI, you will never lose a backup and never need to write a backup script. Microsoft takes full, differential, and log backups automatically. Your only job is to set the retention period and LTR policy.

Automated Backup Schedule

Backup TypeFrequencyYou Configure?Purpose
FullWeekly❌ AutomaticBase for all restores
DifferentialEvery 12-24 hours❌ AutomaticChanges since last full
Transaction LogEvery 5-10 minutes❌ AutomaticPoint-in-time granularity

How PITR Uses These Backups

To restore to a specific point in time, Azure:

  1. Restores the most recent full backup before that point
  2. Applies the most recent differential after that full
  3. Replays transaction log backups up to the exact second you specified

This is why log backups every 5-10 minutes give you RPO of seconds — you can restore to any point within the retention window.

Point-in-Time Restore (PITR)

PITR is the most commonly used restore method for Azure SQL DB and MI.

Key Facts

AspectDetail
Retention7-35 days (configurable, default 7)
GranularityAny second within the retention window
ResultCreates a NEW database (never overwrites original)
SpeedMinutes to hours (depends on database size)
CostNew database billed at the same tier
Cross-region❌ Same region only (use Geo-restore for cross-region)
⚠️ Watch Out

PITR creates a NEW database — it never overwrites the existing one. This catches many exam takers. After PITR, you have both the original (possibly corrupted) and the restored copy. You must manually swap them (rename, update connection strings).

PITR Scenarios

ScenarioAction
"Restore to 3 hours ago"PITR to GETDATE() - 3 hours → new DB
"Undo accidental DELETE"PITR to just before the DELETE → extract missing rows → insert back
"Clone for dev/test"PITR to current time → rename for dev use
"Corrupted stored procedure"PITR to before corruption → script the correct proc → apply to production

Long-Term Retention (LTR)

For compliance and regulatory requirements beyond 35 days:

AspectDetail
Max retentionUp to 10 years
StorageAzure Blob Storage (RA-GRS by default)
PolicyWeekly (W), Monthly (M), Yearly (Y) retention
CostPer GB stored (separate from DB billing)
RestoreCreates a new database from LTR backup

LTR Policy Examples

PolicyWhat It KeepsUse Case
W=4Last 4 weekly backupsGeneral disaster recovery
M=12Last 12 monthly backupsQuarterly compliance audits
Y=7, WeekOfYear=1Last 7 yearly (first week of year)7-year regulatory retention
W=4, M=12, Y=10Weekly + Monthly + YearlyFull compliance coverage
🎯 Exam Focus

LTR stores full backups only — no differentials or log backups. You cannot do point-in-time restore from an LTR backup. LTR gives you the database state at the time of that weekly backup snapshot.

Backup Storage Redundancy

OptionCopiesProtectionCostUse Case
LRS3 in one datacenterDisk/rack failureLowestDev/test
ZRS3 across availability zonesZone failureMediumProduction (same region)
GRS6 (3 local + 3 paired region)Region failureHigherProduction (cross-region DR)
RA-GRS6 + read access to secondaryRegion failure + readHighestCritical compliance
⚠️ Watch Out

Backup storage redundancy can only be set at database creation time (or within a short window). You cannot change from LRS to GRS after the fact. Choose based on your DR requirements from day one.

Restore Options by Platform

Azure SQL Database

Restore TypeRPORTOCreates New DB?Cross-Region?
PITRSecondsMinutes-hours✅ Yes❌ Same region
Deleted DB restoreTo deletion timeMinutes✅ Yes❌ Same region
Geo-restoreUp to 1 hourHours✅ Yes✅ Any region
LTR restoreWeekly snapshotHours✅ Yes✅ Any region
CopyCurrent pointMinutes✅ Yes❌ Same server

SQL Managed Instance

Restore TypeRPORTONotes
PITRSecondsMinutes-hoursSame as SQL DB
Cross-instance restoreSecondsMinutesRestore to different MI
Geo-restoreUp to 1 hourHoursFrom GRS backup
LTR restoreWeeklyHoursSame as SQL DB
Native backup to URLYou controlYou controlManual backup to Azure Blob

SQL Server on VM

Restore TypeRPORTONotes
Native BACKUP/RESTOREYou controlYou controlFull control, full responsibility
Backup to Azure BlobYou controlHoursBACKUP TO URL
Automated Backup (IaaS Agent)ConfigurableHoursIf SQL IaaS Agent configured
Azure Backup for SQL VM15 minHoursManaged backup vault
File-level backup (Azure Backup)DailyHoursVM-level backup (not SQL-aware)
🎯 Exam Focus

Azure Backup for SQL Server in Azure VM is a separate service from SQL Server's native backup. It provides centralized backup management, 15-minute RPO, long-term retention in Recovery Services Vault, and no backup scheduling scripts needed.

RPO and RTO Explained

TermWhat It MeansBusiness Question
RPO (Recovery Point Objective)How much data can you afford to lose"How old can the restored data be?"
RTO (Recovery Time Objective)How long can you be down"How fast do we need to be back online?"

RPO/RTO by Solution

SolutionRPORTOCost
Automated backups (PITR)5-10 minHoursFree (included)
Geo-restoreUp to 1 hourHoursFree (included with GRS)
Active Geo-Replication< 5 seconds~30 seconds💰 (secondary DB cost)
Failover Groups< 5 secondsGrace period + ~30s💰 (secondary DB cost)
BC tier local replica0 (synchronous)< 10 seconds💰💰 (BC tier cost)
LTR backupWeeklyHours💰 (storage cost)
🏢 Real-World DBA Note

The cost-RPO tradeoff: Automated backups (free) give you hours of RTO and minutes of RPO. Failover Groups (extra DB cost) give you seconds of both. Choose based on your business requirements — not every database needs sub-second RPO.

Common Misunderstandings

MisconceptionReality
"PITR overwrites my database"❌ PITR creates a NEW database. Original is untouched.
"I can restore to any point from LTR"❌ LTR only stores weekly full backups. No point-in-time granularity.
"Geo-replication protects against accidental DELETE"❌ Deletion replicates instantly. Use PITR instead.
"I can change backup redundancy anytime"❌ Only at creation (or within a short window).
"Azure SQL DB backups are my responsibility"❌ Fully automated. You only set retention + LTR policy.
"Backup retention of 7 days means 7 recovery points"❌ You can restore to ANY SECOND within those 7 days.
"PITR can restore to a different region"❌ Same region only. Use Geo-restore for cross-region.

Backup Strategy Decision Matrix

RequirementSolution
"Recover from accidental deletion"PITR (within 7-35 day retention)
"Recover from data corruption"PITR (restore to before corruption)
"Keep backups for 5+ years"LTR policy (W/M/Y)
"Cross-region disaster recovery"Geo-restore (hours RTO) or Failover Groups (seconds)
"Clone database for dev/test"PITR to current time or database copy
"Recover a deleted database"Deleted database restore (within retention)
"Restore to on-premises"Export BACPAC or native backup (VM/MI only)

Flashcards

Does PITR overwrite the original database?
Click to reveal answer
No. PITR always creates a NEW database. The original remains untouched. You must manually handle swapping (rename, update connections).
1 / 10

Quiz

Q1/5
0 correct
A developer accidentally runs DELETE FROM Customers on an Azure SQL Database. No WHERE clause. What should you do?