How to downgrade an SVN repository

Home

I recently got myself into a bad situation after using a recent release of Subversion (1.11.1) on a cutting-edge distro. After switching to a stabler distro, the packaged Subversion release (1.9.5) would no longer work with the "upgraded" repositories.

The problem was that the repository format had been changed in a backwards-incompatible way (see file db/format in your repositories).

After fruitless web searches and a fair bit of elucubration, I found a way to downgrade the repos. I can't guarantee that my method will work for you, but here's how I did it, in four easy steps.

  1. In /usr/local/bin, I had the newer Subversion compiled from source. While in /usr/bin I had the older, distro-packaged Subversion. So, with the newer version I did:
    $ /usr/local/bin/svnadmin dump /path/to/svn/repo > /tmp/svnrepo.txt

    which dumped the whole repository to a big text file containing all the necessary info to recreate it later (but, as I found out, without being tied to a particular format version).

  2. Let's move the repository we just exported out of the way:
    $ mv /path/to/svn/repo ~/tmp/trash/

    we can remove it for good later -- if the new, reconstructed repo works perfectly.

  3. Now we create an empty repository using the older Subversion in /usr/bin (so that the result will be old-format):
    $ /usr/bin/svnadmin create /path/to/svn/repo
  4. Finally, let's re-import into the newly-created repository the whole data dump that's in the big text file:
    $ /usr/bin/svnadmin load /path/to/svn/repo < /tmp/svnrepo.txt

With any luck, the resulting repository should now work with the older Subversion.

A brief final rant

The Subversion developers have shown, time and again, a complete disregard for their product's stability, backwards compatibility and interoperability. And it seems intuitive to me that this is the single dumbest thing that can be done to a VCS.

I value stability and compatibility, so it's high time for me to bid a heartfelt GOOD RIDDANCE to Subversion.

It's grown too full of crap anyway.

HomeNo Javascript iconValid HTML 4.01 StrictValid CSS!