Disclaimer : It worked for me, and I hope it works for you, but do so at your own peril. Make sure everything is backed up and I’d suggest testing on a spare machine first before doing it for real.
We’ve been looking at changing our infrastructure at work and moving from VMWare for our virtual servers to using Windows Server 2008 and Hyper-V. The main server which needed to be moved/converted/migrated between the two different virtualisation technologies was the TFS Server; and hence my domain.
I started off by trying to convert the vmdk file to a vhd file which seemed to work well and could be mounted and the data on it read. However; I was unable to boot from it. After spending, way, too much time trying to get it working I decided to look at the migration exercise. And to be honest it was essentially a disaster recovery exercise as we’d have to go through the same steps if it all went wrong so the time wasn’t wasted.
So after doing a test run on a spare virtual machine we had before the server was taken down I fired up the install for SQL Express and started on the path to setting up TFS. After doing some Googling, and finding loads of different articles which seemed to do bits but not all of it I thought I’d post my findings to hopefully help someone in the future. These are the steps which I came up with. I have also now deployed TFS into the new virtualised production system and it seems to work fine (not got automated builds working yet tho).
Here we go:
- Backup databases from old TFS. This includes the Tfs_Configuration databases and any project collection databases.
- Build/patch new VM with Windows Server (or other OS)
- Install SQL Express 2008 with tools
- Restore databases, with the same names, into your new SQL Server instance
- Install Team Foundation Server 2010 Beta 2 (and reboot when required)
- Run the following command – making sure that you have the correct details in the right places
c:\Program Files\Microsoft Team Foundation Server 2010\Tools>tfsconfig accounts /add /accountType:applicationTier /account:"NT Authority\Network Service" /sqlInstance:.\SqlExpress /databasename:tfs_configuration - Create a local user named after the server name. So for example if your server is called “TFS” then create a local user called “TFS$” (without quotes)
- Fire up the Team Foundation Server admin, go to configure installed components and run the Application Tier only upgrade wizard
- Once in the wizard point it to the SQL instance locally and it should find the configuration database, select it and continue.
- Finish the wizard and it should be pretty happy. Next thing to do is update the server urls on the main server details page to point to the new server name (as it’ll have the old server name in it)
- Start up the project collection(s) and throw in a server restart for good measure.
- Done!
You should now be able to connect to the server through Visual Studio as before. You will need to add in the new server details (and remove the old). I found all the workspaces where fine and all was good to go.
With a big team its probably wise to get everyone to shelve all their changes over a weekend or evening and make sure nothing is checked out. But this is down to preference and may need to be tested.
Hope this helps someone in the future :-)