SQL Server error 3241 occurs when attempting to restore a database backup and the media header on the backup device is corrupted, mismatched, or not recognized as a valid SQL Server backup set. This typically happens due to using the wrong backup file, attempting to restore a backup from a different SQL Server version without compatibility, or file corruption during transfer or storage. To fix this, verify the backup file integrity, confirm compatibility, and use the correct RESTORE command with appropriate options.

What You'll Need

  • Access to the SQL Server instance where the restore is being attempted
  • The backup file (.bak) you are trying to restore
  • SQL Server Management Studio (SSMS) or sqlcmd utility
  • Appropriate permissions to perform restore operations on the target server
  • Knowledge of the SQL Server version that created the backup and the version on the target server

Step-by-Step

  1. Confirm the backup file is a valid SQL Server backup by checking its file header. Right-click the .bak file, select Properties, and check the file size — if it is 0 KB or unusually small, the file may be empty or corrupted during copy.
  2. Ensure you are using the correct backup file. Verify the file path and name in your RESTORE command matches exactly where the backup is stored. A common mistake is pointing to a log file, script, or incomplete copy.
  3. Check the SQL Server version compatibility. A backup created on a newer version of SQL Server cannot be restored on an older version. For example, a backup from SQL Server 2019 cannot be restored on SQL Server 2017. Use SELECT @@VERSION to check your target server version.
  4. If using SSMS, open it and connect to the target SQL Server instance. Right-click the Databases node, select Restore Database..., then choose Device and browse to your .bak file. Click OK to list the backup sets.
  5. In the Restore Database dialog, under the General tab, verify that the backup set listed matches the expected database name and backup type (full, differential, log). If no backup sets appear or the list is empty, the media header is likely unreadable.
  6. If the backup sets appear but you still get error 3241 during restore, try using the WITH HEADERONLY option to inspect the backup metadata. Run: RESTORE HEADERONLY FROM DISK = 'C:\Backups\yourbackup.bak'; This returns metadata about the backup set. If this command fails with error 3241, the backup file is fundamentally corrupted or not a SQL Server backup.
  7. If HEADERONLY succeeds, note the CompatibilityLevel, SoftwareVersionMajor, and SoftwareVersionMinor values. Confirm these are compatible with your target server’s version.
  8. If the backup is from a higher version, you cannot downgrade. You must restore it to a server of the same or newer version. Consider upgrading the target SQL Server instance if needed.
  9. If the backup file was transferred via FTP, email, or network copy, verify the transfer was complete and in binary mode. ASCII transfers can corrupt .bak files. Retry the copy using a reliable method like robocopy /Z or ensure FTP is set to binary mode.
  10. If you suspect file corruption, try to restore the backup on a different server (same or newer version) to isolate whether the issue is the file or the original server environment.
  11. As a last resort, if you have access to the original backup source, create a new backup using BACKUP DATABASE WITH FORMAT to ensure a clean, valid backup file, then attempt the restore again.

Common Mistakes

  • Assuming any .bak file is a valid SQL Server backup without verifying its contents — some tools produce .bak files that are not SQL Server compatible.
  • Using a differential or transaction log backup as the base for restore without first restoring the corresponding full backup.
  • Attempting to restore a backup compressed with third-party tools without first decompressing it or using the correct restore method.
  • Ignoring version compatibility and trying to force a restore from a newer SQL Server to an older one.
  • Specifying incorrect file paths in the RESTORE command, especially when using UNC paths or mapped drives that may not be accessible to the SQL Server service account.
  • Overlooking that the SQL Server service account must have read permissions on the backup file location — even if you can access it, the service may not.

Tips

  • Always test your backup restore process on a non-production server to validate backup integrity before relying on it in production.
  • Use the WITH CHECKSUM option when creating backups to enable integrity verification during restore.
  • Keep a record of the SQL Server version used to create each backup, especially in environments with multiple versions.
  • When in doubt, run RESTORE VERIFYONLY FROM DISK = 'yourbackup.bak' to check if the backup is readable without performing a full restore.
  • Label backup files clearly with database name, date, time, and backup type to avoid confusion.
  • If using network shares, ensure the SQL Server service account (not your user account) has access to the share.

Troubleshooting

If the steps above do not resolve error 3241:

  • Run RESTORE HEADERONLY again and capture the full error message. If it fails with "The media family on device is incorrectly formed," the file is not a valid SQL Server backup set.
  • Check the Windows Application Event Log on the SQL Server server for related errors from the MSSQLSERVER source around the time of the restore attempt — look for I/O or device errors.
  • Try copying the backup file to the local server’s disk (same physical machine as SQL Server) and restore from there to eliminate network or permission issues.
  • If the file was compressed or encrypted, ensure it is restored to its original state before attempting SQL Server restore — SQL Server cannot directly read .zip or .enc files unless using a native backup encryption feature.
  • Consider using a hex editor to view the first few bytes of the .bak file. A valid SQL Server backup starts with the signature "Microsoft SQL Server Media Set" followed by version info. If this text is missing or garbled, the file is corrupted or not a backup.
  • If all else fails and the data is critical, contact Microsoft Support with the backup file and detailed error logs — they may be able to recover data using specialized tools, though success is not guaranteed.

Frequently Asked Questions

Can I fix a corrupted .bak file that causes error 3241?

Generally, no — if the media header is corrupted and RESTORE HEADERONLY fails, the backup file cannot be repaired using SQL Server tools. You must rely on a good copy of the backup or professional data recovery services.

Does error 3241 mean the backup was taken incorrectly?

Not necessarily — it could be a good backup that was corrupted after creation during copy, storage, or transfer. Always verify backups soon after creation using RESTORE VERIFYONLY.

Can I restore a SQL Server 2022 backup on SQL Server 2019?

No — backups cannot be restored to an older major version of SQL Server. You must use SQL Server 2022 or newer to restore a backup created on SQL Server 2022.

Why does SSMS show the backup file but then fail with error 3241?

SSMS may detect the file exists and read the name, but fail to parse the media header when attempting to list backup sets or perform the restore, indicating header corruption or incompatibility.

Is it safe to ignore error 3241 and force the restore?

No — there is no safe way to bypass this error. Forcing a restore on invalid media risks further corruption or server instability. Always address the root cause.

How can I prevent error 3241 in the future?

Use verified backup procedures, store backups on reliable media, verify them with RESTORE VERIFYONLY, ensure version compatibility before restore, and maintain multiple copies in different locations.