SVN: Converting from BerkeleyDB to FSFS
I’ve been working with Marcello on http://2draw.net/ and after posting up the Alt framework we’re working on (http://alt.cellosoft.net/) onto ajaxian.com our SVN suddenly stopped working. What a mess, eh? Indeed. BerkeleyDB was apparently at fault, since our DB got corrupted as we were being hit by the masses.
Since we have about 8 repositories, I wrote up a little shell script to do the housekeeping in making the transition. The usage case is pretty simple:
$ ./convert.sh repo_dir
be sure to run this with the pure repository directory, no trailing slash!
#!/bin/sh
echo "Converting $repo from BerkeleyDB to FSFS"
repo=$1
echo "Dumping to $repo.svn.backup"
svnadmin dump $repo > $repo.svn.backup
mv $repo $repo.bdb
svnadmin create --fs-type fsfs $repo
svnadmin load $repo < $repo.svn.backup
chown -R svn:svn $repo && chmod -R g+r $repo
cp -R $repo.bdb/conf/ $repo/
cp -R $repo.bdb/hooks/ $repo/
rm -rf $repo.bdb
rm $repo.svn.backup
Thanks man! This little script is exactly what i needed for my 700+ repositories!
Thank you!