2

I have a Subversion repository that has several projects in it. I would like to 'slice off' one or more of those projects and move them to their own repositories, ideally with full fidelity (i.e. keeping all the version history intact).

Is this even possible? If so, what's the technique?

EDIT/Clarification: I know about branches and tags. That's not what I'm asking. I want to take an existing repository and split it into several smaller repositories, possibly on different physical media.

Tim Long
  • 13,508
  • 19
  • 79
  • 147

1 Answers1

2

First get an up to date dump of your SVN repository:

svnadmin dump repo/

Next, filter the repository, using something like

svndumpfilter include --drop-empty-revs --renumber-revs trunk/myProj1 trunk/myProj2

Then, create the new repo, and add in trunk, tags, and branches directories (the step after this will fail without those 3 dirs):

svnadmin create newRepo
svn co file:///tmp/newRepo newRepo-checkout
svn mkdir newRepo-checkout/trunk/ newRepo-checkout/branches/ newRepo-checkout/tags
svn commit -m "Core directory structures created" newRepo-checkout/

With those 3 directories in place one can now load the dump:

svnadmin load newRepo

Once the load is complete, you can start using your new repo!

A few tutorial links:

http://grumbel.blogspot.com/2008/09/splitting-svn-repository.html
http://2tbsp.com/node/88

chown
  • 51,908
  • 16
  • 134
  • 170
  • Yes, but I don't think you've understood the question. Your example shows how to create a branch _in the same repository_ which is not at all what I asked. I want to take an existing repository and split it into several smaller repositories (possibly on physically different media). – Tim Long Nov 10 '11 at 02:51
  • Ah, in that case you would want to get a dump of the repo, then use svndumpfilter to get only what you want out of the repo, then with your new split repo, use svn load, to load the filtered dump. Here are some good tutorials: http://grumbel.blogspot.com/2008/09/splitting-svn-repository.html , http://mikemason.ca/blog/2005/10/splitting-merging-and-organizing-a-subversion-repository/ – chown Nov 10 '11 at 03:15
  • Updated answer to provide the steps – chown Nov 10 '11 at 03:23
  • +1 Thanks, will try ythis and accept your answer once I have it working. – Tim Long Nov 12 '11 at 05:16