Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have a SVN repository which was running locally when I had an old installation of Windows. After reinstalling Windows, obviously the old SVN server installation was removed, and now I have no idea how to still use this old repository? I haven't tried the svn create on the old server, as I am afraid that I'll lose everything in the repo?

I need to either still be able to use this using any SVN server software, or convert it to git. Either is fine!

Any help would be appreciated.

share|improve this question
    
Your question is unclear. Did you have the repository and your sole working copy on the machine that was reinstalled? If so, how could you possibly expect to reconstruct data that was deleted? –  200_success Feb 15 '12 at 10:38
    
The repository itself wasn't deleted, but windows (along with its program files) were removed, so I'm just trying to reconstruct the repository from the original repo (where I did svnadmin create /path/to/repo the first time round). –  Hosh Sadiq Feb 15 '12 at 19:39

2 Answers 2

up vote 8 down vote accepted
+50
  1. Make a copy of the SVN repo somewhere
  2. to be safe, create a dump from that

    svnadmin dump "C:\PATH\TO\REPO" > "C:\svnrepo.dump"

  3. Create a new repo like you used to (e.g. svnadmin create "C:\SomeRepo")

  4. Load the dump to the new repo

    svnadmin load "C:\SomRepo" < "C:\svnrepo.dump"

I don't have windows at hand so I could not verify the '<' '>' usage but that's basically it. Do note that you might have to give full path to svnadmin.exe in your system unless it's in your %PATH.

Windows subversion example

Windows subversion download link

share|improve this answer
    
I'm getting this error: svnadmin: E140001: Malformed dumpfile header '?\255?\254S' when I do step 4, any ideas? I've Googled already but without any luck. –  Hosh Sadiq Feb 15 '12 at 19:36
    
It looks like the file has UTF-16 byteorder marks @see en.wikipedia.org/wiki/Byte_order_mark I don't know why the dump and load create that kind of problem for you, but get your self textpadtextpad.com/download With that I think you can open your dump file and save it with different format (or try to remove byteorder marks). Can't really help you more.. not on windows at the moment –  Manwe Feb 15 '12 at 19:56
    
Great cheers! I'll mark this as accepted! At least now I know a way. :) –  Hosh Sadiq Feb 15 '12 at 19:58

Manwe has given you a great answer to your question body (getting you back to a point where you should be able to access your SVN repository again).

I would go a step further and say that after you do that you should definitely give serious consideration to switching to git. You will have a working SVN repository, so you can use the tools that come with git to suck in the SVN repository and create a new git repo, and you have the git-svnserver that comes with git that lets you emulate SVN if you have developers who can't make the move yet.


Among the advantages of moving to git:

  • Every developer has a full copy of the repository. They can commit locally and delay pushes if the server is down.
    (So if you reinstall Windows and lose the server for a few days like what happened this time development can continue)

  • Every developer has a full copy of the repository. These are effectively a distributed backup.
    (Don't rely on it as such, but in a crisis any checkout can be declared to be the "origin" repo).

  • git is just better than SVN
    (OK, that last one is my opinion, but pretty much every developer I've worked with agrees -- Linus got version control right with git. It really is a pleasure to use once you get accustomed to the commands.)

Further reading on migrating from SVN to git: git ready: Converting from SVN.
Google will also throw out a plethora of results for Converting from SVN to git or similar queries.
I also consider "A successful git branching model" to be required reading for people moving from CVS (and to a lesser extent SVN) -- Branches in git are a good (and painless) thing.

share|improve this answer
    
I've already planned to switch to git, however, need to recover from this first. Thanks anyway! :) –  Hosh Sadiq Feb 15 '12 at 19:37

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.