I have a 2 Debian subversion setups on separate servers, and the decision has been made to shut down one of the servers. But before I do so, I want to move all of the repositories on the one server to the other server (including all historic revisions, etc).

How is this done?

Can I simply copy the contents of /var/lib/svn/repo-name to /var/lib/svn/repo-name on the other server? Or is there more to it than that?

also do I need to do anything about permissions/ownership?


You should only copy the files across if the SVN environment is identical, if not:

  1. Use svnadmin on the machine you are migrating from to create a dump file:
    svnadmin dump myrepos > dumpfile
  2. Create new repositorys on your remaining server
  3. Load your dump files in:
    svnadmin load newrepos < dumpfile
  4. Copy any customizations and/or hook scripts across from the old server.
  5. If the URL has changed in the switch, switch any working copies with:
    svn switch --relocate http://new-server.lan/repos/repo .

This is all from the SVN Book.

| improve this answer | |
  • Excellent answer, thank you. Can you clarify what you mean in step 4? – Brent Jun 23 '09 at 13:27
  • You can make configuration changes, and add "hook" scripts to subversion repositories to change behavirour and add additional functionality, these are not migrated with the svnadm dump command. I will clarify in my answer. – Richard Slater Jun 23 '09 at 14:47
  • 2
    Since you're changing the location of the server it should be svn switch --relocate old-server.lan/repos/repo new-server.lan/repos/repo (per svnbook.red-bean.com/en/1.1/re27.html) – Tom Hennen Sep 28 '10 at 16:56
  • Well spotted, I have updated my post. – Richard Slater Sep 28 '10 at 20:37

You're best off doing a dump from the old repository and a load into the new. This is the cleanest, most "supported" way of migrating one repository to another. You can try copying the files, but if you're not moving to the same version of Subversion on the same processor architecture (yeah-- if you're using BerkeleyDB you can run into endian-ness issues... saw that on an Alpha to Intel SVN migration once) you could have problems.

Have a look at http://svnbook.red-bean.com/en/1.1/ch05s03.html, under the section titled "Migrating a Repository".

(A friend of mine did this once over netcat between two boxes when we didn't have enough temporary space to hold a copy of the dump file! It worked, too...)

| improve this answer | |

There is more than one way to do it:

  1. Stop the svn server than just copy the contents of the directories.
  2. svnadmin dump PATH_TO_REPOS and than on target server #svnadmin load PATH_TO_MIRROR

    Note that svnadmin dump does not dump your repository configuration files and hook scripts.
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.