1

Given that googling showed absolutely no hits I think I know the answer to this question (which is "no you can't do that") but just to be sure...

I used svn dump to backup a subversion repository. Now I want to do an svn load on a different server with a new install of subversion of that backup. But the catch is...I only want to restore a specific branch not the whole repository.

Is that possible with svn load or some other tool?

I already found this SO question...

How do i dump a specific subversion path from a berkeley db?

This accomplishes the same goal (and I can definitely do that if all else fails but I am trying to save some time). With that post you dump only what you need and then do a straight up Load. I want to only load what I need from a full dump.

EDIT
Thanks for your feedback. But I am still not getting it.

  • I have a dump file located at e:\svnBackups\repoBackup.svn
  • I have all of my new repos at e:\Repositories
  • I want to only restore a single branch of e:\svnBackups\repoBackup.svn.
  • The branch I want to restore is at productionRepo/Projects/Branches/MyCoolBranch in the backup.
  • I want the new repo (on a new server) at e:\Repositories\newRepo

Using this information, what command line command do I type to make it happen?

Seth

Community
  • 1
  • 1
Seth Spearman
  • 6,710
  • 16
  • 60
  • 105
  • Looking at your edit. Are you saying that you want to restore that one branch into a CURRENT that already contains the other branches, plus the trunk, and the tags? – David W. Mar 27 '12 at 20:49

2 Answers2

0

Um... wouldn't

svndumpfilter include BRANCH_PATH DUMP_FILE | svnadmin load REPOSITORY

do this, or am I misreading the question somehow?

AKX
  • 152,115
  • 15
  • 115
  • 172
  • Yes...you are mis-reading the question. I have a FULL DUMP and want to only load a BRANCH. Seth – Seth Spearman Mar 26 '12 at 20:57
  • Um, okay. But if you have a full dump, `svndumpfilter` can be used like above to filter out the revisions that don't involve the branch you want... and then that's piped into `load`, which should give you a repo with only that one branch. But if you need to load that branch as if it was `trunk`, then you'll also have to write something to rewrite the paths in the filtered dump... – AKX Mar 26 '12 at 21:00
  • OK...let me research svndumpfilter...maybe that will do it? Seth – Seth Spearman Mar 26 '12 at 21:04
  • AKX...I have edited my question...do you think you could take a look? – Seth Spearman Mar 27 '12 at 18:57
0

svndumpfilter will allow you to only keep that one branch just as AKX pointed out. In fact, you can do it in one go:

$ svnadmin dump $old_repos | svndumpfilter include $branch_path \
   | svnadmin load --force-uuid $new_repos

The only issue is that branch will be a branch, and you'll have no trunk or tags. Of course, you can simply rename the branch to trunk.

You might be able to use the svnadmin load --parent-dir to move your branch to the trunk during the load. You'll have to experiment with it.

David W.
  • 105,218
  • 39
  • 216
  • 337