gitmigrationvisual-sourcesafe

Migrating from VSS to Git while keeping the history


I'm trying to convert a Visual SourceSafe Repository to Git while keeping the exact version history. So I've tried using https://github.com/trevorr/vss2git. It worked, but it didn't keep the history. So I tried using TFS as a middleman. I used The latest version of TFS and its upgrade wizard but it didn't keep the history, so I tried with TFS 2013 (How to migrate VSS 2005 to TFS 2015?) and its upgrade wizard, but still no history. I'm pretty desperate now, and I don't know where the problem lies, as I even analyzed my VSS repository, and no errors were found. I've read that I could also try using SVN as the middleman, so I'll do that, but I'm skeptic.


Solution

  • Here is the solution which worked for me a couple years ago. When I tried the mentioned vss2git, it has blown our 9GB vss database in 103GB over a weekend without reaching the end. So I took the TFS server (2010) as middleman and it worked. The TFS 2010 could import VSS database directly, I am not sure about newer ones. Simultaneously, the TFS can serve as a git remote using git-tf, or git-tfs for example. After the import, simple git tfs clone has done the second part of the business. So here you go:

    1. Get a TFS version capable of VSS import. This link can help you.
    2. Use the wizard, or command line to import your VSS database.
    3. Get git-tfs from here
    4. (Optionally) fix the commit dates - see below.
    5. Do something like this git tfs clone http://tfs:8080/tfs/DefaultCollection $/some_project

    The only quirk I can remember was that the TFS has set the date of all commits to current date and has put the original vss dates into the comments. I have fixed this directly in the SQLEXPRESS database of the TFS like this:

    UPDATE tbl_ChangeSet 
    SET CreationDate =  CONVERT (datetime, Substring(Comment,2,19), 104)
    Where CreationDate > '2014-01-28' AND Comment LIKE '{%'
    

    Please put your own date (of the last VSS comit) into the query.

    https://learn.microsoft.com/en-us/previous-versions/visualstudio/visual-studio-2013/ms253060(v=vs.120)