[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Breaking up a monolothic repository

From: Trent W. Buck <trentbuck_at_gmail.com>
Date: Mon, 09 Sep 2013 11:13:12 +1000

I have inherited a single monolithic repo for all the company's
projects. I want to migrate to one repo per project. (One-way,
one-time migration.)

Following the red-bean book[0], I first tried svnadmin, which was
really slow, and eventually crashed because some files were copied
into projects/133_Redacted from a different subdir.

    rm -rf delete-me
    svnadmin create delete-me
    svnadmin dump /srv/svn/Frobozz |
    svndumpfilter --drop-empty-revs include projects/133_Redacted |
    svnadmin load delete-me

    [...]
    svndumpfilter: Invalid copy source path '/EE/ProjectDocs/133_Redacted/REDACTED.pdf'
    svnadmin: Can't write to stream: Broken pipe
    <<< Started new transaction, based on original revision 4182
    svnadmin: File not found: transaction '0-0', path 'projects/133_Redacted' * adding path : projects/133_Redacted ...

Freenode's #svn IRC channel advised me to use svnsync instead. That
was really slow, eventually succeeded, but left a tonne of empty
commit messages

    rm -rf delete-me-2
    svnadmin create delete-me-2
    ln -s /bin/true delete-me-2/hooks/pre-revprop-change
    svnsync init file://$PWD/delete-me-2 file:///srv/svn/Frobozz/projects/133_Redacted
    svnsync sync file://$PWD/delete-me-2
    rm delete-me-2/hooks/pre-revprop-change

So then I thought to chain the two approaches. This didn't work -- the
empty revs were not removed. I guess svndumpfilter --drop-empty-revs
is only smart enough to drop the revs that have just *become* empty?

    rm -rf delete-me-3
    svnadmin create delete-me-3
    svnadmin dump delete-me-2 |
    svndumpfilter --drop-empty-revs exclude /canthappen |
    svnadmin load delete-me-3

I also thought of converting to git fast-export format and back again,
but AFAICT there is no way to import a fast-export into a svn repo.

I'm stuck. Since it's no fun to have tens of thousands of empty revs
in each project repo, my current approach is to leave existing
projects in the monolithic repo, and new projects get separate repos.

What else can I do?

[0] http://svnbook.red-bean.com/en/1.7/svn.reposadmin.maint.html
Received on 2013-09-09 03:15:35 CEST

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.