Moving subversion repositories between servers

Issues related to applications and software problems
Post Reply
phil.e
Posts: 97
Joined: 2018/02/13 20:28:14

Moving subversion repositories between servers

Post by phil.e » 2018/04/23 18:44:32

Hello,

I posted a question the other day about updating an ancient cvs server. Turns out the cvs server is both a cvs server and an svn server and most users are using the svn server for their current projects - the cvs server is just there for legacy reasons.

I started testing moving some of the svn repositories over to the new server using svnadmin dump, svnadmin create <repo>, and svnadmin load, and it appeared to be going well.

But then I got to a few that spit out an error "svnadmin: expected format '3' of repository; found format '5'". From what I gather this is caused by the client having a newer version of svn than the version of svn running on the server. (the old server is running 1.4.6-1 - the server replacing it is running 1.7.14-11)

Rather than using the "svnadmin dump" program, can I just tar up the repo folder and copy it over to the new server. and it'll still work correctly?

Do I need to run the "svnadmin create" on the folder before un-tar-ing everything? (I copied the folder structure from the old server to keep everything the same on the new server)

Thanks,

User avatar
TrevorH
Site Admin
Posts: 33202
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Moving subversion repositories between servers

Post by TrevorH » 2018/04/24 08:34:01

A subversion repo is just a collection of files on disk. You can copy them - as long as you copy everything including any hidden files - and that's all that's required. You do not and should not run any svnadmin commands to do so. However, you might need to go read up on the migration steps to go from your old svn release to the new one installed on the server as there may be on-disk modifications required. For that, you need a subversion expert...
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

pjsr2
Posts: 614
Joined: 2014/03/27 20:11:07

Re: Moving subversion repositories between servers

Post by pjsr2 » 2018/04/25 14:35:29

svnadmin: expected format '3' of repository; found format '5'
This error message indicates you are using an svnadmin that belongs to an old version (svn version from 0.34 to 1.3) to access a repository that is using the format version "5" (svn version 1.4 up to current version of svn).

The following should work (I write "should" because I always use the second method below):
  • Shutdown your old repository svn server and make sure no application is using your old repository.
  • Copy all the entire directory tree data/repositores/your_repo_name directory to your new server
  • On your new server run (with the new version of svnadmin)

    Code: Select all

    svnadmin upgrade data/repositories/your_repo_name
The above command will do just the minimal work required to upgrade the repository files to the latest format, but it will not take advantage of more efficient compression methods.

It may be worth to go through the full svnadmin dump/load cycle. This will make that the contents of all revision files in your new repository will take advantage of better compression techniques and results in improved performance.
So in this case, your work procedure looks like:
  • Shutdown your old repository svn server and make sure no application is using your old repository.
  • Using the old version of svnadmin do a dump:

    Code: Select all

    svnadmin --incremental --deltas dump data/repositories/your_repo_name > your_repo_name.svndump
  • Copy the your_repo_name.svndump file to your new server.
  • On the new server, using the newer version of svnadmin, create a new repository and load the dump file into it:

    Code: Select all

    svnadmin create data/repositories/your_repo_name
    svnadmin load data/repositories/your_repo_name < your_repo_name.svndump
Besides getting a better performing new repository, the full dump/load gives you a check of the integrity of all revisions on the fly.

Post Reply