How can I restore a master database from its bak file?SQL Recover from .bak file with NOINITAttempting to restore SQL Server 2005 database to a SQL Server 2008 R2 instance gives reason: 15105 errorRestore .Bak file to different ServerRestoring Database, creating new copy and use existing transaction logs for the original backup database to restore the NEW database to be current?Restoring corrupted bak fileCan I restore an SQL 2016 database mdf at an SQL 2014 Sp1 instance?Can't restore sql bak file to a new databaseSQL Server 2016: cannot restore database from .bak file because of huge transaction log?How to restore a file group from file group backup?How to make a distibutable .bak file?

Examples of protocols that are insecure when run concurrently

Time at 1G acceleration to travel 100 000 light years

What preparations would Hubble have needed to return in a Shuttle?

Template code with 0xcccccccc in every ghidra decompiled function for some executables

How can the US president give an order to a civilian?

How to make all magic-casting innate, but still rare?

How much steel armor can you wear and still be able to swim?

The Amazing Sliding Crossword

How can I improve my violin intonation for enharmonic notes?

Visa Family Permit

What is this plant I saw for sale at a Romanian farmer's market?

Can the pre-order traversal of two different trees be the same even though they are different?

Math symbols in math operators

Should I include fillets on my 3d printed parts?

How can I prevent a user from copying files on another hard drive?

Is there any possible way to get these hearts as Adult Link?

Can a character learn spells from someone else's spellbook and then sell it?

Explicit song lyrics checker

In the US, can a former president run again?

How useful is the GRE Exam?

Would a 7805 5 V regulator drain a 9 V battery?

Kelvin type connection

In Street Fighter, what does the M stand for in M Bison?

Basic power tool set for Home repair and simple projects



How can I restore a master database from its bak file?


SQL Recover from .bak file with NOINITAttempting to restore SQL Server 2005 database to a SQL Server 2008 R2 instance gives reason: 15105 errorRestore .Bak file to different ServerRestoring Database, creating new copy and use existing transaction logs for the original backup database to restore the NEW database to be current?Restoring corrupted bak fileCan I restore an SQL 2016 database mdf at an SQL 2014 Sp1 instance?Can't restore sql bak file to a new databaseSQL Server 2016: cannot restore database from .bak file because of huge transaction log?How to restore a file group from file group backup?How to make a distibutable .bak file?






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








1















During a penetration test I found multiple .bak-files for an MSSQL database. I want to restore them all. In a Windows VM I installed SQL Server 2017. For restoring the master database, I put the server in single-user mode and tried restoring the database as follows (also tried the same via SSMS):



RESTORE DATABASE master
FROM DISK = 'C:Foo<path>master.bak'
WITH MOVE 'master' TO 'C:Foomaster.mdf',
MOVE 'master_log' TO 'C:Foomaster_log.ldf',
REPLACE
GO


This gave me an error like:




.. can't be restored because it was created by a different version of the server (13.00.4435) than this server (14...).




I then downloaded MSSQL 2016 with service pack 1 by subscribing to "Visual Studio Dev Essentials" on my.visualstudio.com. Now I got the error:




.. can't be restored because it was created by a different version of
the server (13.00.4435) than this server (13.00.4001).




So now I needed to update. I downloaded MSSQL 2016 service pack 2, which gave me the error:




.. can't be restored because it was created by a different version of
the server (13.00.4435) than this server (13.00.5026).




So I really seem to require the exact patch. However, I can't find a list of patches with corresponding server versions. Does anyone have an idea on how to find the right patch?



If I could just extract the .bak file to its .mdf- and .ldf files that would be enough. I found a bunch of tools for restoring MSSQL .bak files, but want they all want to connect to a database (to do a simple restore). I'd be very happy if I could either get the right SQL Server version or extract the .bak file.










share|improve this question









New contributor



