Eric Anastas
Eric Anastas

Reputation: 22213

Can you backup/create a dump of a subversion repository without direct access to the server?

I use a hosted subversion service for a number of personal and work development projects. While they keep backups like any hosting company should I'd like to be able to create my own local backups as well just in case. This service allows you to request and download a backup, but they charge money to do this. Is there anyway I can generate a backup/dump of my hosted repository by connecting to it as a client through HTTPS?

Upvotes: 7

Views: 1986

Answers (3)

milahu
milahu

Reputation: 3559

svnsync is really slow, about 2 revisions per second
the performance drops exponentially over time

svnrdump should be much faster

sourceforge.net provides an rsync interface (docs)
which is about 50x faster

example:

mkdir -p /tmp/qmmp/svn
svnsync init file:///tmp/qmmp/svn svn://svn.code.sf.net/p/qmmp-dev/code
time svnsync sync file:///tmp/qmmp/svn
# about 90 minutes
# 2 rev/sec
mkdir -p /tmp/qmmp/rsync
time rsync -a svn.code.sf.net::p/qmmp-dev/code /tmp/qmmp/rsync
# real  1m41.242s
# = 10409/1m41.242s = 100 rev/sec
# -> 50x faster

plot of svnsync speed

different SVN server, same problem:
svnsync performance drops exponentially over time, from 10 rev/sec to 2 rev/sec

SVN sync speed in revisions per second. exponential drop in performance

Upvotes: 0

Warpin
Warpin

Reputation: 7043

You can use svnsync command. It will basically get every revision of a source SVN database and commit them to your backup database. It can be slow the first time you run it as it gets all the changes one at a time, but once the first sync was done it's a nice solution.

Upvotes: 4

Kornel Kisielewicz
Kornel Kisielewicz

Reputation: 57555

Theoretically "no", as the dump can be only performed by svnadmin command. However, there's a non-trivial solution to circumvent that.

There are two ways, a simple one, and a hard one. The simple one is a utility called rsvndump (remote SVN dump), you can find it here: http://rsvndump.sourceforge.net/

If the simpler one doesn't work for you (rsvnadmin has it's limitations as written on it's manpage), there's the complex one:

The second harder method requires you to install SVK, a client for distributed version control, built using svn, as a extended client. Unfortunately the installation procedure is non-trivial, here's a guide to help though.

You now list the remote repository using SVK:

svk ls URL-to-SVN

Follow the instructions. Voila, you have a local copy of the repository :). The first two revisions are SVK related, so to do a dump now, you run:

svnadmin dump -r2:HEAD ~/.svk/local > repository.dump

And there you have it.

SVK has also the advantage of being prebuilt for windows (here's the link).

Upvotes: 1

Related Questions