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.
This problem occurs when one of the directories/files included by svndumpfilter originally was copied or moved from a section of the tree that is not being included.
To solve the problem use this script: svndumpfilter3
just ran into this problem and wrote a little script to retry dumping until all invalid source paths are resolved.
The specific commands are as follows, I am going to assume the repository is hosted on a http(s):// server, although the same commands will work for svn:// or file://.
You should now have the part you want from the old repository as the trunk of the new one.
This is a wild and crazy stab in the over-complicating-things dark but what about importing the SVN repo into git using git-svn/[tailor][3], splitting off the directory using git-split, then exporting it back to svn with git-svn?
This could potentially help you: Quote from http://svnbook.red-bean.com/en/1.5/svn.reposadmin.maint.html#svn.reposadmin.maint.replication
The Problem of course is losing the pre-rename history...
I encountered this problem and ended up using svndumpfilter2.
Specifically, this command:
I did get the out of memory error mentioned, however, since I was running svn on a VM, I just bumped the memory up to 2G. While I realize that this may not be an option for everyone, I noticed that it ran much faster than it had with 512M. (2G probably wasn't necessary).
Currently, it is processing revision 18,631.
In case anyone wonders, the reason why I needed to break out part of the repo was because we were creating tags/copies for distribution to implementation of files in another path of the repo. For some reason, this process was causing the repo to balloon to huge proportions. (We're at 17G now.)
I'm doing this on a replication repo of SVN, version 1.5.6, on Debian Lenny, 5.0.4.