Cry about...
TFS How to notes ...

How to convert from VSS to TFS


These notes cover how to convert a Visual Studio 2012 project from VSS (Visual Source Safe) to TFS (Team Foundation Server) as the version control tool used.

Prerequisites

These notes assume that:

  • You have Team Foundation Server (2012) or the Express version installed on a server.

Before you start ensure that:

  • All edits are checked into VSS.
  • You have a complete backup of your development project. You shouldn't need it, but it is always useful to know that you have a backup to fall back on if need be.

The Microsoft way - Preserving VSS change history

Microsoft provide a tool "Visual Source Safe Upgrade Tool for Team Foundation Server" that will migrate from VSS to TFS. If you need to keep the change history then using this tool is the best way forward.

Be aware that there are some differences between VSS and TFS - TFS does not support shared files or pinning. To learn more about how to use this tool see the following Microsoft article: Upgrade from Visual Source Safe.

The manual way - does not preserve VSS change history

If you do not need to preserve the change history in VSS then you can simply remove the bindings to VSS and add it to TFS.

1. Remove the bindings to VSS.

There are two ways to remove the bindings to VSS. You only need to do one of them!

In Visual Studio 2010 go to the File menu, then File → Source Control → Change Source Control ... this will open the "Change Source Control" dialog which is where each project is bound to a location in VSS. For each project click "Unbind". You must do this for each and every project - as you cannot have some projects in VSS and others in TFS, all must be in one or the other.

Alternatively, with Visual Studio closed:

  1. Delete ALL the .scc files for the solution. This includes all .scc files that you may find in any sub-folders.
  2. Open the solution (.sln) file in Notepad and delete the entire section "GlobalSection(SourceCodeControl)".

    This starts with "GlobalSection(SourceCodeControl)=" and ends with the line "EndGlobalSection".

    Save the solution file.

  3. According to xisco rossello posting on http://stackoverflow.com/questions/16701514/vss-to-tfs-solution-issue there are two other steps, but found that I didn't need these:
    • Delete from the solution file the lines:

      ProjectSection(WebsiteProperties) = preProject

      SccProjectName = ""
      SccAuxPath = ""
      SccLocalPath = "."
      SccProvider = "MSSCCI:Microsoft Visual SourceSafe"

    • Open each project file (.vbproj and .csproj) in notepad and remove the tags:

      <SccProjectName>SAK</SccProjectName>
      <SccLocalPath>SAK</SccLocalPath>
      <SccAuxPath>SAK</SccAuxPath>
      <SccProvider>SAK</SccProvider>

2. Bind it to TFS.

With the bindings to VSS removed, open the solution in Visual Studio.
  • Connect to TFS. On the top menu: View → Team Explorer. The top menu on the dialog has an item which allows you to  "Connect to Team Projects".
  • Optional: On the menu View → Other Windows → Source Control Explorer. If you are new to TFS then Souce Control Explorer will show your server name and the name of the collection but otherwise won't show a tree view. The first thing you will need to do is to create a team project under which your software will reside. In "Team Explorer", on the top menu there is a down arrow click on that and a menu should appear, select "Projects and My Teams →  New Team Project ...". This will allow you to create a project under which you will be able to add your software. Personally I only have one project under which I manage all of my real projects.
  • Optinal: Since all of my software exists under one physical folder on my hard drive, I like to reflect this in TFS (much like it was in VSS). So in "Source Control Explorer" right click your project (the first node under the server name) and select Advanced → Map to Local Folder... This allows you to select where on your local drive that project will logically map to.
  • In the "Source Control Explorer" you can now add your existing projects. Right click your project, and select "Add items to folder". If you have your "Map to Local Folder" set right then it should open up at the right place on your drive, otherwise you may have to navigate to it. Select the folder you wish to add - it will also add everything under it. Be aware that you haven't added them, you have just queued up that you want to add them. To finish adding them go back to "Team Explorer" and click [Check In].
  • Ensure that you have the "Source Control - Team Foundation" tool bar is visible. If you right click in the menu area (but not on an item) then a menu will appear showing you which toolbars are available and which you have enabled.
  • Click on "Change Source Control" toolbar icon - be sure that this is the one beloning to the "Source Control - Team Foundation" menu bar and not the "Source Control" which is for VSS. You can then assign for each Visual Studio project where it maps to in TFS. Possibly because my project names and real folder names tend to map closely I found that the suggestions TFS made meant that this was very easy task.

These notes are believed to be correct for Visual Studio 2012 connecting to Team Foundation Server 2012, and may apply to other versions as well.



About the author: is a dedicated software developer and webmaster. For his day job he develops websites and desktop applications as well as providing IT services. He moonlights as a technical author and consultant.