Brett Keown is at it again…
In TFS Developer Support, we lovingly call this process “The Big One”. It is how we rebuild the TFSWarehouse database in the database engine and analysis services from a command line. In Team Foundation Server 2008 there are a few changes as to how we rebuild the TFSWarehouse. The steps aren’t that different really, it’s just that there are a few more of them. You may need to rebuild the TFSWarehouse if you find that there is data in Team Foundation Server but it’s not showing up correctly in your reports. It is always a good idea to backup your data before going through with this. Open SQL Server Management Studio on the Data Tier and copy the TFS_INSTANCE property's value. Here’s how to do this:
WARNING: Rebuilding the TFSWarehouse database in the SQL database engine can cause lose of data for BUILD reports. See this BLOG post for more details.
1. Log into SQL Server Management Studio from the Data Tier and connect to the database engine.
2. Expand Databases and right click on the TFSVersionControl database. Choose properties.
3. Select Extended properties.
4. Copy the value listed for the TFS_INSTANCE property. Make sure you save it! We’re going to need this later.
Now we will need to rebuild the TFSWarehouse:
1. Backup and then delete the TFSWarehouse database from the database engine and analysis services.
2. Next, open a command prompt using an Administrator account and run the following. I’ll use color coding to make it a little easier to read. First I’ll use the command structure. Anything in Bold/Red needs to be replaced with your local value:
<path to setupwarehouse.exe> /setup /install –n –s “<datatier>” –d “TFSWarehouse” –c “<path to warehouseschema.xml>” –ra <domain\reportsaccount>” –a “<domain\serviceaccount>” –v –l
For my machine I used the following:
“C:\program files\microsoft visual studio 2008 team foundation server\tools\setupwarehouse.exe” /setup /install –n –s “BRETTKETFSDT” –d “TFSWarehouse” –c “C:\program files\Microsoft visual studio 2008 team foundation server\tools\warehouseschema.xml” –ra “Redmond\bktrsreports” –a “Redmond\bktfsservice” –v –l
3. Open SQL Server Management Studio. Connect to the database engine. Right click on TFSWarehouse and choose properties. Select Extended Properties. Now, add the name of "TFS_INSTANCE" without the quotes (the case is important). For the value paste the GUID in that you copied out previously. Click OK and close SSMS.
4. From the Application Tier, navigate to <http://localhost:8080/warehouse/v1.0/warehousecontroller.asmx> and invoke the run.
5. Once the status returns idle, check your reports for the last processed time and validity of data.