Migrating SVN Repositories

Create the new repository. I had to use my hosting provider’s control panel.

If you were naive, you  might think to just zip up an export of your project directory, move it to the new location, and check that sucker in.

But you would be wrong.

That would make you lose your revision history, which kind of defeats the purpose of having version control. Instead, you’re going to want to move the repository itself.

You’ll need to dump the source repository to a text file for later import. Windows, which lacks a lot of cool things out of the box, doesn’t give you the svnadmin tool. But no matter, if you’re using VisualSVN Server (which, if I recall, is about your only option on this platform), its included as part of the installation. You’ll need to change directories to the installation folder before running the dump command.

Oh, and you’ll need to be using an Administrator command prompt. If you can’t figure out how to open one, you probably shouldn’t be trusted with the company’s source control infrastructure.

On VisualSVN, by default, the repositories are all stored in C:\Repositories\ We’re going to dump the “project” repository to file.

cd "C:\Program Files (x86)\VisualSVN Server\bin"
svnadmin dump C\:/Repositories\project > c:project.txt

Then move that monstrosity to the new server using FTP, or a thumbdrive, or whatever other means are at your disposal. Finally, load it into the new repository:

~: cat project.txt | svnadmin load svn/project

svn/project is the directory where the repository will be stored. You chose this directory when you made the repository.

Bam. Now you’ve moved.