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;
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
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.
add a comment |
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
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.
add a comment |
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
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
sql-server restore
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.
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.
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
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.
add a comment |
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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.
add a comment |
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.
add a comment |
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.
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.
answered 8 hours ago
Brent OzarBrent Ozar
36.5k19114251
36.5k19114251
add a comment |
add a comment |
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.
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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