[Zope] Upgrading Zope Products
Dieter Maurer
dieter at handshake.de
Thu Mar 24 14:43:35 EST 2005
Brian Brinegar wrote at 2005-3-24 11:47 -0500:
> ...
>I was thinking it may be best to have an upgrade method that can bring
>any instance up to date by adding properties, etc. Is there a standard
>way for doing this? Any experiences on one way being better than another?
A long time ago, Chris Withers has posted an update/migration
script. Maybe you find it (search!).
>FYI, We've got about a 40 gig ZODB and searching all of it to find
>objects to upgrade is about impossible.
Wow!
Hopefully, you have an index that allows you to locate
the affected objects...
As an alternative to an explicit migration script (that
finds and modifies all affected objects), there is
the "__setstate__" kludge.
"__setstate__" is used to initialize an object with state
read from the ZODB. Thus, you can fix up the object there.
This is a kludge, as changes you make in "__setstate__" are
only made persistent when the object is later modified.
I think that this can be controlled in a future ZODB version.
You might get such a ZODB version with Zope 2.8 (or implement this
feature yourself. It is not difficult).
--
Dieter
More information about the Zope
mailing list