The ultimate subversion repository splitting guide

Initial situation: we have a repository in directory called ham. In the repository we have two subdirs called foo and bar. We want to split the repository into two separate repositories, called foo and bar. We want both new repositories to start with revision id 1 and increment continuously.

svnadmin dump ham > dump
svndumpfilter include --drop-empty-revs foo < dump > dump.foo
svndumpfilter include --drop-empty-revs bar < dump > dump.bar

sed -e "s/Node-path: foo\//Node-path: /" < dump.foo > dump.foo.fixed
sed -i -e "s/Node-copyfrom-path: foo\//Node-copyfrom-path: /" dump.foo.fixed

sed -e "s/Node-path: bar\//Node-path: /" < dump.bar > dump.bar.fixed
sed -i -e "s/Node-copyfrom-path: bar\//Node-copyfrom-path: /" dump.bar.fixed

At this point we edit the dump.*.fixed files to remove the lines which create the *-directory.

svnadmin create foo
svnadmin load foo < dump.foo.fixed

svnadmin create bar
svnadmin load bar < dump.bar.fixed

If original version numbers are to be kept, parameters of svndumpfilter can be adjusted.

back to front