How to fix Error 3231 on Windows Server 2025 / Windows 11

Troubleshooting Guide: SQL Server Error 3231

Error Message: “The media loaded on “%ls” is formatted to support %d media families”

Why This Error Happens

This error occurs when SQL Server attempts to read a backup media set but detects a mismatch between the number of media families defined in the backup header and what the current RESTORE or BACKUP operation expects. This typically happens when a striped backup (spanning multiple files or tapes) is restored without specifying all the required files in the RESTORE statement, or when the backup media has been corrupted or partially copied. It can also occur if a backup set created with multiple files is later referenced with an incorrect or incomplete FROM clause.

Step-by-Step Resolution Guide

Step 1: Identify the Full Media Set

  • Run RESTORE HEADERONLY FROM DISK = 'C:\Backups\YourBackup.bak' to inspect the backup header metadata.
  • Check the FamilyCount column in the result set to confirm how many media families (files) the backup set actually requires.
  • Cross-reference this with the original backup job (e.g., SQL Agent job step or maintenance plan) to see how many files were originally specified in the BACKUP DATABASE command.

Step 2: Reconstruct the Correct RESTORE Statement

  • Ensure every physical file belonging to the striped backup set is included in the FROM clause, separated by commas.
  • Example syntax:
RESTORE DATABASE YourDB
FROM DISK = 'C:\Backups\YourBackup_1.bak',
     DISK = 'C:\Backups\YourBackup_2.bak',
     DISK = 'C:\Backups\YourBackup_3.bak'
WITH RECOVERY;
  • Verify file paths are accessible from the SQL Server 2025 service account and not blocked by Windows Server 2025 file permissions (right-click file → Properties → Security tab → confirm NT SERVICE\MSSQLSERVER has Read access).

Step 3: Check for Missing or Corrupted Backup Files

  • Confirm all files from the original backup set exist in the source directory (dir C:\Backups\*.bak in PowerShell or Command Prompt).
  • If a file is missing (e.g., due to a failed copy to network share or external drive), retrieve it from the original backup location or secondary backup repository.
  • Run CHECKSUM validation during restore testing by adding WITH CHECKSUM to a test RESTORE VERIFYONLY command to rule out corruption.

Step 4: Rebuild the Backup Set if Files Cannot Be Recovered

  • If one or more media family files are permanently lost or corrupted, the striped set cannot be restored partially — SQL Server requires all files.
  • Take a fresh full backup of the database (if still accessible) using a single-file backup strategy to avoid future media family issues:
BACKUP DATABASE YourDB TO DISK = 'C:\Backups\YourDB_Full.bak' WITH INIT;

Alternative or Verification Steps

  • After restoring, run RESTORE VERIFYONLY FROM DISK = '...' (listing all files) to confirm the backup set integrity before attempting a full production restore.
  • If striped backups continue causing confusion, switch to a single backup file per database going forward, or use SQL Server Management Studio’s “Maintenance Plan” backup task with “Single File” output to simplify restore operations on Windows Server 2025.