2

My SVN server just took a dive. I have backups, but this failure really lends itself to migrating to Git. I have a local copy of the repo checked out... The thing is, I am hoping to be able to migrate the repo to Git without loosing my 6k commit history, without having to go through all the trouble of restoring a backup....

Can I have my cake and eat it too? Or do I need to break out the backups?!

My guess is no...

jacobfogg
  • 309
  • 2
  • 9

2 Answers2

4

No, your local copy doesn't contain the commit history. If you want that, you're going to have to restore from backup.

Ernest Friedman-Hill
  • 80,601
  • 10
  • 150
  • 186
4

Depending on how your backup looks, maybe you can just get the SVN directory from the backups that can then be used to convert to git.

That is you do not need to restore the complete server/backup to convert it's history.

Edit: More info about accessing SVN directory.
Just to clarify a checked out SVN directory do not contain any history.
The SVN repository directory that resides on the server is needed to get history. This directory contains at least the conf, db directories and format file.

As long as the SVN directory (from the server) is available any svn command can be directly against this using file:// instead of svn:// or svn+ssh:// URI

Example for converting SVN to git: git svn clone file:///restore/svnservdir optional_git_dir
More about converting SVN to git

Community
  • 1
  • 1
NiKiZe
  • 1,256
  • 10
  • 26
  • yeah, I would go this way. file://-URL is the secret to success. Its also much faster to convert, too – Peter Parker Aug 26 '13 at 02:14
  • This sounds super promising! Can I do this with just a filesystem backup, or would I have needed to do a "Hotbackup" from within svn? It looks like I don't have an svn hotbackup, just the filesystem backup... – jacobfogg Aug 26 '13 at 02:19
  • @jacobfogg You just want to have the SVN directory (from the server) and as Peter mentions use the file:// URI ex on *nix: `git svn clone file:///restore/svnservdir optional_git_dir` – NiKiZe Aug 26 '13 at 02:41