We have a Subversion repository with one directory that is:
Although I know that high revision numbers aren't a problem, nonetheless I'd like to pull this one single directory out of my main repository and into a second, ideally new one.
What is the best process for that? If it makes a difference, the SVN repository is hosted on a (... checks... ) FreeBSD machine.
It's worth noting that while I need to retain the version history in the new repository, there's no need to obliterate the content in the old; it can just sit there, for all I care.
You could use svnadmin dump and svnadmin load to create a new repository from the original one; then copy the directory that doesn't really fit into your scheme to a better location, then delete everything else. In the original repository you would simply delete the non-fitting directory. This keeps all history intact, and you end up with two repositories.
There is probably a way to subsequently clean both repositories from the then useless parts of the history (svndumpfilter), but since hard disc space is quite cheap I wouldn't think this necessary. Anyway, the SVN documentation has all the information about it.
The recommended way to do this is to use svnadmin dump
, then filter the dump file with the svndumpfilter
tool (see svnbook).
For example, I had a repo with a top-level directory named 'Model', which I wanted to move to its own repo:
svnadmin dump my_orig_repo | svndumpfilter include --drop-empty-revs --renumber-revs Model >model_only.svndump
svnadmin load my_model_repo < model_only.svndump
That creates the new repo with only the Model subdirectory.
For removing it from the original repository, you can simply do an svn rm
. This will remove it from the latest version of the repo, and is the simplest way.
But if the Model directory from my example was very large, maybe I would have wanted to remove it entirely from the original. I could do that by repeating the process to create another filtered svn dump file that excluded it instead. Then I would replace the original with the new one that did not have the excluded directory.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With