Migrate a folder from one Subversion server to another

I needed to migrate a folder from one Subversion server to another. So, I attempted to follow this page to use dump with svndumpfilter. This combo led me to a lot of issues. The dump command exports all the commits for a repository while svndumpfilter attempts to filter the folder I am interested to keep. Unfortunately, the filter tool is very buggy and unable to filter correctly. Here are the scenarios that did not work for me:

If a commit contains a move action with source location outside of the folder I want to include, the filter fails. I had to include that location when filter. If a commit contains an add action, the parent folder has to exist when loading. I could resolve this by creating the parent folder manually. If a commit contains a delete action and the target folder/file doesn’t exist, the load fails. I could try to create the folder/file manually in an attempt to not fail the delete action. This trick didn’t work when the commit includes a delete of parent folder before attempt to delete the file in it.

When I about to give up, I came across svndumpfilter3 and was happy to find it dump/load without an error. 🙂 Here are the commands I used:

svnadmin dump [path to source repository] | ./svndumpfilter3 --untangle=[path to source repository] [target folder to include] > dump_file.dmp

svnadmin load [path to target repository] --parent-dir [path to target parent dir] < dump_file.dmp
Advertisement

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s