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

Why This Error Happens

Error 5368 occurs when a BACKUP or RESTORE command includes an option that is incompatible with the specified backup format, such as attempting to use COMPRESSION with a format that does not support it, or mixing legacy TAPE syntax with BACKUP TO URL. This typically happens due to a T-SQL syntax mismatch, an outdated script that uses deprecated flags, or an attempt to apply enterprise-only features (like compression or encryption) on an edition that does not support them. In Microsoft SQL Server 2025, stricter format validation was introduced, causing scripts that previously worked (with silent ignores) to now throw a hard error.

Step-by-Step Resolution Guide

Step 1: Identify the Conflicting Syntax

  • Open the specific T-SQL script that triggered Error 5368 in SQL Server Management Studio (SSMS).
  • Look for the specific options mentioned in the error message (e.g., WITH FORMAT, COMPRESSION, MEDIANAME).
  • Check if you are mixing BACKUP ... TO URL (Azure Blob Storage) with local disk-specific options like SKIP or NOREWIND, which are not interchangeable.

Step 2: Validate Backup Compression Settings

  • Navigate to SSMS > Right-click Server > Properties > Database Settings.
  • Verify the “Compress backup” default setting is appropriate for your target format.
  • If using a direct query, ensure the syntax follows the 2025 standard:
BACKUP DATABASE [YourDB] 
TO DISK = N'C:\Backups\YourDB.bak' 
WITH COMPRESSION, STATS = 10;
  • Remove the COMPRESSION flag entirely if you are backing up to a VIRTUAL_DEVICE or a format that explicitly rejects it.

Step 3: Check Edition Compatibility

  • Run the following query to confirm you are not running Standard Edition while trying to use Enterprise-only backup options:
SELECT SERVERPROPERTY('Edition');
  • If the output shows “Standard Edition,” remove advanced options like COMPRESSION or ENCRYPTION from the script, as these are restricted on non-Enterprise builds in specific format contexts.

Step 4: Update Maintenance Plans

  • Open SQL Server Agent > Jobs and locate the specific Maintenance Plan causing the failure.
  • Edit the “Back Up Database” task and toggle the “Set backup compression” dropdown to “Use the default server setting” instead of forcing a specific format manually.
  • Save and re-run the job step to clear the cached execution plan that holds the invalid syntax.

Alternative or Verification Steps

  • Verification: Run the backup command manually via a New Query window in SSMS. If the backup completes with “100 percent processed” and no red error text, the format conflict is resolved.
  • Alternative: If the error persists on complex jobs, strip the command down to the bare minimum (BACKUP DATABASE TO DISK) and add options back one by one to isolate exactly which specific flag Windows Server 2025 is rejecting.