But it works on my PC!

The random thoughts of Richard Fennell on technology and software development

Notes from our TFS 2010 upgrade

Got time today to start our proper internal TFS 2010 rollout. This involves linking up the new TFS to our SharePoint 2010 farm and merging in the contents from 2008 TFS and 2010 RC servers.

All went fairly well, our SharePoint farm caused a few problems with its rather nice redirection feature. This  allows you to gradually move SharePoint content from an older server to a new one. A page is requested from the new server, if it is there it is used, if it is not the content on the old server is used. This caused a couple of problems during the install of TFS that content was not on the new SharePoint server so it redirected to the old one. However, the correct response was that the content was not there and TFS need to install or configure it. Once we realised this was going on there were no major issues with the TFS 2010 installation.

So we had a nice new TFS 2010 install. The next task was to move over content from the 2008 server. Our 2008 server was virtualised so I snaphot’d it, made sure we had a good SQL backup and did an in-place upgrade, and this is where I hit a problem. Our new TFS 2010 install and the 2008 were using the same central SQL server. Our new TFS 2010 install had created a TFS_Configuration DB, I had had the option to put in prefix such as TFS_2010_Configuration but decided I did not need it. This choice came back to bite me. When you do an in-place upgrade of 2008 to 2010 it rolls up all the old TFS DBs into the new structure, creating a new DB, with you guess it, the name TFS_Configuration. If you are doing a new install you can alter this DB name, but this is not the case for a upgrade, you have to use the standard name. So I was a bit stuck. The solution was to:

  1. take my new TFS 2010 server temporarily off line
  2. rename the TFS_Configuration DB
  3. do the in-place upgrade on the new 2008 server to 2010, so it creates as new TFS_Configuration DB
  4. detach the newly upgraded Team Project Collection on the TFS admin console
  5. take my upgraded TFS 2008 server off line
  6. rename its TFS_Configuration DB (if really confident you could delete it)
  7. rename the original TFS_Configuration DB back
  8. restart the main TFS 2010 server
  9. attached the upgraded TPC in the TFS admin console

Simple really !

TF237195 error when creating a new team project

After upgrade TFS 2010 RC to RTM you might see a problem when you try to create a new team project. The creation fails with error:

Module: Engine
Event Description: TF30162: Task "Queries" from Group "WorkItemTracking" failed
Exception Type: Microsoft.TeamFoundation.Client.PcwException
Exception Message: TF237195: The following user name is not supported: [SERVER]\$$PROJECTCOLLECTIONADMINGROUP$$

The answer is simple, but I had missed it!

Make sure that you are creating your new team project from a copy of the 2010 RTM version of Team Explorer. If you use the RC version you will see the error.

TFS 2010 RC –> RTM upgrade problem with the warehouse

I recently did an in-place upgrade of a TFS 2010 RC  to RTM box. All appeared to be going fine, all the verification in the upgrade wizard passed, but when I hit configure the first step failed. It said there was a missing  dbo.sysobjects in the warehouse DB. I then had to resort the configuration DB as it was partly upgraded to try again as the DB was left partially upgraded.

I got round this problem by telling the upgrade to ignore the reporting side of TFS. The upgrade completed without issue. I was then able to re-add the reporting via the TFS administration console (optional configuration of features in 2010 is really useful!). I actually chose to recreate the warehouse DBs anew to make sure I was bringing over no corruption. Once TFS had rebuild all the DBs and cubes all was working fine.

So the technical tip: if upgrading TFS 2010 and you are getting a problem with the reporting sub system, consider bypassing the upgraded and just rebuilding that system when you are finished

[Update 19th May 2010] 

Saw the problem again today on another site going a RC->RTM upgrade. the exact error message you get is

Exception Message: TF255356: The following error occurred when configuring the Team Foundation databases: Error occurred while executing servicing step Upgrade Warehouse for component Tfs2010WarehouseBeta2ToRTM during Tfs2010Beta2ToRTM: Errors in the metadata manager. The dimension with the name of 'Work Item Tree' already exists in the 'Tfs_Analysis' database.

TF246064 upgrading TFS 2010RC to RTM

I have a basic installation of TFS 2010 running on my Windows 7 laptop. This is really useful for testing build customisation and the like, a great new feature for 2010. Today I got around to trying to upgrade it from RC to RTM, but on the verification test I got the error

