Troubleshooting Guide: SQL Server Error 3047 – Invalid BackupDirectory Registry Key
Why This Error Happens
This error occurs when the BackupDirectory registry value under the SQL Server instance’s Microsoft SQL Server registry hive is missing, pointing to a path that no longer exists, or contains invalid characters. It can also happen after a manual drive remapping, a failed migration, or an uninstalled/relocated backup share where the original path was removed without updating the registry. Since SQL Server relies on this key to resolve relative backup paths and locate RESTORE checkpoint files, any mismatch between the registry entry and the actual filesystem causes the engine to throw Error 3047.
Step-by-Step Resolution Guide
Step 1: Verify the Current Registry Value
- Open
regediton the Windows Server 2025 / Windows 11 host running the SQL Server 2025 instance. - Navigate to
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL17.<InstanceName>\MSSQLServer. - Locate the
BackupDirectorystring value and confirm whether the path listed actually exists on disk (e.g.,D:\SQLBackups).
Step 2: Correct or Recreate the Backup Path
- If the folder is missing, create it manually:
mkdir D:\SQLBackups. - Ensure the SQL Server service account (e.g.,
NT Service\MSSQLSERVERor a custom domain service account) has Full Control NTFS permissions on this folder via right-click → Properties → Security tab. - Update the
BackupDirectoryregistry key value to match the correct, existing path (no trailing backslash, e.g.,D:\SQLBackupsnotD:\SQLBackups\).
Step 3: Apply Changes via SQL Server Instead of Direct Registry Edit (Recommended)
- Open SQL Server Management Studio (SSMS) and connect to the instance.
- Run the following T-SQL command to safely update the key through the supported interface:
EXEC xp_instance_regwrite
N'HKEY_LOCAL_MACHINE',
N'Software\Microsoft\MSSQLServer\MSSQLServer',
N'BackupDirectory',
REG_SZ,
N'D:\SQLBackups';
- This avoids manual registry corruption and ensures the value is written in the correct format expected by the Database Engine.
Step 4: Restart the SQL Server Service
- Open SQL Server Configuration Manager.
- Right-click the affected instance (e.g.,
SQL Server (MSSQLSERVER)) and select Restart. - Confirm the service starts without errors in the SQL Server Error Log (
Management > SQL Server Logsin SSMS).
Alternative or Verification Steps
- Run
RESTORE FILELISTONLY FROM DISK = 'D:\SQLBackups\YourFile.bak'or perform a testBACKUP DATABASEusing a relative filename only (no full path) to confirm SQL Server correctly resolves theBackupDirectorypath without throwing Error 3047. - If the issue persists, check for a corrupted registry hive by comparing the key against a working instance or restoring the
MSSQLServerregistry subtree from a recent System State backup.