Sunday 29 April 2018

Visual Source Safe (VSS) to TFS Migration

In modern software development usage of only a source control mechanism would not add value to the software delivery process. However, some organizations still using Visual Source Safe (VSS) to manage their source code, but it is unsupported tool as of now and they should consider moving their code bases to a different tool. As a fully DevOps capable ALM tool TFS is a good choice to move the code from VSS. Let’s look at the steps required to perform such a migration of VSS code, including history.


Ask all your teams to check in their source code to VSS.

Next step is taking a backup of VSS. Before doing that ensure you are using Visual Source Safe 6.0 or later. To get the backup go to the VSS machine and find the path the VSS is setup (this is usually c:\Program Files(x86)\Microsoft Visual Studio\VSS), then copy the files and folders named below.

  • data folder
  • temp folder
  • users
  • srcsafe ini file
  • users text file01

Make sure to copy them to a single folder as shown below.02

You should setup a machine with one of below OS as per the documentation.

  • Windows 8
  • Windows Server 2012
  • Windows 7
  • Windows Server 2008 R2

Using Windows Server 2016 gave no trouble so you can also use the same as well if needed. In this temporary upgrade computer install an instance of SQL Server. SQL Server 2012 and 2014 tested and works fine for this requirement. Make sure in this intermediate machine you have free disk space of 2 times of your VSS backup + 5GB or more.

Install Visual Source Safe 2005 in your intermediate machine.

Download the Visual Source Safe upgrade tool for the Team Foundation Server and install it in the temporary machine you setup to do the upgrade work. Now copy the backup of the VSS you created previously to the intermediate machine. It is strongly advised that you should not use your VSS server or the Target TFS server as the intermediate machine.

Open up the upgrade tool and provide the backup folder path and the VSS admin user password. Then click List Available Projects, which will list all the projects in VSS, in the tool as shown below.03

You might run into below error when you click on List Available Projects, if your intermediate machine does not have Visual Source Safe 2005 installed in it.

---------------------------

VSS Upgrade Wizard

---------------------------

Unable to cast COM object of type 'Microsoft.VisualStudio.SourceSafe.Interop.VSSDatabaseClass' to interface type 'Microsoft.VisualStudio.SourceSafe.Interop.IVSSDatabase'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{2A0DE0EE-2E9F-11D0-9236-00AA00A1EB95}' failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)).

---------------------------

OK 

---------------------------

In your target TFS (tested VSS migration with TFS 2017.2 and works fine) create a new Team Project, or multiple projects if you want to move each VSS project to different TFS team projects. Select the required VSS project to migrate and click next. In the next step add the TFS server and select the required team project as target.04

05

In the next step select option to migrate the full history if you want the TFS tem project to have all the source control checkin history of VSS, otherwise you can just migrate the latest version of code by selecting tip. Since there is a difference between how changes to code are identified in VSS and TFS, the changesets of of TFS might contain multiple changes from VSS. Generally files updated by same user within few minutes with same comment in VSS  would be grouped as a changeset in TFS when the migration happens. Further information on this is available here.06

Review all setting and run the readiness checks next.07

08

Run the upgrade to perform the migration.09

The details of issues can be found by clicking next and clicking on the link to open the log. 10

The issue in this particular instance was that the files were checked out in VSS and that checkout status has not been preserved in TFS. To avoid such warning make sure to checkin all code to VSS before taking a backup for migration.11

Upgrade report link shows the details of issues etc. in a web browser in a more clear format.12

You can find your source code in TFS with history. The comments will be prefixed with date time information of original date of checkin happened in VSS. In multiple changes are grouped into one changeset situations the begin and end time of change would be added as comment prefix as shown highlighted below. This mechanism is used as TFS changeset is having a created date of the day which the migration happened.13

14

No comments:

Popular Posts