[ Configuration Database ] TF255407: An error occurred while attempting to validate the configuration database. Error message: TF246064: No database could be found for the following host: TestCollection. The host has the following ID: eaf3c572-8657-4268-9852-3d73a799cdf5. To fix this problem, use the TFSConfig RemapDBs command-line tool and make sure that you specify the SQL Server instance that contains this database.

Turns out I had been a bit stupid. I had created a couple of test team project collections (TPC) whilst testing some attach/detach scenarios for a client. I deleted the underlying SQL DBs, but not deleted the TCP in TFS, I guess as part of some test, but for the life of me I cannot remember why.

So as the error message suggested I tried to run the TFSConfig command

C:\Program Files\Microsoft Team Foundation Server 2010\Tools>tfsconfig remapdbs /sqlinstances:Typhoon\sqlexpress /databaseName:typhoon\sqlexpress;TFs_configuration
Logging sent to file C:\ProgramData\Microsoft\Team Foundation\Server Configuration\Logs\CFG_CFG_AT_0504_090019.log
Command: remapDBs
TfsConfig - Team Foundation Server Configuration Tool
Copyright (c) Microsoft Corporation. All rights reserved.
The Team Foundation Server configuration could not be reconfigured. The following errors were encountered:

TF246064: No database could be found for the following host: test1. The host has the following ID: 4e9b737a-b666-48f4-9411-20249aed7ae0. To fix this problem, use the TFSConfig RemapDBs command-line tool and make sure that you specify the SQL Server instance that contains this database.
TF246064: No database could be found for the following host: TestCollection. The host has the following ID: eaf3c572-8657-4268-9852-3d73a799cdf5. To fix this problem, use the TFSConfig RemapDBs command-line tool and make sure that you specify the SQL Server instance that contains this database.

So the same error as the upgrade wizard. I also tried detaching and deleting the TCP, but got:

C:\Program Files\Microsoft Team Foundation Server 2010\Tools>tfsconfig collection /delete /collectionName:TestCollection
Logging sent to file C:\ProgramData\Microsoft\Team Foundation\Server Configuration\Logs\CFG_TPC_AT_0504_090828.log
Command: collection
TfsConfig - Team Foundation Server Configuration Tool
Copyright (c) Microsoft Corporation. All rights reserved.
Could not find file 'C:\Program Files\Microsoft Team Foundation Server 2010\Application Tier\Web Services\web.config'.

But this failed as I had already removed the 2010RC instance, so there was no web.config to read.

So what to do?

I opened SQL Management Studio and connected to my local SQL instance, open the Tfs_Configuration DB and found the tbl_ServiceHost table. I then removed the rows that referenced the TPC that had I deleted the DB for. Of course I had made sure I had a backup of the DB before I started.

Once this was done the upgrade wizard passed verification and completed without error.

Now I would not recommend this as a good way to work, but it did get me out of a hole. In my case it was only a test system so if I lost it, it was not that important. However it is good to know there is a reasonably simple solution address problems with missing TPC DBs

Technical Tip: Make sure all your TPCs are valid before you start the upgrade process, so you don’t see this issue in the first place!

Speaking at Developer Day South West

I have just heard I will be speaking at Developer Day South West on June the 5th. My subject is Using the new Developer and Test features of VS 2010 to track down and fix bugs, this is basically the same session as I have at our TechDays fringe event yesterday.

Hope to see you there

DDDSouthWest2BadgeSmall[1]

Useful tool to move Reporting Services reports between servers

When you are moving TFS contents around between servers, as many people will be doing as they implement new 2010 servers and want to make use of Team Project Collections; you often have to move Reporting Services reports. In many cases you find people have lost their customised .RDL files they uploaded in the first place, and don’t want to restore the whole Reporting Services DB.

So how to extract an RDL file from a Reporting Services instance and moving it to a new Reporting Services instance?

Well have a look at Reporting Services Scripter, make makes the process fairly straight forward.

Down in London for TechDays

I am down in London for the first two days of the Microsoft TechDays event. First day has been very interesting, there seems to be a good buzz over the new testing features. So it looks good for my session tomorrow when I will be presenting on Lab Manager hope to see you there.