I want to restore my master database (.dba ).

I am not able to restore from PowerShell because the backup of the database is taken from a different version of the SQL Server and the PowerShell or cmd method does not allow it.

I moved to T-SQL, but now problem is T-SQL is not starting in single user mode.

How to run T-SQL in single user mode? Or is there another way to restore the master database?

I am using SSMS 2014.


3 Answers 3


It isn't powershell itself that restricts you, it is SQL Server which doesn't allow restoring master from a different version. And the reason why you don't get in with SSMS is that SSMS opens several connections and only one connection is allowed with -m. So use SQLCMD.EXE to try the restore instead, but you will see that you will get the same error as you got from powershell.


You have to shutdown sql server and start it in single user mode (in configuration manager, you specify -m as start up parameter) and then restore master database. See : this mssql tip for more details.

  • not working, already set -m . when restart service first time it connects. but when upload file it fails, reason:server is in single user mode. Nov 21, 2018 at 15:37
  • can you post what you are trying including the restore command ? Also, what error you are getting ?
    – Kin Shah
    Nov 21, 2018 at 15:40

After restarting your SQL Server, do not open SSMS.

Follow a simple restore command via sqlcmd and you should be able to restore it. If your SQL Server version is same for the master database and installed SQL Server. See a quick tutorial here.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.