A compressed .bak file is restored with the same RESTORE DATABASE statement you would use for an uncompressed backup; SQL Server detects the compression from the backup header and decompresses the data as part of the restore, so you do not need to expand the file first or pass a special "decompress" switch. For example, RESTORE DATABASE Sales FROM DISK = 'D:\Backups\Sales_2026.bak' WITH RECOVERY; works whether that backup was written with compression or not. What actually determines whether the restore succeeds is something else entirely: the edition of SQL Server performing the restore must support backup compression, and the file you have must be a genuine full or differential database backup in the Microsoft Tape Format that SQL Server understands—not a .bak from some other product, and not a .zip archive that someone renamed.

That distinction is where most confusion around this question comes from, so it is worth stating clearly at the outset. "Compressed backup" in the SQL Server world has two very different meanings: a backup written by SQL Server itself with its built-in compression option (a single .bak file), or a SQL Server backup that was subsequently wrapped in a general-purpose archive such as .zip, .7z, or .gz. The first restores directly; the second must be unpacked before SQL Server can see it. The steps below cover both, along with the permissions, version rules, and failure modes that most often trip people up.

The direct method: restore a SQL Server compressed backup in place

If the .bak was produced by SQL Server with WITH COMPRESSION (or by an edition where compression is the default), nothing distinguishes the restore procedure from an ordinary one. You point RESTORE at the file and let the engine handle the rest.

The minimal full restore is:

WITH RECOVERY brings the database online and makes it usable. It is the default when no other option is specified, but writing it explicitly documents your intent and prevents accidental mistakes when you copy a script that used WITH NORECOVERY for a log-shipping or restore-chain scenario.

Restoring a differential backup follows the same full-restore pattern, and restoring a transaction log requires NORECOVERY on the preceding restores plus the MOVE clause if the file paths differ from the source server.

Verify what is actually in the file first

Before restoring—especially over an existing database—run RESTORE HEADERONLY and RESTORE FILELISTONLY:

HEADERONLY reports Compressed (a 1 indicates a compressed backup), the backup type (full, differential, log), the database name, the server and instance that created it, and the SQL Server version. FILELISTONLY lists the logical data and log file names you will need for a MOVE clause if the restore target uses different paths.

A MOVE clause is the answer to the most common follow-up error: restoring onto a server where the original file paths do not exist. Without it, SQL Server tries to write to the original physical paths and fails with "Operating system error 3 (The system cannot find the path specified)" or a permissions error. Specify the new locations explicitly:

STATS = 10 prints progress every ten percent, which is useful reassurance on large files. You may also want REPLACE if a database of the same name already exists and you intend to overwrite it, and CHECKSUM to validate page checksums during the restore if the backup was taken with checksums enabled.

Restoring a compressed backup to a database that already exists

If the target database exists, the restore will fail unless it will be overwritten intentionally and REPLACE is supplied, or the existing database is dropped first and no connections are open. Restoring over a live database is destructive; confirm the source file is the intended backup and that you have a current backup of the target before proceeding. The same restore command serves compressed and uncompressed sources.

The version and edition rules that actually gate compressed restores

Compression is a feature of SQL Server's backup engine, and it has edition and version constraints that are separate from the RESTORE syntax.

Backup compression is available in Standard, Enterprise, and Developer editions from SQL Server 2016 Service Pack 1 onward, as well as in Enterprise Edition earlier than that. Express and Web editions cannot create compressed backups, but they can restore a compressed backup produced by an edition that can. The restore direction matters: a compressed backup taken on Enterprise can be restored on Express, but a server that cannot create compressed backups cannot magically decompress an archive—it can only restore a compressed backup because the restore engine supports decompression regardless of edition.

Version compatibility runs forward, not backward. A backup created by a newer SQL Server version cannot be restored on an older version. A backup from SQL Server 2019 can be restored on 2022, but a 2022 backup cannot be restored on 2019 without an intermediary method such as generating scripts and data exports, or using the data-tier application (BACPAC) approach. The database compatibility level is a separate concern and does not control backup restore compatibility.

A .bak file must come from SQL Server or a compatible product. SQL Server backups use the Microsoft Tape Format, which is also used by Azure SQL Managed Instance and SQL Server on Linux, and those files interoperate with on-premises SQL Server. A .bak from a different database engine, or from a newer major version than the target supports, will be rejected at the header stage with a "media set" or "backup set" error rather than a compression error. If RESTORE HEADERONLY fails outright with a message like "The file is not a valid Microsoft Tape Format backup set," the problem is the file format, not compression.

When the ".bak" is really an archive

Many backup workflows—particularly those managed by third-party scheduling tools or by cloud storage transfers—wrap the SQL Server backup inside a ZIP, 7-Zip, or gzip archive but retain a .bak-like name or a .zip extension. The symptom is unmistakable once you look: RESTORE HEADERONLY fails because the first bytes are archive container data, not a tape format header. The fix is straightforward: extract the inner file with the appropriate tool and restore that.

