Move an SVN Repository From One Server to Another

There’s certainly no shortage of sites offering quick instructions to move your SVN repository from one server to another. About 3.3 million (at the time of this writing) of them, it seems. So why do I have to make it 3.3 million and 1?

Because they all seem to leave off an important step: What to do on the client side after you’ve moved the repository on the server side.

Making the move is pretty simple: Log into your server, then use the svnadmin tool to dump the repository:

$ svnadmin dump/path/to/repo > reponame.dump

$ svnadmin dump /path/to/repo > reponame.dump

Simple, eh? And it works on Windows, *nix, whatever, the same way, even moving from one OS to another — the only requirement is that Subversion runs on it. Now just compress that file and send it along to your new server in whatever way suits you.

Loading it on the other end is just as easy; after decompressing the dump file on the new server:

If you’re using the TortoiseSVN client, right-clicking on the root of your working copy and going to “TortoiseSVN > Relocate…” will bring up a window where you type in the new URL. Other graphical clients I’m sure have similar options.

When using relocate, however, you must be very careful to only change from one directory to the same directory on the new URL. While the switch operation is indeed handy for switching back and forth between branches, tags, and trunk, you must not combine this usage with the --relocate option, or else Very Bad Things® will happen and you will most likely have to deleted your working copy and check out a fresh one.