Tuesday 8 December 2009

Failed import of TFS 2008 to TFS 2010 Beta 2

We're running 2 Team Foundation Servers (TFS), one is our main legacy server (TFS 2008) and one is the new shiny, exciting TFS 2010 Beta 2 with it's go live license. We set up the 2010 one to play with but have become so impressed with it we (OK, I) decided to migrate the contents of the 2008 server into it.

There is a capability that comes with TFS 2010 called TfsConfig that has a lovely option "import" that should take the contents of the 2008 databases and bring them into the 2010 databases. Type "TfsConfig help import" for the precise syntax.

I tried this and it failed. During step 8 of 198.

Fine, I thought, I'll just wait for the RTM version and we'll continue to use 2008 and 2010 in parallel in the meantime. But the failed import had broken by 2008 instance. The TfsVersionControl database in the 2008 SQL Server had gone. After a lot of faffing, I worked out that it was still attached but had been renamed to Tfs_ProjectX where ProjectX was the name of the new Team Project Collection in 2010.

I detached it and reattached with the correct name. All was looking good, but the TFS 2008 was still completely dead. Turns out that there is a Guid hidden in each of the 2008 databases that tells them which TFS Instance they belong to. Unfortunately the TFS 2010 import attempt had changed the TfsVersionControl databases InstanceId. This meant I was seeing this kind of error in the App Layer event log

TF30046: The instance information does not match.

Solution to this is to reset the Instance Id across all of the various databases in the 2008 server. To do this, issue the following command:

“%TFSInstallDir%\Tools\InstanceInfo.exe" stamp /setup /install /rollback /d TFSWorkItemTracking,TFSBuild,TFSVersionControl,TFSIntegration,TfsWarehouse /s <>

Replacing %TFSInstallDir% with your C:\Program Files\.... where ever you have InstanceInfo.exe, part of TFS install. This command was taken from this link. The /rollback needs to be removed once you are happy that this works. Once the non-rolled back command has been issued, then all was well and TFS 2008 was working again.