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

RE: repository recovery?

From: Karan, Cem \(Civ, ARL/CISD\) <CKaran_at_arl.army.mil>
Date: 2005-01-12 01:54:43 CET

>>> At this point (this may not have been wise, I realize) I decided to
>>> copy over a back-up of the repository, made about a month ago.
>>> Now, when trying to interract with the database, I get this message:
>>> $ svn update
>>> svn: REPORT request failed on '/svn/!svn/vcc/default'
>>> svn: Reference to non-existent revision '231' in filesystem
>>> '/Volumes/Data/svnrepo/db'
>>> What now?
>> That last error is perfectly expected, since your working copy thinks
>> it is at a later revision than actually exists in the repository.
>> Regarding recovering your problem repository:
> Ah. Well, you see, I have made this worse, then, I think. I completely
> failed to back up the broken repository. (One of those great,
> uncelebrated errors: Realizing just seconds after hitting "enter" that
> one really shouldn't have.)
> Um... am I sol, then? Can I do something to point my working copy at an
> earlier revision? Is that possible? Something with switch maybe? Is
> that insane?

I'm going to poke my nose in as well at this point. Out of curiosity, what version of subversion are you using? There was one version (1.0.9 using BDB 4.1 IIRC, Max, you'll know this, I'm just a user, not a developer) that tended to corrupt the repositories regularly. If you are using that version, then once your repository is unwedged, upgrade to the latest version of subversion. I know someone knowledgeable told me that they have fixed the BDB problems at this point completely, but I've been using FSFS on my repositories and (so far) haven't had any problems. That said, I tend to make backups religiously.

As for getting something up and running again, I think you could follow the following recipe. Note that since your wedged repository is gone, you will have lost all of the revisions in between, but, such is life...

1) Make backups of everything (working copy, repositories, EVERYTHING), prefereably somewhere where they can't be overwritten. The rest of this depends on deleting/overwriting stuff, which could dangerous.

2) Replace your hosed repository with your backup.

3) Move your working copy somewhere where you can hack around on it. I'm going to call this the old working copy.

4) Checkout a new working copy in the location where you want it to be. I'm going to call this the new working copy.

5) Either use the finder to search for all of the ".svn" folders in your old working copy and trash them, or run the following command from the terminal within the top level directory of the old working copy (NOT root, JUST the working copy!)

    find . -type d -path "*.svn*" -exec rm -rf {} \;

4) Either use FileMerge to merge the files in the old working copy into the new one (lets you get rid of those "brilliant" ideas you never should have had) or simply replace them using your favorite method. Note that you can't just copy the whole folder over; you need to save the ".svn" folders in the new working copy for this trick to work.

5) Run 'svn status' at the base of the new working copy. Add any files you need to add to the repository, then do an 'svn commit' and and 'svn update'. If there are any files that are missing, then you'll need to do 'svn update', 'svn commit', and then 'svn update'.

At this point, if you're not already using the latest stable version of subversion, you may wish to upgrade, and switch to using the FSFS repository option. I know if there have been changes to how the compile script worked between 1.1.1 and 1.1.2, but I remember that I had a couple of slight hiccups compiling 1.1.1 originally. If you need help in doing the upgrade, email me. As a further note, follow the SVN book in how to do an upgrade; you can make life difficult for yourself if you don't.

Note that the above method won't save things that are not stored int the repository. IIRC there are some unversioned things (Max?), but as long as you don't have them you'll be OK.

Good Luck,
Cem Karan

To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Wed Jan 12 01:57:29 2005

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