SourceForge urges their users to backup the code repositories of their projects. As I have several projects hosted with SourceForge, I should do it too. Making the backups isn’t complicated at all, but because it isn’t automated properly, I’ve been lazy with it.
sf-svn-backup
was written in order to simply automate the process. The script is pretty simple to use, just pass as the first argument the project name and the script will write down to stdout
the dump file.
For example:
sf-svn-backup openyahtzee > openyahtzee.dump
The project name should be it’s UNIX name (e.g. openyahtzee and not Open Yahtzee). Because the script writes the dump file directly to stdout
it’s easy to pipe the output first through a compression program such as gzip
to create compressed SVN dump files.
Hi Guy, I used your script and is apparently working well, I get a list of all the projects revision in the console and a file. I just have a question. How do you restore the dump file?
To restore the dump file to a local repository you use
svnadmin load /path/to/repo < dumpfile See $ svnadmin help load for more details. If you want to restore the repository to SF, as project administrator you have an option to import a dumpfile.
Thank you very much. I appreciate your script. The dump-restore procedure worked well for me. I have not tried to restore to SF but I’m sure you have. (Ubuntu 9.04 64bit)
Thanks bunches! That’s exactly what i’ve just been looking for.
Hehe, this script is sheer beauty – I was wondering how you’d done it, cos I was thinking it’d be something tricky with the sf.net ssh shell etc and stuff like that.
rsync + svnadmin dump. beautiful.
I stole the rsync bit and dumped it into a script of my own actually, I’m in the process of switching away from subversion to git, and I’ve always found sourceforge’s subversion hosting to be really slow anyway. I’m using it to move one of my really old projects over to github, one that’s been sat doing nothing for (looks like) three years now.
I’ll post my version of the script when I’ve finalised it
Modified script to go from SF.net subversion repo to GitHub git repo as promised.
It’s not perfect, you need to modify the variables at the top script (and maybe some commands lower down) to use it, but I hope it helps someone 🙂
https://gist.github.com/976886
On Mac OS X 10.10, it was necessary to adjust the syntax for tmpfile.
Change line 87 from:
TEMPDIR=
mktemp -d
to:
TEMPDIR=
mktemp -d -t sf-svn-backup-XXXX
and everything runs nicely.