Thursday, October 11, 2007

Creating a test server by cloning your TFS production environment

Not long ago we created a lab environment for testing out new concepts and testing upgrades on an so on. We then had the brilliant :) idea that we should perform a clone by using the disaster recovery techniques describe in the msdn article: How to: Move Your Team Foundation Server from One Hardware Configuration to Another

This worked great and we suddenly had a realistic lab environment, atleast that's what we though. Fourtunately for us we didn't have time to do anything with this new server after we created it and some time passed. During this time we created additional team projects and everything was fine.

Imagine my suprise when we started using the test server and all of the suddenly saw the new projects on this server as well. After som digging around and talking to Microsoft support we where directed to an post by Buck Hodges that points out that the problem resides in the fact that when we restore the databases on another server we end up with 2 instances of TFS running with ther same instance ID (a guid stamped in the database). Since this guid is cached on the client it can cause all kinds of nasty issues if you access both servers from the same client.

Anyway here's howto fix it:


Clear the client cache
Delete the directory %userprofile%\Local Settings\Application Data\Microsoft\Team Foundation\1.0\Cache.

Clear the instance info
“%TFSInstallDir%\Tools\InstanceInfo.exe" stamp /setup /install /rollback /d TFSWorkItemTracking,TFSBuild,TFSVersionControl,TFSIntegration /s <your new data tier>

Create new instance info
"% TFSInstallDir %\Tools\InstanceInfo.exe" stamp /d TFSWorkItemTracking,TFSBuild,TFSVersionControl,TFSIntegration /s <your new data tier>

And here is the link to the posting Buck Hodges made about it: Creating a new server from an old one: Beware of the InstanceId

No comments:

Post a Comment