27 March 2008

Install the TFS databases to a different drive

Another in a long line of FYI posts (or should that be FMI - For MY Information)

I'm doing a clean TFS 2008 install at a client this week.  They want to install in a dual-tier configuration with the Data tier on their existing SQL Server 2005 box.  As is usual in most organizations, the SQL box has multiple drives with different uses.  The C: drive is for the OS and apps, D: is the "data" drive, E: for backups, etc. 

A question arose when they asked me to make sure that the TFS and Sharepoint databases install to their D: drive as so that it follows their conventions.  I did a little research in the TFS 2008 install guide but couldn't find any way to direct the installer to create the databases in a specific location.  After a bit of Googling (or should that be Live Searching?) I found a post from Brian Harry back in December that addresses this.

Basically, TFS will install the databases wherever the Master database is located.  To get it to onto a specific drive you have 2 options,

1. Install to the default location and then move the databases by hand (Brian has the steps in his post).
2. Move the Master database to the target drive and then install TFS (These steps are there too).

My recommendation?  If you have the space on the default (Master located) drive, install there and then move to the preferred one.  Mucking around with moving Master around is not worth the trouble.

It looks like Maor David has a good recipe for doing this on his blog.


Greg said...

#1 was the approach I used when installing TFS2005 a couple years ago (TFS SQL Databases Moved... One Tip, Remember the DB Owner) and it's worked seemlessly since then... including during our upgrade to TFS 2008.

Detach/move/attach was quick and easy (just remember to set the DB Owner to the right account).

George said...

Another way to do that is to make sure that SQL Server's default data drive and default log drive point to where you want them. If you don't change them the defaults default to the log and data directories where SQL is installed.

I don't know if TFS seeks out the master database or just picks up the defaults. Depending on the number of drives and RAID type I would put the data files on different drives from each other.

Post a Comment