WorkHabit Blogs

WORKHABIT LABS

Moving an SVN repository from a hosted service

by Aaron Stewart Published: December 2nd, 2008
Tagged: beanstalk, import, migration, subversion, svnsync, unfuddle

So during a routine project setup, we had a need to move a SVN repository hosted on Unfuddle to another provider (in this case, Beanstalk).

We'd had a lot of complaints from our developers that the hosted svn service on Unfuddle was extremely slow at times, and our tests of beanstalk showed markedly improved numbers. As a result, we've been regularly recommending that our clients move there as well. We've contacted the Unfuddle support team in hopes that they'll improve their performance, but until then, we've moved.

The upside: commits happen faster, developers are unblocked. Beanstalk's speeds are far quicker, and when we have run into issues, their support team is quick to respond either in live chat, via email, or even very quickly update their twitter feed with status.

The downside: no more integration with subversion in Unfuddle. If you use this feature heavily, I'd recommend that you keep your subversion repository where it is. If you don't, here's how to switch:

The problem

When moving repositories, one generally uses the 'svnadmin dump' command, which will only operate against a local repository.

However, Unfuddle's repository is not local.

So a quick search on the problem brought up this howto that uses the svnsync command (that also ships with subversion).

A brief version of how to copy the repo local first, then how to import into beanstalk, follows:

Mirroring the Remote Repository

svnadmin create /tmp/localsvn
(note the single quotes on the next line)
echo '#!/bin/sh' > /tmp/localsvn/hooks/pre-revprop-change
chmod +x /tmp/localsvn/hooks/pre-revprop-change
svnsync init file:///tmp/localsvn https://your.unfuddle.com/svn/your_root
svnsync sync file:///tmp/localsvn

Create a dump of your local Repository

After a little bit of chugging, you will have a mirror of your svn unfuddle repo in /tmp/localsvn, which you can create a dump of:

cd /tmp/localsvn
svnadmin dump . /tmp/localsvn.dump

(a note to mac users: The directory /tmp isn't available in finder by default, so copy it to your home directory instead).

Upload the dump to Beanstalk

* Log in to beantalk
* Click on "Repositories"
* Click "Create Repository"
* Name your repository
* Select "Import Repository FS Dump"
* Click "Browse and select your dump created in the previous step."
* Click "Next step"

Then sit and wait. Eventually the progress bar on the next page (on the right hand side) will indicate when your repository import is complete.

The Result (before and after)

Moving one 3kbyte file on Unfuddle:

time svn commit -m 'moved htaccess'
Deleting       .htaccess
Adding         htdocs/.htaccess
Committed revision 28.
real    4m2.897s
user    0m0.106s
sys     0m0.210s

A similar operation on Beanstalk:

time svn commit -m 'moved htaccess to prototype'
Deleting       htdocs/.htaccess
Adding         htdocs/.htaccess-prototype
Committed revision 29.
real    0m10.559s
user    0m0.090s
sys     0m0.213s

Bit of a difference, don'tcha think?

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <blockquote> <h3>
  • You can use Markdown syntax to format and style the text.

More information about formatting options

Papernote
Papernote

WorkHabit Labs Archives