This site is my way to share my views and general business and IT information with you about Microsoft, IT solutions for ISVs, technologists and businesses, large and small.  
How to change where SQL Server looks for it’s master datafiles (master.mdf)

I’ve found myself moving datafiles around or backing up to new locations before enough that I need to change SQL to point to the new locations before it will start for me to do further work.  The process to get it up and running is to find the SQL instance in the registry and change 3 values.

The magical location is: “HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL10.<instance>\MSSQLServer\Parameters”

Under here you will file 3 arguments.  Notice the double backslashes “\\” which is required for each single backslash you want.  For example, for my site, I have changed them from the default instance pointers to:

"SQLArg0"="-dD:\\databases\\Community Server\\master.mdf"
"SQLArg1"="-eD:\\databases\\Community Server\\ERRORLOG"
"SQLArg2"="-lD:\\database_logs\\Community Server\\mastlog.ldf"

Change these to the location of your datafiles.  The “-d” is for the master database datafile, “–e” for the Error Log and finally “-l” for the log for the master database.




Posted Sun, Dec 7 2008 8:17 PM by David Overton

Add a Comment

Remember Me?

(c)David Overton 2006-21