SQL Server Backup and Restore

Home

Overview

Backup and restore are fundamental operations for protecting your SQL Server data. This documentation provides a comprehensive guide to the concepts, commands, and best practices for safeguarding your databases.

Learn About Full Backups

Key Concepts

Backup Process

SQL Server creates a backup by reading the pages of the database and writing them to a backup set. The process can be executed via T‑SQL, SQL Server Management Studio (SSMS), or PowerShell.

BACKUP DATABASE [AdventureWorks]
TO DISK = N'C:\Backups\AdventureWorks_Full.bak'
WITH INIT, COMPRESSION, STATS = 10;

Restore Process

Restoring a database involves applying one or more backup sets to bring the database to a desired point in time.

RESTORE DATABASE [AdventureWorks]
FROM DISK = N'C:\Backups\AdventureWorks_Full.bak'
WITH REPLACE, RECOVERY;

Further Reading