MsSQL - Restore Master/Model/MSDB

Steps to Restore the master Database:

image.png

For a named instance, replace . with .\<InstanceName>

  • Restore the master Database:
    • In the sqlcmd prompt, execute the following RESTORE DATABASE command, replacing <path_to_backup_file> with the actual path to your master database backup file:
RESTORE DATABASE master FROM DISK = '\\BACKUP-SERVER\Backups\SQLSERVER01\master\FULL\SQLSERVER01_master_FULL_20250910_010011.bak' WITH REPLACE, RECOVERY;
-- SQL Server shuts down after master is restored. Remove -m, start the service normally,
-- reconnect with sqlcmd, stop SQL Server Agent, then restore model and msdb:
RESTORE DATABASE model FROM DISK = '\\BACKUP-SERVER\Backups\SQLSERVER01\model\FULL\SQLSERVER01_model_FULL_20250910_010013.bak' WITH REPLACE, RECOVERY;
RESTORE DATABASE msdb FROM DISK = '\\BACKUP-SERVER\Backups\SQLSERVER01\msdb\FULL\SQLSERVER01_msdb_FULL_20250910_010014.bak' WITH REPLACE, RECOVERY;

Check integrity

DBCC CHECKDB ('master') WITH ALL_ERRORMSGS, EXTENDED_LOGICAL_CHECKS;

Last verified: October 2026

Sources:


Revision #1
Created 10 September 2025 20:47:24 by Admin
Updated 8 October 2026 15:26:51 by Admin