Saturday, February 25, 2006

Upgrading form VSS to VSTS

VSTS comes with a dedicated utility for migrating VSS database into VSTS Source Control
C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\VSSConverter.exe

There is 2 things you must know before go into migration...

  1. You must have Visual SourceSafe 2005 installed on the machine you're running VSSConverter from. Unfortunately, VSSConverter has some dependencies on DLLs in VSS 2005. You can uninstall VSS 2005 once you're done with the migration, but you must have it installed when running VSSConverter.

  2. You must have SQL Express installed and enabled on the machine you're running VSSConverter from. This isn't exactly obvious from the documentation, but VSSConverter uses the local SQL instance as a scratch database during the conversion. If there's no local scratch database, the migration will bomb with cryptic SQL errors.

VSSConverter have two primary commands: analyze and migrate.

Instead of passing a bunch of cryptic command line switches, you'll pass a bunch of slightly-less-cryptic XML.

VSSConverter analyze settings.xml will start Analysis
Sample of the XML template used for analysis
<?xml version="1.0" encoding="utf-8"?>
<SourceControlConverter>
  <ConverterSpecificSetting>
    <Source name="VSS">
      <VSSDatabase name="d:\vss-test\"></VSSDatabase>
    </Source>
    <ProjectMap>
      <Project Source="$/" ></Project>
    </ProjectMap>
  </ConverterSpecificSetting>
</SourceControlConverter>


Run the VSSConverter for analysis and you'll get the Analysis Report containing how many files analysis done for and list of errors and warnings found during analysis.

After Analysis is complete, and hopefully nothing major is there you can go on to the Migration process...

VSSConverter migrate settings.xml will start Migration
Sample of the XML template used for migration
<?xml version="1.0" encoding="utf-8"?>
<SourceControlConverter>
  <ConverterSpecificSetting>
    <Source name="VSS">
      <VSSDatabase name="d:\vss-test\"></VSSDatabase>
      <UserMap name="UserMap.xml" />
      <!--<SQL Server=".\SQLExpress" /> -->
    </Source>
    <ProjectMap>
      <Project Source="$/" Destination="$/Demo/Main/"></Project>
    </ProjectMap>
  </ConverterSpecificSetting>
  <Settings>
    <TeamFoundationServer name="TeamSystem" port="8080" protocol="http"></TeamFoundationServer>
  </Settings>
</SourceControlConverter>



Make sure the VSTS Destination folder you specify is empty or the Migration will fail, you can specify a folder that doesn't exists and it'll create it for you ...

Run the VSSConverter for migration and you'll get the Migration Report containing how many files migrated and list of errors and warnings found during migration.

Well ... you are migrated now ... however, VSSConverter isn't magic -- it can't convert everything. If you've used branching, sharing, or pinning in Visual SourceSafe, don't expect that to convert well...

  • Sharing is not supported in Team Foundation source control. Shared files are migrated by copying the version of the file at the time sharing began to a destination folder. From then on, the changes made to the shared file are replicated to both copies.

  • Branching a file. Because sharing is a pre-condition of branching, the migration of a shared file results in copying the file to the destination folder. After the branch event, the changes to any branch are migrated to the respective copy in Team Foundation source control.

  • Pinning is not supported in Team Foundation source control. To help you locate items in the Team Foundation source control repository that were once pinned in the SourceSafe database, the converter tool assigns a “PINNED” label to the version that was pinned.

No comments: