[Zope] Restore files from Data.fs.tr0

Cornel Nitu cornel.nitu at eaudeweb.ro
Fri Mar 15 12:34:04 UTC 2013


Hi,

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

On Mar 15, 2013, at 2:01 PM, Jaroslav Lukesh wrote:

> Hi all,
> 
> due disk and backup failure, I need to restore latest versions of files and properties from Data.fs.tr0, does have anybody some script or tips how to do it with zope tools, please?
> 
> Note that original Data.fs have changes after failure date, size at time of the failure is unknown.
> 
> Many thanks,
> Jaroslav Lukesh 
> _______________________________________________
> Zope maillist  -  Zope at zope.org
> https://mail.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists -
> https://mail.zope.org/mailman/listinfo/zope-announce
> https://mail.zope.org/mailman/listinfo/zope-dev )



More information about the Zope mailing list