To restore a SQL Server database, you run the RESTORE DATABASE statement (or use SQL Server Management Studio's Restore wizard) against a backup file, specifying a unique database name if you're overwriting or cloning, and you must have the sysadmin or dbcreator role. The one condition that trips people up most: you need to know whether the backup contains a full, differential, or log chain, because a full backup alone restores to the moment it was taken, not to the present.
Restoring is straightforward when the backup is clean and the target server matches. It gets complicated when the file is corrupt, the version is newer than the target instance, the database is in use, or you need point-in-time recovery. This guide walks through the whole workflow—prerequisites, the SSMS path, T-SQL at several levels, verification, and the failures worth planning for—so you can restore confidently whether it's a dev refresh or a production recovery.
What you need before you start
The prerequisites matter more than the clicks. Get these right and the restore usually succeeds first time.
Permissions and access. Restoring a database requires membership in the sysadmin or dbcreator fixed server roles (or equivalent permissions). If you're restoring to a different server, your login needs those rights there, not just on the source.
Compatible versions and editions. You cannot restore a backup taken on a newer major version (say, SQL Server 2022) onto an older instance (2019). The reverse works: older backups restore to newer engines. Editions also constrain you—Enterprise features like certain compression or encryption may not be usable on Standard/Express targets.
The backup file and its type. Identify whether you have a full backup (.bak), a differential (.dif), or a transaction log (.trn). A restore of a full backup gets you to the backup's completion time. To reach a later point you need the differential and every log backup in the chain since the last full or differential.
Free disk space. A restore consumes the size of the data and log files, not just the backup file size. Estimate from RESTORE HEADERONLY and RESTORE FILELISTONLY, and allow headroom for the transaction log to grow during recovery.
Target naming and location. Decide whether you're restoring in place (overwriting the existing database) or as a new copy (a common dev/prod clone). If the file paths on the backup don't exist on the target, you must redirect them with WITH MOVE.
A quiesced target. Nobody should be connected to a database you're about to overwrite. SSMS will offer to close connections; in T-SQL you'd set the database to SINGLE_USER first (more on that below).
Restoring through SQL Server Management Studio
SSMS is the friendliest path for a one-off restore, and its wizard exposes most of what T-SQL does.
1: Connect to the target instance in Object Explorer. 2: Right-click Databases → Restore Database… 3: Choose the source. Pick "Device" and browse to your .bak file, or select a database from a connected server's backup history. The wizard reads the backup header and shows the backups contained in the file. 4: Name the destination. Type a new database name if you're cloning; use the existing name if you're overwriting. 5: Check the restore plan. On the Files page, confirm the "Restore As" paths are valid on this server. If they aren't, edit them—this is the WITH MOVE equivalent. 6: Choose recovery state. Under Options, "Leave the database ready to use by rolling back uncommitted transactions" is the normal choice. "Leave the database non-operational" and "Read-only" appear in log-shipping and standby scenarios. If you plan to apply more log backups, you may need NORECOVERY. 7: Verify before executing. The Script button at the top produces the T-SQL the wizard will run—review it, especially the MOVE clauses and recovery option. 8: Execute and watch the Messages tab for success or the specific error.
If the wizard's "Restore" button stays greyed out, it's usually because the destination name duplicates an existing database or the backup file isn't accessible to the service account. Those are the first two things to check.
The T-SQL approach, step by step
T-SQL gives you control and repeatability, which matters for scheduled restores and scripts.
Step 1: Inspect the backup. Run RESTORE HEADERONLY FROM DISK = 'D:\backups\Sales.bak';. This returns the backup set metadata: database name, backup type, server version, and the position number you'll need if the file holds multiple backups. Then RESTORE FILELISTONLY FROM DISK = 'D:\backups\Sales.bak'; lists the logical file names and physical paths—you need the logical names for WITH MOVE.
Step 2: Restore a full backup, overwriting in place. The simplest form:
REPLACE lets you overwrite an existing database; without it, the restore fails if the target exists.
Step 3: Restore as a new copy with relocated files. Use this for dev refreshes where the source server's paths differ:
The logical names in quotes come from FILELISTONLY. If the paths are wrong, you get a clear "file cannot be restored" error, which is reversible—fix the MOVE and rerun.
Step 4: Applying differential and logs. If you're restoring a chain, every intermediate step needs NORECOVERY so the database stays in restoring state:
Only the final statement uses RECOVERY. A database left in NORECOVERY state is unusable for queries until you restore WITH RECOVERY.
Step 5: Point-in-time recovery. With the full recovery model and an unbroken log chain, you can stop at a moment:
STOPAT rolls forward only committed transactions before that time. It can't recover past a missing log backup—that's why chain completeness matters.
Restoring from a .bak file you were handed
A surprising number of restore requests start with "here's a .bak file, get it running." That file may be zipped, renamed, password-protected by an archiver, or a native backup with multiple backup sets inside.
First verify it's actually a SQL Server backup: open it with RESTORE HEADERONLY. If that fails with "The media family on device is incorrectly formed," the file either isn't a SQL Server backup or is corrupt—don't trust the file name. If it opens, note the Position column. To restore a specific backup set from a multi-set file, add WITH FILE = n where n is the position.
If the .bak was compressed by SQL Server's own backup compression, no extra step is needed—the engine handles it transparently. If someone dropped it into a ZIP, extract first; the engine won't read a ZIP directly. And if the backup was taken with encryption, you need the certificate or asymmetric key on the target server before RESTORE will succeed, which is a common wall in cross-server migrations.
Validating the backup before you commit
A restore that runs for forty minutes and then fails on corruption is worse than one that fails in ten seconds. Use these checks up front:
RESTORE VERIFYONLY FROM DISK = '...\Sales.bak'; confirms the backup set is complete and readable, though it does not guarantee every page is recoverable. RESTORE HEADERONLY and FILELISTONLY confirm the version, backup type, and file layout. Check whether the backup type supports your plan: a COPY_ONLY full backup can't anchor a differential or log chain in the usual way. For suspected media problems, WITH CHECKSUM on the restore (if the backup was taken with checksums) will surface page-level corruption as it reads.
These are cheap and reversible. Under pressure, people skip them; that's when the surprises land.
Verifying the restore succeeded
A "successfully processed" message is necessary, not sufficient. After the restore:
1: Confirm the state. SELECT name, state_desc FROM sys.databases WHERE name='Sales'; should show ONLINE (or RESTORING if you deliberately stopped mid-chain). 2: Check the recovery point. SELECT TOP(1) backup_finish_date FROM msdb.dbo.backupset WHERE database_name='Sales' ORDER BY backup_finish_date DESC; tells you the last backup applied—not necessarily "now." For a restored copy, check a known table's max timestamp against expectations. 3: Run DBCC CHECKDB. On non-production targets and especially for backups of uncertain provenance, DBCC CHECKDB('Sales') scans for corruption. It's expensive on large databases; schedule it accordingly. 4: Spot-check application tables. Query a few rows against known counts or recent dates. This catches the "right backup, wrong day" error. 5: Confirm ownership and permissions. If you restored to a different server, logins may be orphaned from users. ALTER USER [appuser] WITH LOGIN = [applogin]; repairs a common post-restore issue.
Overwriting a live database and other common failures
The database is in use. RESTORE DATABASE fails if another connection holds it. In T-SQL, set it to single-user just before the restore:
ROLLBACK IMMEDIATE kills active transactions—that's why this belongs in a maintenance window, not a midday "quick fix." Always return to MULTI_USER afterward; leaving a production database in SINGLE_USER is a classic self-inflicted outage.
File path errors. "Operating system error 3 (The system cannot find the path specified)" almost always means the backup's original paths don't exist on this server. Fix with WITH MOVE as shown above; you can't always simply create the directory, because the SQL Server service account must have access to it.
Version mismatch. "The database was backed up on a server running version X. That version is incompatible with this server, which is running version Y." The only real fixes are to restore on a version at least as new or export the data another way.
Restore interrupted or times out. Large restores can exceed client or proxy timeouts. Run them in a session designed for it (a scheduled job, a long-lived query window), not through a flaky VPN.
Log chain broken. If a required log is missing or the chain was broken by a full backup taken without COPY_ONLY, STOPAT won't reach your desired moment. Restore to the last coherent point and understand you've lost the interval.
Restoring to a point in time and the recovery model caveat
Point-in-time restore depends entirely on the database having used the FULL recovery model and having an unbroken series of log backups. Under SIMPLE recovery, the transaction log truncates automatically, so you can restore only to a full or differential backup boundary—there is no "rewind" to 10:47 a.m.
A practical plan looks like: nightly full backup at 01:00, transaction log backups every 15 minutes, and—crucially—a periodic test restore of the chain onto a scratch instance. A log chain that's never been restored is hypothetical. The one exception: COPY_ONLY full backups don't break the chain, so maintenance or ad-hoc copies don't cost you your recoverability. Verify your actual job schedule rather than assuming it; backups that were disabled or failed silently are a recurring cause of unrecoverable windows.
When to hand this to a DBA or the vendor
Most restores are routine. Certain symptoms justify stopping and escalating. Corruption detected by DBCC CHECKDB that extends to system tables, a backup file that fails VERIFYONLY on multiple media, a restore that repeatedly fails at the same page with a hardware-style error, or a broken log chain on a production system whose data loss window is unacceptable—these need a specialist, and often vendor support. Also escalate before attempting repairs on a database whose only copy is the backup you're restoring; keep that backup file untouched until you have a verified working copy. Getting a second opinion is cheap compared with rebuilding from ambiguity.