Manually moving code between two TFS servers while leaving it in the same place can be a bit confusing. I was trying to guide somebody through the steps on Twitter recently and thought it might be better as a step by step reference guide, so here goes.
As a primer, if you’re not confident with workspaces and working folders, I recommend you take a look at Martin Woodward’s explanation of workspaces and his follow-up on working folders. These are both great articles and will give you a solid understanding of the way in which these concepts are used.
- Unbind from your existing server. This is done via File -> Source Control -> Change Source Control and unbind those you want to move
- Remove the path mapping from your workspace by either removing the workspace itself, or just the path you want to move if the workspace is larger than what you want to move.
- Remove the paths you don’t need mapped (or use the remove on the previous screen to remove the whole workspace)
- Change TFS servers to your target server via Team Explorer
- Pick the team projects you’d like to see. If you’re using TFS 2010 as either of your servers you’ll need to pick a team project collection.
- Map the path of the code you want to move into a workspace on the target server
- File -> Source Control -> Workspaces
- Either add a new workspace for the path, or add the path to an existing workspace
- Use the File -> Source Control -> Add to Source Control to drop the code into the target server
- Check In!
Hopefully this will allow you to move a solution about a little more seamlessly. If you require more than a basic code move (work items or history for example), you should potentially look at other solutions such as a TFS to TFS synchronisation tool.