1

I have a subversion repository located on our school servers from a project my friends and I worked on the past semester. We want to take the project and polish it and make it more of a portfolio item and I'm not quite sure that the repo will stay intact on the school servers (they usually wipe it after a few semesters). I don't have access to dump the repo, although I've sent an email to see if I can get one - which would be the best solution.

I tried svnsync but the school server doesn't support the replay command (probably turned off), so that won't work for me.

Now, theoretically, wouldn't it be possible to (manually or programmatically) checkout each revision of the repository and check it in to a new repository on our own server? I think it would work - there's only 3 of us, and there's no working copy conflicts that we'd have to worry about, just want a copy of all the history in the repo in case we need to go back and look at it.

That being said, before I go and reinvent a wheel by writing a script to do it - does something like this already exist? I have to figure there's already a tool to do it, or that someone has wrote a script to do it.

Kevin Reid
  • 37,492
  • 13
  • 80
  • 108
Corazu
  • 140
  • 10
  • You could import your svn repo to git and clone it as many times as you want :] – Alex Apr 13 '10 at 06:14
  • I don't really want to switch over to git though. I'm looking at SVNKit (https://wiki.svnkit.com/Replicating_An_Existing_Repository) which might have exactly what I'm looking for. – Corazu Apr 13 '10 at 06:15

4 Answers4

0

Read access to a subversion repository should always be enough create a clone of that repository with the help of svnsync. A short example how to do this:

svnadmin create new_repos

Create hook script new_repos/hooks/pre-revprop-change with something like

#!/bin/sh
exit 0
#

Do not forget to make it executable

chmod u+x new_repos/hooks/pre-revprop-change

Then initialize an synchronize:

svnsync init file:///PATH/TO/new_repos https://old_repos/trunk/subfolder
svnsync sync file:///PATH/TO/new_repos https://old_repos/trunk/subfolder

Test your new repository

svn co file:///Users/bjoern/test/new_repos new_working_copy

And do not forget to remove the hook script

rm new_repos/hooks/pre-revprop-change

More details about repository replication can be found in the svn book.

BHF
  • 748
  • 7
  • 19
0

If you'd be willing to use Mercurial – which a) isn't terribly far away from Subversion, command-wise, b) would prevent this kind problem, and c) is actually fun to work with* – you can use the convert extension. It comes built into Mercurial, you just have to activate it.

* I think so, anyway

balpha
  • 50,022
  • 18
  • 110
  • 131
  • Again, not looking to switch at the moment - I'm comfortable with subversion at the moment ;) Although I might take a look at it. I think I may have found a solution but it's late so I'll probably give it a whirl tomorrow. – Corazu Apr 13 '10 at 06:24
0

You didnt specify how many revisions you have approximately in your project. And a script based check out for each revision is possible. But it is not realistic, because of all the ".svn" folders created for each folder. Because of them, you

  1. Would either need another script do a recursive delete of these files, before another script can check it in.
  2. Or, for each revision do an svn export, and then write another script that will check it in.

As you can see its not feasible. And I do not know of a script to do this.

You can however do a number of exports from the repo, each one of the most important commits, and then add them to your new repository. If there are less number of revisions then it should be easier.

omermuhammed
  • 7,365
  • 4
  • 27
  • 40
  • Given enough time to export all revisions, why wouldn't it be possible? – sbi Apr 13 '10 at 07:28
  • There's only 162 revisions and not all that many folders..I don't think it would take that long or be that difficult. – Corazu Apr 13 '10 at 14:12
0

I tried svnsync but the school server doesn't support the replay command (probably turned off), so that won't work for me.

I guess that svnsync didn't work then because of some minor issue; neither svnsync nor svnrdump require any server-side modifications to work!


If you have at least Read Only access to Subversion repository via HTTP(S) or svn(+ssh):// then you definitely can get the complete revision history using svnsync or svnrdump tools.

svnrdump approach.

Just run the command and wait till it completes:

svnrdump URL-TO-ORIGINAL-REPO > repo.dump

In the result you will get repo.dump file that contains the complete history of changes. You can load the file to empty repository later using svnadmin load command.

svnsync approach.

All steps should be performed on your (local) machine:

  1. Create new repository: svnadmin create newrepo,

  2. Allow to change revision (unversioned) properties of the new repository:

    echo exit 0 > myrepo\hooks\pre-revprop-change.bat

  3. svnsync init file:///C:\Repositories\newrepo https://URL-TO-ORIGINAL-REPO

  4. svnsync sync file:///C:\Repositories\newrepo https://URL-TO-ORIGINAL-REPO

Community
  • 1
  • 1
bahrep
  • 29,961
  • 12
  • 103
  • 150