Dev Corner - Relocating Your TFS Workspace Data
Posted on Thursday October 6, 2011 by Randall Brown
I recently needed to move my local TFS source tree to a secondary drive, and for the most part, it worked quite well. First, the process I used was:
- Copy (do not move) the TFS folder -- or whatever you called it -- to path\to\new\TFS.
- In Visual Studio, navigate to your Source Control Explorer view and open the "Manage Workspaces" dialog (via Workspace combo > Workspaces...). Hit Edit next to your primary workspace.
- In the working folders treeview, Ctrl+A and Ctrl+C to copy all of the items. Paste this into Notepad and do a find-replace from path\to\old\TFS to path\to\new\TFS. Back in VS, delete the old entries and paste in your edited ones. (Just hitting Ctrl+V will append to the working folders list.)
- Click Yes when prompted to update.
- Re-open the solution from its new location and build. Check the output window to verify that the build is taking place in path\to\new\TFS. If so, you can delete your old TFS folder.
Tip 1: Deleting a massive folder like TFS is much faster if you hit Shift+Delete to skip the recycle bin.
Tip 2: You can clear out VS's list of recent projects and files, which all still point to the old path, by clearing out HKCU\Software\Microsoft\VisualStudio\10.0\FileMRUList. (Or in previous versions of VS, ProjectMRUList.)
Finally, the only issue that I ran into after migrating my workspace data was that the solution was silently placed into offline mode. (Either that, or perhaps I was already in offline mode and it never prompted me to reconnect.) If auto-checkout seems to be broken after the migration, and/or you get a warning that your source files are write-protected when you try to save them, just reconnect to source control via File > Source Control > Go online.
Don't forget to add the new location to your anti-virus' excluded folders list. Otherwise you'll likely get the elusive "file in use" errors when linking.

Cameron is a full time developer on the Camtasia Studio team. He recently graduated from Hope College and was an intern before joining TechSmith full time. You may remember him from his Dev Corner interview.


Comments (1)
This saved me a lot of time, thanks!
Posted by Bryan | March 27, 2012 4:20 PM
Posted on March 27, 2012 16:20