.zip: extract with Windows Explorer, Expand-Archive in PowerShell, or the unzip command on Linux. .7z: extract with 7-Zip (7z x file.7z). .gz: extract with gzip -d or gunzip. SQL Server itself does not read gzip files.

Then run RESTORE HEADERONLY on the extracted file to confirm it is a valid backup set and to check its Compressed flag before proceeding.

This is also the answer to a related practical worry: if you received a backup file and cannot tell whether it is compressed, run RESTORE HEADERONLY—the Compressed column tells you. If the command fails, the file is not a SQL Server backup at all, and you should identify the archive format or ask the source system how the file was produced.

Permissions and access

Restoring requires CREATE DATABASE permission on the target instance, and the SQL Server service account—not your login—must be able to read the backup file and write to the restore destination paths. This distinction explains a stubborn class of failures: a file on a network share may be readable by your Windows account but not by the service account, producing an operating-system access error during the restore even though you can open the file yourself. The reliable remedy is to place the backup on a local path the service account can read, or grant the service account explicit read permissions on the share.

The same logic applies to the MOVE destinations: the service account needs write permission to the target directories, and the database files must not already be in use.

Restore time and space: what compression changes

Backup compression reduces file size, typically by a substantial factor for transactional databases, but it does not eliminate the need for free space on the restore destination. The restored database files will occupy their full uncompressed size; plan the target volume accordingly. Restoration of a compressed backup also consumes CPU to decompress, which can make restore time somewhat longer than for an uncompressed backup on a CPU-constrained server, even though reading less data from disk is faster. On a system where disk throughput is the bottleneck, compressed restores are often faster overall; where CPU is the bottleneck, they can be slower. This is a performance trade-off, not a correctness issue, and it rarely affects the restore procedure itself.

If you need to restore the same compressed backup to multiple servers, remember that each restore decompresses independently—there is no shared cache—and that the RESTORE will also rebuild the database's page allocations and indexes as stored, so the database comes online in the state it was backed up.

Common failure modes and what they mean

Symptom Likely cause Remedy
"The file is not a valid Microsoft Tape Format backup set" File is a ZIP/7z/gzip archive or not a SQL Server backup Extract the archive or confirm the file's origin
"The media family on device is incorrectly formed" Truncated or corrupted file, or wrong format Re-transfer the file; verify with RESTORE VERIFYONLY
"Operating system error 3/5" Path missing or service account lacks permissions Add MOVE clauses; fix service account access
"Database is already in use" Existing database open with connections Drop the database or use REPLACE with exclusive access
Restore succeeds but database is "Restoring" WITH NORECOVERY used without a follow-up recovery Run a final RESTORE ... WITH RECOVERY, or apply logs
"Version 0 vs. 0" or compatibility error Backup from a newer SQL Server version Restore on the same or newer version; export/import as fallback

RESTORE VERIFYONLY is the standard pre-flight check: it reads the backup set and validates its structure without actually restoring, and it works on compressed backups. RESTORE LABELONLY reports the media set information if you need to confirm the file is a SQL Server backup before committing to a restore.

Frequently asked questions worth answering directly

Can I restore a compressed backup without decompressing it first? Yes, if it is a SQL Server compressed backup; SQL Server decompresses it during restore. If it is an archive file, no—extract it first.

Does RESTORE DATABASE need to run in single-user mode? No. Single-user mode is sometimes used to drop a database that has active connections, but the restore itself does not require it. What the restore requires is that the target database is not in use and that no connections are open to it when overwriting.

Can I restore a compressed backup on SQL Server Express? Yes. Express can restore compressed backups created by editions that support compression, even though Express cannot create them. Check the version compatibility rule too, since a file from a newer major version will still be rejected.

Is the restore command different for a transaction log backup? Yes, log restores use WITH NORECOVERY until the final restore, which uses WITH RECOVERY, and each log restore must apply in sequence on top of a matching full or differential restore. Compression does not change this sequence.

What if the backup was password-protected or encrypted by a third-party tool? SQL Server's native backup encryption uses certificates or asymmetric keys configured with BACKUP ... WITH ENCRYPTION, and restoring requires the corresponding certificate. A backup encrypted by a third-party tool must be decrypted by that tool before SQL Server can read it. Neither scenario is resolved by the compression settings.

Does compression affect the recovery model? No. Backup compression is independent of whether the database uses the full, bulk-logged, or simple recovery model; it changes the file size and restore cost, not the recovery behavior.

What to verify before you commit

A short, practical sequence protects you from most surprises: run RESTORE HEADERONLY and RESTORE FILELISTONLY to confirm the file is the intended backup set and to capture logical file names; run RESTORE VERIFYONLY to validate the file; check the Compressed flag and the source version; confirm the service account can read the backup and write the destination paths; and prepare MOVE clauses when restoring onto a server with different directories. If the file is an archive, extract it first and repeat these checks on the inner .bak. Done this way, a compressed backup restores exactly like an uncompressed one—because on the SQL Server side, that is precisely what it is.