I have a "docs" folder in a Subversion repository named "project". I've come to the conclusion that it should really be kept under a separate Subversion repository named "project_docs". I'd like to move the "docs" folder (and all of it's revisions) to the "project_docs" repository. Is there any way to do this?
views:
6305answers:
5I don't believe you can do it remotely (i.e., without a local copy). But this should work: svn export
the folder from the original server, then svn add
it to your new repo.
Like:
$ svn checkout svn://example.net/newrepo .
$ svn export svn://example.com/oldrepo/mydir ./mydir
$ svn add ./mydir; svn commit
Edit: D'oh, this drops the history. Use svnadmin
as Samuel describes.
This is discussed in the svn documentation. Check out the Repository Maintenance section on svndumpfilter
... It specifically describes how to dump projects out of a central repository and move them into new, separate repositories.
If you have access the repository itself (not a working copy), you should be able to dump the current repository, filter it to only include information about the docs folder, and load it into the other repository.
Would be something like this:
svnadmin dump /svn/old_repos > ./repository.dump
svndumpfilter include path/to/docs --drop-empty-revs --renumber-revs --preserve-revprops < ./repository.dump > ./docs_only.dump
svnadmin load /svn/new_repos < ./docs_only.dump
Without access to the repository, you cannot maintain the revision history and you have to settle for copying the files into the new repository and committing.
svndumpfilter has a serious flaw - if a file or path was copied from a path you're filtering out to one you're filtering in, svndumpfilter won't be able to fill out the history and the job will fail.
You can use svndumpfilter2 if you experience this problem.