May 30th, 2008

Backing up and restoring your Subversion repository

Most tutorials around show how to backup your Subversion repository:

svnadmin dump /path/to/your/repository > ./repository.dump

And how to restore it:

mkdir /new/path/to/your/repository
svnadmin create /new/path/to/your/repository
svnadmin load /new/path/to/your/repository < ./repository.dump

But don’t tell you what to do to solve the problem that will arise when you try to restore it:

svnadmin: Dump stream contains a malformed header (with no ':') at '* Dumped revision 0.'

The solution is too simple; just run:

grep --binary-files=text -v '^* Dumped revision' ./repository.dump > ./repository.clear-dump

Now you should be able to restore your subversion repository with no problems:

svnadmin load /new/path/to/your/repository < ./repository.clear-dump

PS: I don’t use hotcopy because I prefer to have a single file for these backups.

Comments

  1. being (no)body » m3talink for June 4th on 05 Jun 2008 at 12:47 am #

    [...] Gustavo on Information Technology » Backing up and restoring your Subversion repository is Most tutorials around show how to backup your Subversion repository and how to restore it. But don?t tell you what to do to solve the problem that will arise when you try to restore it. The solution is too simple. [...]

  2. vadim on 25 Dec 2008 at 2:28 pm #

    Gustavo, please help me

    I filter my repository using “svndumpfilter2.py” script like following:
    cat dump1Renew.dump | python.exe svndumpfilter2.py –drop-empty-revs –renumb
    er-revs Rep1 trunk

    next i create repository manually using a tortoise SVN

    then i try to load my filtered dump to new repository type following command:

    $ svnadmin load –ignore-uuid CopyRep1 ./repository.clear-dump” thw same problem occurr

« | »

  • About the author

    You're visiting the technical blog of Gustavo Narea, a Software Developer based in Oxford.