I want to split a directory from a large Subversion repository to a repository of its own, and keep the history of the files in that directory.
I tried the regular way of doing it first
svnadmin dump /path/to/repo > largerepo.dump
cat largerepo.dump | svndumpfilter include my/directory >mydir.dump
but that does not work, since the directory has been moved and copied over the years and files have been moved into and out of it to other parts of the repository. The result is a lot of these:
svndumpfilter: Invalid copy source path '/some/old/path'
Next thing I tried is to include those /some/old/path
as they appear and after a long, long list of files and directories included, the svndumpfilter completes, BUT importing the resulting dump isn't producing the same files as the current directory has.
So, how do I properly split the directory from that repository while keeping the history?
EDIT: I specifically want trunk/myproj
to be the trunk in a new repository PLUS have the new repository include none of the other old stuff, ie. there should not be possibility for anyone to update to old revision before the split and get/see the files.
The svndumpfilter solution I tried would achieve exactly that, sadly its not doable since the path/files have been moved around. The solution by ng isn't accetable since its basically a clone+removal of extras which keeps ALL the history, not just relevant myproj history.
We developed Subdivision, a GUI tool designed to split svn repositories.
Subdivision analyzes the repository and calculates the history of the files as they are being copied and moved throughout the repository. Using this information, your selections are intelligently augmented to avoid all "Invalid copy source path" errors.
In addition to splitting a repository, Subdivision can be used to delete files from a repository as well as extract files and folders into a new repository.
Subdivision is free for small repositories.
Why not replicate the entire repository, dump it in to a new one. Then branch out the trunk, delete the head and merge the portions you want back in to the trunk from the branch. Then you have kept the history and split out the parts you want to a new repository.
This way you have kept all the history, and selectively picked the parts you want.
I'm also looking for an answer on this question (having to deal with it myself). Based on Alex' answer, I found http://furius.ca/pubcode/pub/conf/common/bin/svndumpfilter3.html which claims to fix some of the svndumpfilter2 issues. I believe it is a partial solution.
The good:
Concern:
If you don't need the entire history you can pick it up from just after the error. If your error was at revision 412 then you can try picking it up right after with:
I realize this may not be a perfect solution either but it may be good enough in your case.
You may want to also just do this all in one step
Stumbled onto this problem and found this tool svndumpsanitizer It seemed to work well I was able to import the file it created into a new repository.
Based on the answer by ng., but with filtering and dropping empty revisions.
Step 1. Dump and filter:
Step 2. Create new repo. (note that this can also be done e.g. with Tortoise SVN)
Remember to add whatever you need to be able to checkout (permissions and such).
Step 3. Checkout and add base folder (can also be done e.g. with Tortoise SVN)
Step 4. Load filtered dump
Step 5. Move old root to new root (can also be done e.g. with Tortoise SVN)
You should now have the part you want from the old repository as the trunk of the new one.