[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Recovering from DB corruption: advice requested

From: Steve Midgley <public_at_misuse.org>
Date: 2007-04-18 18:55:02 CEST


I seem to have a corrupted SVN database (BDB) and my ISP can't figure
out how to recover it. (It's possible it's recoverable but neither they
nor I am sure how to do it). I believe the ISP even posted to this list
about the issue.

The repository is not totally corrupt, as I can still check in and out
files from various portions of the repository - only one area of the
repo appears broken, and no files can be accessed from
there. Fortunately, this area is trivial/unimportant, so all my
critical files are accessible (for now!).

What I'd like to do is export all my files/revisions from the critical
areas and re-import them into a new repository. (Unless someone has a
lower risk / easier idea).

I've already written and run a script which exports each revision I
care about into a separate local folder, along with a file that
contains the "commit message" for that revision. I've now run this
script against all the repository folders/revisions which I care to
preserve. No errors!

So now I have a (fairly massive) set of folders and revision message
files stored locally. This is a good backup in all events and allowed
me to sleep well last night. :)

My question is this: I'd like to "import" these folders sequentially
into a new repository. But this doesn't seem to gibe with how
Subversion operates (it wants a checked out version to operate against
a repository). I can't just run "import" over and over since the files
will already exist in the repository after the first import run..

My current idea is a little kludgy which is why I'm writing for advice.
Here's some pseudo-code of my idea:

0) (Create new repository)
1) Import first revision into repository
2) Loop through remaining revisions
2.a) Check out current "head" revision to a working folder
2.b) File copy ("cp") .svn folders from this head revision to the next
revision I want to import
2.c) "Commit" this next revision folder to SVN
2.d) [Loop ends]

I'm a little concerned as to whether this will even work. There's a lot
about the .svn folders that I don't understand. For example, will this
correctly handle deleted files or folders? Will it catch added
files/folders? It seems like it will work for modifications just fine
at least?

Any advice - completely different approaches to this issue are very

Thank you for any time and assistance!



To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Wed Apr 18 18:55:51 2007

This is an archived mail posted to the Subversion Users mailing list.