tags:

views:

974

answers:

3

Hi all,

I'm about to upgrade a SVN server from version 1.5.5 to 1.6.5 - all is fine with the actual upgrade, but I'm a little confused about upgrading the actual repositories.

I've read in a few places (here, here), that it's better to dump and reload the repositories rather than using svnadmin upgrade. I assume that I should dump, upgrade the server and then load the dumps back in - however, should I clear the old files out of the repository before loading? If so, what's the best way to do this?

If, before I thoroughly screw up my version control system, someone could give me a quick step-by-step, it would be really helpful!

Cheers, Mark

+1  A: 

If you're going to do it that way then you probably want to dump, upgrade, delete and recreate the repo then load it back in again.

I can't say I've ever had any issues just using upgrade though, although you may end up with a less optimal repo structure.

Steven Robbins
So, would you suggest that I may as well just use upgrade?
Mark B
Unless it's a particularly big or complicated repo that's what I'd do. Dump and load can take a long time.
Steven Robbins
I agree. However, you should nevertheless make sure you have a backup before you upgrade. Making a dump is one way to create a backup.
sbi
Of course, but I would hope his svn is already being backed up regularly :-)
Steven Robbins
Yep, every half-hour :)
Mark B
+3  A: 

there is a quick step-by-step in the Subversion FAQ:

  1. Shut down svnserve, Apache, and anything else that might be accessing the repository.
  2. svnadmin dump /path/to/repository > dumpfile.txt , using version X of svnadmin.
  3. mv /path/to/repository /path/to/saved-old-repository
  4. Now upgrade to Subversion Y (i.e., build and install Y, replacing X).
  5. svnadmin create /path/to/repository, using version Y of svnadmin.
  6. svnadmin load /path/to/repository < dumpfile.txt , again using version Y of svnadmin.
  7. Copy over hook scripts, etc, from the old repository to the new one.
  8. Restart svnserve, Apache, etc.

more details on dumping and loading in the Subversion book. i assume you studied the subversion 1.6 release notes.

ax
Yep, I've checked the release notes - thanks though, that was exactly what I was looking for.
Mark B
Beware, those dumps are big. You *could* use the --deltas option with svn dump, which will somewhat reduce your dump file size. It is slower though, and alternatively you could gzip the dumps on the fly (without --deltas) which will be even more efficient.
RedGlyph
Noted - thanks!
Mark B
+2  A: 

No, you do not need to dump/load to upgrade, 1.6 was specifically designed to be an easy upgrade using just svnadmin upgrade. I've done it, it worked, I am happy.

The release notes explicitly say there is no need to dump/load the repo.

I would make a backup anyway (just in case), and then do the recommended upgrade. I'd then pack the repo files (svadmin pack) to make future backups quicker and SVN perform faster.

gbjbaanb
the release notes also say (http://subversion.tigris.org/svn_1.6_releasenotes.html#bdb-forward-deltas): "If you want to achieve the most optimized state of an older [BDB] repository, you still need to perform dump and load of the repository." also see the links in the question.
ax
Nobody should use a BDB repo. If you do, you still need to dump and load the repo.... into a FSFS one :)
gbjbaanb