The Migration
Today I finished migrating TFS from a VM to a newly re-purposed machine. The VM was on an overloaded host box and TFS was a bit sluggish. Yesterday, I followed Microsoft's painstaking instructions on How to Move Your Team Foundation Server from One Hardware Configuration To Another. This morning I updated our TFS build scripts so that all the file paths were valid on the new box, and then I refreshed the Version Control Cache on the build server by using the "tf workspaces /s:http://ApplicationTierServerName:Port" command (the colon after the "/s" is a needed variation on the command given in Microsoft's instructions on How to Refresh the Data Caches on Client Computers). To my dismay, when I ran a build, it failed almost immediately with an error indicating it was trying to access something like vstfs:///Version_Control/Versioned_Items, and the build notification window on the build server still showed the old TFS server name. I poked around the various TFS databases and a few other places to see if I could find the old server name, but I did not (or at least not anywhere relevant). I decided to have a look at the .config file being used by the Visual Studio Team Foundation Build service executable, and there was a setting in there for a TFS server URI, but the value was blank. The comment above the setting indicates that it overrides the setting in the registry under "HKCU". I figured that if the old server name was in the registry, I would prefer to update that than override it with the new server name. (No point in having old server names lurking around.)
Re-configuring TFS Build
After a quick search in the registry (using regedt32 of course), I found the "AllowedTeamServer" key in HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\9.0\TeamFoundation\Build\Service, and it was set to the old TFS server URI. I updated this setting (always exercise caution when modifying your registry!) to be the URI of the new TFS server (http://[server]:8080/), and then I re-started the Visual Studio Team Foundation Build service, and voila! the next build I kicked off succeeded. Unfortunately the build notification window on the build server still shows the old TFS server name, but I don't anticipate that being a problem.
Retrospective
Over-all, Microsoft's aforementioned instructions for migrating TFS to a new server worked pretty well (after muddling through the usual smattering of security issues), but the fact that properly re-configuring TFS Build to point to a new TFS server (which one would think would be a somewhat common operation, if not frequent, per se) requires a "reg hack" is a little annoying to me, and the fact that this step is not documented in the migration instructions is a significant over-sight.