Restore a SQL Server master database

In a SQL Server instance, a master database contains information about all other databases and configuration information for the instance. The master database must be restored by itself while the instance is offline.

Other system databases (i.e., msdb and model) can be restored while the SQL Server instance is online, and do not require a special restore procedure.

To restore a SQL Server master database:

1.   Stop the SQL Server services on the machine where you want to restore the master database.

2.   Manually copy the existing master database files (master.mdf and mastlog.ldf) to another location so they will not be overwritten.

These copies can be used to roll back the database if a problem occurs with the restored master database.

3.   Restore the master database files (master.mdf and mastlog.ldf) from a SQL Server Plug-in backup or application-aware Image Plug-in backup. See Restore SQL Server databases to flat files or Restore SQL Server database files or objects from Image backups.

4.   Manually copy the master database files to the original location of the master database files (with replace).

5.   Restart all SQL Server services.