Splitting up an SVN Repository
Asked Answered
E

1

6

so when trying to set up an SVN server I somehow managed to make our repositories folder a single repository, and every repository created after that was treated as part of that repository. Now I have a multiple projects living in one repository that need to be separate. Is there a way to separate these folders out into separate repositories?

EDIT: it seems like this could be done with svnadmin dump and svnadmin load but I can't figure out how to dump a folder within a repository, instead of dumping the entire repository.

Equinoctial answered 22/6, 2011 at 19:5 Comment(2)
#5580036Masterly
@Masterly that seems a little helpful, but I don't think that they are in seperate branches, but instead in just different folders, all in the trunk. I'll update my question to clarify.Equinoctial
P
11

You do a svnadmin dump of the entire repository, but when you do your load, you use svndumpfilter to filter out the parts of the repository you don't want to load.

You'd use it like this:

$ svnadmin dump svn_repos > svn.dump  #Entire repository
$ svndumpfilter include "foo" < svn.dump > foo.dump #Filter out just "foo"
$ svnadmin load --parent-dir / svn_foo_repos < foo.dump  #Load "foo" in own repos

I haven't used it in a while, so my memory might be a bit rusty, but the Subversion Red-Bean book is pretty good.

Padrone answered 22/6, 2011 at 20:51 Comment(3)
this sounds like a good solution. I was messing around with it and had a similar idea, but I was filtering the output of svnadmin dump to make multiple dump files, but this seems like a better way of handling it.Equinoctial
Beware though that I think with this method the revision numbers may be renumbered when re-loading. This may not be important to you, but if you rely on the existence of particular revision numbers (eg you've used them in your bug tracker) then this could be problematic.Chaw
Ah - in fact I've just noticed that svndumpfilter now has a --preserve-revprops flag for this very purposeChaw

© 2022 - 2024 — McMap. All rights reserved.