Classic Note Entries

Zope Recovery

I use the following steps to get objects from a corrupted Data.fs. You can apply some guesses regarding the dates.
1. Make another Zope instance, with same products
2. Copy the real Data.fs into this temporary zope instance
3. Start zopedebug: $:/path-to-zope/bin/zopectl debug. Run these commands:
import ZODB.DB, ZODB.FileStorage, cPickle
from ZODB.TimeStamp import TimeStamp
from OFS import ObjectManager
date_tuple = (2009,8,23,23,17,06) #date when data was safe
special_date = TimeStamp(*date_tuple) #make date into special format
filename=’/var/local/zopetest/var/db.fs’ #path to Zope’s Data.fs (zope instance have to be stopped atm)
storage = ZODB.FileStorage.FileStorage(filename, read_only=1,stop=`special_date`) #wait few minutes, until it opens Data.fs
DB = ZODB.DB(storage) #mount database
conn = DB.open() #open database
root = conn.root()['Application']
folder = getattr(root, Ã¢â‚¬Ëœmyfolder’) #the parent containing the folder with the objects you want to recover
folder.manage_exportObject(id=’mycontent’,download=0)
Hope it helps.
Good luck,
Cornel
--
Cornel Nitu
Eau de Web (http://www.eaudeweb.ro)
Clucerului 55, ap 7, 011364 Bucharest
Tel/fax: +40 21 222 1522, Mobile: +40 721 223 623
Jabber: cornel at jabber.eaudeweb.ro, Skype: nitucornel