SQL Backup 10

Restoring the master database

To restore the master database, you must use the SQL Backup Pro command line to ensure that the SQL Server is started in single user mode. It is not possible to restore the master database with the Restore wizard.

  1. Stop the SQL Server service.
  2. Open a Command Prompt window, and navigate to the SQL Server instance's Binn folder.
  3. Start SQL Server in single user mode using sqlservr.exe -c -m for an unnamed instance, or sqlserver -c -m -s <instance name> for a named instance.
  4. Use the SQL Backup Pro command line interface (SQLBackupC.exe) to restore the master database. 
    For example, at the command prompt, type:

    SQLBackupC.exe -SQL "RESTORE DATABASE master FROM DISK = 'C:\Backups\master 20070101.sqb'"

    For a named instance, use the -I parameter to specify the instance name, for example:

    SQLBackupC.exe -SQL "RESTORE DATABASE master FROM DISK = 'C:\Backups\master 20070101.sqb'" -I Instance2

    If you are using SQL Server authentication, use the -U and -P parameters to add the authentication details, for example:

    SQLBackupC.exe -SQL "RESTORE DATABASE master FROM DISK='C:\Backups\master 20070101.sqb'" -I Instance2 -U sa -P MyPassword

    If you are restoring the master database to a new (or rebuilt) server you will need to add the WITH REPLACE keyword, for example:

    SQLBackupC.exe -SQL "RESTORE DATABASE master FROM DISK='C:\Backups\master 20070101.sqb' WITH REPLACE" -I Instance2

    SQL Backup Pro restores the master database, and SQL Server automatically stops the SQL Server service when the restore operation is complete.

  5. You can now start the SQL Server in normal mode.

See Using the command line for more information.


Didn't find what you were looking for?