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!

<br />#!/bin/sh<br />echo "Converting $repo from BerkeleyDB to FSFS"<br />repo=$1<br />echo "Dumping to $repo.svn.backup"<br />svnadmin dump $repo > $repo.svn.backup<br />mv $repo $repo.bdb<br />svnadmin create --fs-type fsfs $repo<br />svnadmin load $repo < $repo.svn.backup<br />chown -R svn:svn $repo && chmod -R g+r $repo<br />cp -R $repo.bdb/conf/ $repo/<br />cp -R $repo.bdb/hooks/ $repo/<br />rm -rf $repo.bdb<br />rm $repo.svn.backup<br />

2 Comments

  1. Bradley says:

    Thanks man! This little script is exactly what i needed for my 700+ repositories!

  2. Uni says:

    Thank you!