Share via


attach Master database to newly build instance

Question

Monday, October 10, 2016 7:39 PM

Guyz

need immideate assitance,

we had a server failure,

mow we build new server and we need to attach old master.mdf file to this new instance,

how can it be done.

k

All replies (9)

Monday, October 10, 2016 7:42 PM ✅Answered

You would need to stop SQL Server. Copy the master.mdf and master.ldf to a new location. Copy the older master mdf and ldf to the original location and then start up SQL Server.


Monday, October 10, 2016 7:56 PM ✅Answered

yes you can do but ensure that- your new build server matches the same version and same sp what it was old instance.

along with same directory structure  for mdf,ldf .

Also please ensure if you want other databases should be online then it should match as similar to your old instance.

dont forgot to run checkdb after you all done.

1.from the new build server stop the sql server -then copy the existing the systemdb files to safer locations ,existing system db files rename to like XX_old.

2.Then copy the old instance files and place in to the appropriate directory where it was previously & verify startup parameters.

3.start the sql instance and perform checkdb

 

Regards, S_NO "_"


Monday, October 10, 2016 8:33 PM ✅Answered

It should be sqlserver -f


Monday, October 10, 2016 7:57 PM

Thanks

for some reason i am not able to bring instacne to multi user mode.

please assist

k


Monday, October 10, 2016 7:59 PM

If that works out then fine.

If not then please see other options too:

http://www.techrepublic.com/article/recover-the-master-database-in-sql-server/

https://msdn.microsoft.com/en-us/library/ms190679.aspx

Santosh Singh


Monday, October 10, 2016 8:05 PM

Thanks

for some reason i am not able to bring instacne to multi user mode.

please assist

k

Not sure,what you mean.

https://www.mssqltips.com/sqlservertip/2425/rebuilding-sql-server-on-different-hardware-after-a-failure/

Regards, S_NO "_"


Monday, October 10, 2016 8:10 PM

Go to a command prompt.

Navigate to your SQL Server instance - for example for me it is

C:\Program Files\Microsoft SQL Server\MSSQL12.MSSQLSERVER\MSSQL\Binn

Then type  sqlservr -con

SQL Server should start and give you a message as to why It can't continue.


Monday, October 10, 2016 8:27 PM

Hello,

if you have followed properly it will not give an issue,if any errorthen please check your sql errorlog-that will tel you based on that further action we have to take.

Regards, S_NO "_"


Tuesday, October 11, 2016 1:21 PM

Please share error from windows(application and system) or sql log.

Santosh Singh