-1

I need to remove a svn server in order to replace it with a tfs 2018 server. If it would go my way we would just take the files but apparently people still want to be able to see the history and the previous check-ins. We decided to create two Project Collections. A read only one where you can check out previous check-ins which is called [Product]GitCollection and a Collection where people should work on which is called [Product]Collection. The plan was to create a git repository out of the old svn repository and host it within the read only [Product]GitCollection. Short info. The svn repo is around 22GB in size.

This is where the problems started. I have massive issues getting the svn repository moved to a fresh git repository. I was following the msdn instruction. https://learn.microsoft.com/en-us/vsts/articles/perform-migration-from-svn-to-git They were pretty good and I was able to solve some issues with the author file (wrong enconding etc.). But now I am at a state where the git svn command is executed and he is stuck after "Initialized empty Git repository in C:/LowBudgetCopy/.git/"

git console

No message. Just nothing for 40 minutes now. I highly suspect that he had some issues but I was not able to find log files within the freshly generated git repository. I also think that it has something to do with the command --stdlayout. If I do not pass the standard layout command he at least can copy the files (with a lot of error logs). I am not that firm with the standard or required folder layout for svn or git. The current svn contains multiple projects and the folder structure itself seems to be inconsistent.

Currently the svn repository contains 4 main folder and they are structured as followed:

  • /Archive
  • /Archive/ctb
  • /Archive/ctb/branches
  • /Archive/ctb/tags
  • /Archive/ctb/trunk
  • ...
  • ...
  • ... (The archive folder is pretty consistent. Every project within archive has the same structure)
  • /Firmware
  • /Firmware/CNC
  • /Firmware/CNC/Deployments
  • /Firmware/CNC/Doc
  • /Firmware/CNC/Source
  • /Firmware/CNC/Source/branches
  • /Firmware/CNC/Source/tags
  • /Firmware/CNC/Source/trunk
  • /Firmware/CNC/Tools
  • ...
  • ...
  • ... (The projects in the firmware folder have a different depth to the ones in archive but are consistent with all the other projects within firmware.)
  • /Server
  • /Server/Deployments
  • /Server/Doc
  • /Server/Source
  • /Server/Source/Control
  • /Server/Source/Control/branches
  • /Server/Source/Control/trunk
  • /Server/Source/Device
  • /Server/Source/Device/branches
  • /Server/Source/Device/trunk
  • ...
  • ...
  • ...
  • /Tools
  • /Tools/Deployer/
  • (Direct solution. No trunk, no branches folder)
  • /Tools/FtpTester
  • /Tools/FtpTester/Source
  • /Tools/FtpTester/Source/Trunc
  • ...
  • ...
  • ... (In the tools folder it is not consistent.)

Anyone has tips or an idea?

Vampire
  • 35,631
  • 4
  • 76
  • 102
Dev86
  • 91
  • 9

1 Answers1

0

For a one-time migration git-svn is not the right tool for conversions of repositories or parts of a repository. It is a great tool if you want to use Git as frontend for an existing SVN server, but for one-time conversions you should not use git-svn, but svn2git which is much more suited for this use-case.

There are plenty tools called svn2git, the probably best one is the KDE one from https://github.com/svn-all-fast-export/svn2git. I strongly recommend using that svn2git tool. It is the best I know available out there and it is very flexible in what you can do with its rules files.

You will be easily able to configure svn2gits rule file to produce the result you want from your current SVN layout, including any complex histories like yours that might exist and including producing several Git repos out of one SVN repo or combining different SVN repos into one Git repo cleanly in one run if you like.

If you are not 100% about the history of your repository, svneverever from http://blog.hartwork.org/?p=763 is a great tool to investigate the history of an SVN repository when migrating it to Git.


Even though git-svn or the nirvdrum svn2git is easier to start with, here are some further reasons why using the KDE svn2git instead of git-svn is superior, besides its flexibility:

  • the history is rebuilt much better and cleaner by svn2git (if the correct one is used), this is especially the case for more complex histories with branches and merges and so on
  • the tags are real tags and not branches in Git
  • with git-svn the tags contain an extra empty commit which also makes them not part of the branches, so a normal fetch will not get them until you give --tags to the command as by default only tags pointing to fetched branches are fetched also. With the proper svn2git tags are where they belong
  • if you changed layout in SVN you can easily configure this with svn2git, with git-svn you will loose history eventually
  • with svn2git you can also split one SVN repository into multiple Git repositories easily
  • or combine multiple SVN repositories in the same SVN root into one Git repository easily
  • the conversion is a gazillion times faster with the correct svn2git than with git-svn

You see, there are many reasons why git-svn is worse and the KDE svn2git is superior. :-)

Vampire
  • 35,631
  • 4
  • 76
  • 102
  • Thank you vampire. I saw svn2git but I had the impression that I would have to execute it on a linux client so I skipped that option (probably too fast...). I will check it out in detail again. – Dev86 Jan 10 '18 at 15:56
  • EDIT: I mixed it up. Saw something similar too. I did not tried this one because I had to install QT for it. Still this solution seems to require linux. On the project site it says Building the Tool and they mention only linux. So no use for me. Any other ideas? – Dev86 Jan 10 '18 at 16:02
  • I use it in Windows without any problems. One option is to install Cygwin and in there build and run it. It will just be a bit faster if you would run on Linux, but it is working fine on Windows here. – Vampire Jan 10 '18 at 17:09
  • Thank you for the input. I was looking for a small, fast and simple solution. I bet installing all that stuff I will be facing a few other issues (cygwin & qt). Had way to many bad memories about compiling open source projects. There are always one or more issues (dependencies missing and what so ever). So I decided to skip the git import and build an application which is importing the svn repo directly to tfs. Should be done by the end of the day. – Dev86 Jan 11 '18 at 14:32