subversion dump and restore

2004 Dec 12 at 05:05 » Tagged as :collaboration, rcs,

Subversion is full of surprises, whenever you start to think 'I am finally getting the hang of this' it throws you another riddle to solve.

I ran into one of those riddles when I attempted to back and recover the repository. After having imported this web site, I followed it up with a few more projects that I am currently working on + some documents into the repository.

That repository was dumped out again as instructed in the manual with the svnadmin command. (In case you want to know the exact command is: svn admin dump /var/subversion --incremental > svn-001 ). This produced a file of around 60MB - no great surprises there. The surprise came when the dump command was repeated today after making some minor modifications to the version controlled files.

The new dump even with the --incremental flag was 80MB - now this is not what I expected, according to my reckoning it should have been closer to 20MB. This is the riddle in the subversion documentation.

When you use the --incremental flag you have to recall memory (your's not the computer's) the highest revision number at the time the last backup was taken and start the dump from there. It would have been a lot better if the last revision number dumped was saved in the .subversion/ folder so that there is much less work to due. Apperently laziness is not considered a virtue everywhere.

So far from the little I know of subversion it looks like the only way to effectively do is to call svnlook command to get information about revision numbers and then decide which ones to dump. So it may be a good idea to include the range of revisions as part of the dump file's name.

As a parting shot it's worth noting that while the subversion docs contain a few riddles, the CVS manual is a riddle.