MsSQL - Restore Master/Model/MSDB Steps to Restore the  master Database: Stop the SQL Server Instance: Open SQL Server Configuration Manager or Windows Services. Locate the SQL Server service (e.g.,  SQL Server (MSSQLSERVER)  for a default instance). Stop the service. Start SQL Server in Single-User Mode: Open the SQL Server service properties (e.g., by double-clicking the service in Services). Go to the "Startup Parameters" tab. Add  -m  (for single-user mode) to the existing startup parameters.  If there are existing parameters, separate them with a semicolon. Start the SQL Server service from there Connect using  sqlcmd : Open a new Command Prompt window as Administrator. Navigate to the SQL Server Binn directory (e.g.,  C:\Program Files\Microsoft SQL Server\MSSQLXX.MSSQLSERVER\MSSQL\Binn ). Connect to the SQL Server instance using  sqlcmd  in single-user mode.  For a default instance, use: sqlcmd -S . -E -d master sqlcmd -S . -U sa -P PASSWORD -d master   For a named instance, replace .   with  .\ Restore the  master  Database: In the  sqlcmd  prompt, execute the following  RESTORE DATABASE  command, replacing   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; The  WITH REPLACE  option is crucial as it overwrites the existing  master  database. The  RECOVERY  option brings the database online after the restore. Restart SQL Server in Normal Mode: After the restore completes and  sqlcmd  indicates the instance is shutting down, stop the SQL Server service again. Remove the  -m  startup parameter from the SQL Server service properties. Start the SQL Server service normally. Last verified: October 2026 Sources: https://learn.microsoft.com/en-us/sql/relational-databases/backup-restore/restore-the-master-database-transact-sql https://learn.microsoft.com/en-us/sql/relational-databases/backup-restore/back-up-and-restore-of-system-databases-sql-server