Link to home
Start Free TrialLog in
Avatar of desert-sloth
desert-sloth

asked on

How to restore MSSQL 2012 Database server OS crashed, data drive ok

How to restore MSSQL 2012 Database server after OS crash c: drive. The data drive ( e:)   is ok where the database is stored, including the master database.  I have reinstalled mssql 2012 on new server and mounted e drive. I installed new mssql on c: drive. I then tried to change the settings where  the master database is located  to e drive from thenew install and it did not work. Any ideas how to do this. One other note. I do not know what service pack is installed if any.
Avatar of Adam Brown
Adam Brown
Flag of United States of America image

You should be able to just import the databases: https://docs.microsoft.com/en-us/previous-versions/sql/sql-server-2012/ms140052(v=sql.110) explains
Avatar of desert-sloth
desert-sloth

ASKER

import will not work no selection for mdf file.  I need to restore the master database so i can reattach the other databses. All I have is the master.mdf and log no backups.
Attached database will not work because the database's were not detached or clean shutdown. I need to get the master restored in order to keep the security and users settings. Only the OS drive crashed. The data drive is ok. The mssql was installed on C: drive and the data was stored on E: drive. I wonder if I renstall the MSSQL and point the database install to be in the original location. shutdown database and copy the master mdf restart would work?
When you install the new SQL Server instance, give the exact name as the old one and provide a temporary E: drive where the setup will create the new system files (don't forget to provide the exact path as it is in the original database files location).
After SQL Server installation completed successfully, stop SQL Server service, remove temporary E: drive and attach the original E: drive. Do not forget to give the same drive letter. When done, just restart SQL Server as it should find the system database files in the same location as when it was installed.
Is this issue solved or do you need more help to solve it?
This question needs an answer!
Become an EE member today
7 DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform.
View membership options
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.