How do you migrate a part of an SVN repository into a new repository?
To migrate the contents of a complete SVN repository into a new repository, one has to dump the old repository first:
svnadmin dump /path/to/repository > repository-name.dmp
and then load it into the new one using svnadmin load
.
But I'm not sure how to just migrate a part. Do I still have to dump the whole thing? Do I grep for the part that I want?
To just dump myproject
, I tried this, but it didn't work:
svnadmin dump /path/to/repository/myproject
Any ideas?
If you want to pull over part of the repository, a particular subdirectory. You'll first need to dump the entire repository, run svndumpfilter to include that directory, and finally load things into a clean repository.
Lets say you want to move directory Calc, you would do:
Then to load the Calc directory back properly you would do:
This is taken and slightly modified from the docs: http://svnbook.red-bean.com/en/1.0/ch05s03.html
When I wanted to do this, I simply did an
svnadmin dump
and ansvnadmin load
, the same as you did, then I deleted everything else out of the repo.The repo was only 3gb in size, so it wasn't such a huge deal, and for security it's not so good as you can obviously undo the deletes by rolling back, but it achieved the same thing, because I couldn't find a way to do it, with keeping the revision history.