Graa is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

























    1















    During a penetration test I found multiple .bak-files for an MSSQL database. I want to restore them all. In a Windows VM I installed SQL Server 2017. For restoring the master database, I put the server in single-user mode and tried restoring the database as follows (also tried the same via SSMS):



    RESTORE DATABASE master
    FROM DISK = 'C:Foo<path>master.bak'
    WITH MOVE 'master' TO 'C:Foomaster.mdf',
    MOVE 'master_log' TO 'C:Foomaster_log.ldf',
    REPLACE
    GO


    This gave me an error like:




    .. can't be restored because it was created by a different version of the server (13.00.4435) than this server (14...).




    I then downloaded MSSQL 2016 with service pack 1 by subscribing to "Visual Studio Dev Essentials" on my.visualstudio.com. Now I got the error:




    .. can't be restored because it was created by a different version of
    the server (13.00.4435) than this server (13.00.4001).




    So now I needed to update. I downloaded MSSQL 2016 service pack 2, which gave me the error:




    .. can't be restored because it was created by a different version of
    the server (13.00.4435) than this server (13.00.5026).




    So I really seem to require the exact patch. However, I can't find a list of patches with corresponding server versions. Does anyone have an idea on how to find the right patch?



    If I could just extract the .bak file to its .mdf- and .ldf files that would be enough. I found a bunch of tools for restoring MSSQL .bak files, but want they all want to connect to a database (to do a simple restore). I'd be very happy if I could either get the right SQL Server version or extract the .bak file.










    share|improve this question









    New contributor



    Graa is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.





















      1












      1








      1








      During a penetration test I found multiple .bak-files for an MSSQL database. I want to restore them all. In a Windows VM I installed SQL Server 2017. For restoring the master database, I put the server in single-user mode and tried restoring the database as follows (also tried the same via SSMS):



      RESTORE DATABASE master
      FROM DISK = 'C:Foo<path>master.bak'
      WITH MOVE 'master' TO 'C:Foomaster.mdf',
      MOVE 'master_log' TO 'C:Foomaster_log.ldf',
      REPLACE
      GO


      This gave me an error like:




      .. can't be restored because it was created by a different version of the server (13.00.4435) than this server (14...).




      I then downloaded MSSQL 2016 with service pack 1 by subscribing to "Visual Studio Dev Essentials" on my.visualstudio.com. Now I got the error:




      .. can't be restored because it was created by a different version of
      the server (13.00.4435) than this server (13.00.4001).




      So now I needed to update. I downloaded MSSQL 2016 service pack 2, which gave me the error:




      .. can't be restored because it was created by a different version of
      the server (13.00.4435) than this server (13.00.5026).




      So I really seem to require the exact patch. However, I can't find a list of patches with corresponding server versions. Does anyone have an idea on how to find the right patch?



      If I could just extract the .bak file to its .mdf- and .ldf files that would be enough. I found a bunch of tools for restoring MSSQL .bak files, but want they all want to connect to a database (to do a simple restore). I'd be very happy if I could either get the right SQL Server version or extract the .bak file.










      share|improve this question









      New contributor



      Graa is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.











      During a penetration test I found multiple .bak-files for an MSSQL database. I want to restore them all. In a Windows VM I installed SQL Server 2017. For restoring the master database, I put the server in single-user mode and tried restoring the database as follows (also tried the same via SSMS):



      RESTORE DATABASE master
      FROM DISK = 'C:Foo<path>master.bak'
      WITH MOVE 'master' TO 'C:Foomaster.mdf',
      MOVE 'master_log' TO 'C:Foomaster_log.ldf',
      REPLACE
      GO


      This gave me an error like:




      .. can't be restored because it was created by a different version of the server (13.00.4435) than this server (14...).




      I then downloaded MSSQL 2016 with service pack 1 by subscribing to "Visual Studio Dev Essentials" on my.visualstudio.com. Now I got the error:




      .. can't be restored because it was created by a different version of
      the server (13.00.4435) than this server (13.00.4001).




      So now I needed to update. I downloaded MSSQL 2016 service pack 2, which gave me the error:




      .. can't be restored because it was created by a different version of
      the server (13.00.4435) than this server (13.00.5026).




      So I really seem to require the exact patch. However, I can't find a list of patches with corresponding server versions. Does anyone have an idea on how to find the right patch?



      If I could just extract the .bak file to its .mdf- and .ldf files that would be enough. I found a bunch of tools for restoring MSSQL .bak files, but want they all want to connect to a database (to do a simple restore). I'd be very happy if I could either get the right SQL Server version or extract the .bak file.







      sql-server restore






      share|improve this question









      New contributor



      Graa is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.










      share|improve this question









      New contributor



      Graa is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.








      share|improve this question




      share|improve this question








      edited 5 hours ago









      mustaccio

      10.7k72343




      10.7k72343






      New contributor



      Graa is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.








      asked 9 hours ago









      GraaGraa

      1083




      1083




      New contributor



      Graa is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.




      New contributor




      Graa is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






















          1 Answer
          1






          active

          oldest

          votes


















          5














          The master database is special, different than other databases. It's a system database where SQL Server stores internal objects. The only time you'd normally restore it is if you're bringing back a server from the dead - you wouldn't usually want to restore master from one database to another.



          In your scenario, when you're just curious about the contents of the database, restore master with a different database name, like this:



          RESTORE DATABASE master_copy
          FROM DISK = 'C:Foo<path>master.bak'
          WITH MOVE 'master' TO 'C:Foomaster_copy.mdf',
          MOVE 'master_log' TO 'C:Foomaster_copy_log.ldf',
          GO


          Then, after the restore finishes, you can query objects in the master_copy database.






          share|improve this answer























            Your Answer








            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "182"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: false,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            bindNavPrevention: true,
            postfix: "",
            imageUploader:
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            ,
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );






            Graa is a new contributor. Be nice, and check out our Code of Conduct.









            draft saved

            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdba.stackexchange.com%2fquestions%2f240665%2fhow-can-i-restore-a-master-database-from-its-bak-file%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            5














            The master database is special, different than other databases. It's a system database where SQL Server stores internal objects. The only time you'd normally restore it is if you're bringing back a server from the dead - you wouldn't usually want to restore master from one database to another.



            In your scenario, when you're just curious about the contents of the database, restore master with a different database name, like this:



            RESTORE DATABASE master_copy
            FROM DISK = 'C:Foo<path>master.bak'
            WITH MOVE 'master' TO 'C:Foomaster_copy.mdf',
            MOVE 'master_log' TO 'C:Foomaster_copy_log.ldf',
            GO


            Then, after the restore finishes, you can query objects in the master_copy database.






            share|improve this answer



























              5














              The master database is special, different than other databases. It's a system database where SQL Server stores internal objects. The only time you'd normally restore it is if you're bringing back a server from the dead - you wouldn't usually want to restore master from one database to another.



              In your scenario, when you're just curious about the contents of the database, restore master with a different database name, like this:



              RESTORE DATABASE master_copy
              FROM DISK = 'C:Foo<path>master.bak'
              WITH MOVE 'master' TO 'C:Foomaster_copy.mdf',
              MOVE 'master_log' TO 'C:Foomaster_copy_log.ldf',
              GO


              Then, after the restore finishes, you can query objects in the master_copy database.






              share|improve this answer

























                5












                5








                5







                The master database is special, different than other databases. It's a system database where SQL Server stores internal objects. The only time you'd normally restore it is if you're bringing back a server from the dead - you wouldn't usually want to restore master from one database to another.



                In your scenario, when you're just curious about the contents of the database, restore master with a different database name, like this:



                RESTORE DATABASE master_copy
                FROM DISK = 'C:Foo<path>master.bak'
                WITH MOVE 'master' TO 'C:Foomaster_copy.mdf',
                MOVE 'master_log' TO 'C:Foomaster_copy_log.ldf',
                GO


                Then, after the restore finishes, you can query objects in the master_copy database.






                share|improve this answer













                The master database is special, different than other databases. It's a system database where SQL Server stores internal objects. The only time you'd normally restore it is if you're bringing back a server from the dead - you wouldn't usually want to restore master from one database to another.



                In your scenario, when you're just curious about the contents of the database, restore master with a different database name, like this:



                RESTORE DATABASE master_copy
                FROM DISK = 'C:Foo<path>master.bak'
                WITH MOVE 'master' TO 'C:Foomaster_copy.mdf',
                MOVE 'master_log' TO 'C:Foomaster_copy_log.ldf',
                GO


                Then, after the restore finishes, you can query objects in the master_copy database.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered 8 hours ago









                Brent OzarBrent Ozar

                36.5k19114251




                36.5k19114251




















                    Graa is a new contributor. Be nice, and check out our Code of Conduct.









                    draft saved

                    draft discarded


















                    Graa is a new contributor. Be nice, and check out our Code of Conduct.












                    Graa is a new contributor. Be nice, and check out our Code of Conduct.











                    Graa is a new contributor. Be nice, and check out our Code of Conduct.














                    Thanks for contributing an answer to Database Administrators Stack Exchange!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid


                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.

                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdba.stackexchange.com%2fquestions%2f240665%2fhow-can-i-restore-a-master-database-from-its-bak-file%23new-answer', 'question_page');

                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    Canceling a color specificationRandomly assigning color to Graphics3D objects?Default color for Filling in Mathematica 9Coloring specific elements of sets with a prime modified order in an array plotHow to pick a color differing significantly from the colors already in a given color list?Detection of the text colorColor numbers based on their valueCan color schemes for use with ColorData include opacity specification?My dynamic color schemes

                    Invision Community Contents History See also References External links Navigation menuProprietaryinvisioncommunity.comIPS Community ForumsIPS Community Forumsthis blog entry"License Changes, IP.Board 3.4, and the Future""Interview -- Matt Mecham of Ibforums""CEO Invision Power Board, Matt Mecham Is a Liar, Thief!"IPB License Explanation 1.3, 1.3.1, 2.0, and 2.1ArchivedSecurity Fixes, Updates And Enhancements For IPB 1.3.1Archived"New Demo Accounts - Invision Power Services"the original"New Default Skin"the original"Invision Power Board 3.0.0 and Applications Released"the original"Archived copy"the original"Perpetual licenses being done away with""Release Notes - Invision Power Services""Introducing: IPS Community Suite 4!"Invision Community Release Notes

                    François Viète Contents Biography Work and thought Bibliography See also Notes Further reading External links Navigation menup. 21Google Bookspp. 75–77Google BooksDe thou (from University of Saint Andrews)ArchivedGoogle BooksGoogle BooksGoogle BooksGoogle booksGoogle Bookscc-parthenay.frL'histoire universelle (fr)Universal History (en)ArchivedAdsabs.harvard.eduPagesperso-orange.frArchive.orgChikara Sasaki. Descartes' mathematical thought p.259Google BooksGoogle BooksGoogle Bookspp. 152 and onwardGoogle BooksGoogle BooksScribd.comGoogle Books1257-7979Google BooksGoogle BooksGoogle BooksGoogle BooksGoogle BooksGoogle BooksGallica.bnf.frGoogle BooksGoogle Books"François Viète"Francois Viète: Father of Modern Algebraic NotationThe Lawyer and the GamblerAbout TarporleySite de Jean-Paul GuichardL'algèbre nouvelle"About the Harmonicon"cb120511976(data)1188044800000 0001 0913 5903n82164680ola2013766880073431702w6vt1sb70287374827140948071409480