Migrating from VSS to Git while keeping the history
Asked Answered
C

3

9

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.

Cohberg answered 6/9, 2018 at 8:20 Comment(1)
Paid solution: abstrakti.com/Products/CastellumFloury
F
6

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)

Finback answered 2/5, 2019 at 11:36 Comment(1)
For me, I had to modify the query to: UPDATE tbl_ChangeSet SET CreationDate = CONVERT(datetime, Substring(Comment, 2, PATINDEX('%[~}]%', Comment) - 2) FROM tbl_ChangeSet WHERE Comment Like '{%'Igbo
U
0

You can try https://github.com/azarkevich/VssSvnConverter, but it is not user friendly. (Despite it`s name it can convert VSS to Git)

Also this tool does not keep history of file/directory moves/renames. File will have history with latest name.

Ultimatum answered 6/9, 2018 at 14:16 Comment(0)
C
0

I've found the solution, and the programs I used do work. It's just that I tried to move too much data, so it would just glitch and not store the history. I'm not sure exactly the amount of data I can safely move, but I now have a history

Cohberg answered 10/9, 2018 at 7:3 Comment(4)
Well - you asked for help, then figured it out by yourself. How about actually sharing the solution so others may benefit from this useless (for now) thread?Prefigure
I'm also interested. What amount of data did you migrate that worked? Cant believe I am still asking question about VSS 6.0d. Did you retain your history? Can you please provide the steps.Thanks.Trioecious
People helped you when you needed help. Now help people when they need your help. Show us how you did it and share it.Mar
Hey, just to give some closure, it was during my first internship and I think it was also my first SO post, so I didn't know the etiquette. I'm sorry for that. As for what I did, I didn't do anything. When I figured this out, another guy took over and wrote a script that does it 1 piece of data by piece of data automatically. I don't know if it worked or not. I hope it helps though.Cohberg

© 2022 - 2024 — McMap. All rights reserved.