[ZODB-Dev] Migrating classes in ZODB 3.5.1

Syver Enstad syver at inout.no
Thu Nov 10 07:14:46 EST 2005


Stephan Richter wrote:

>On Wednesday 09 November 2005 11:00, Tim Peters wrote:
>  
>
>>Stephan Richter was wrestling with a migration script a couple months ago.
>>I don't know whether he packaged the code he ended up with for reuse.
>>Here's a record of the IRC chat in which details got worked out:
>>
>>    http://zope3.pov.lt/irclogs/%23zope3-dev.2005-08-25.log.html
>>    
>>
>
>The resulting code from the discussion is publically available in the 
>SchoolTool source:
>
>http://source.schooltool.org/viewcvs/trunk/schooltool/src/schooltool/generations/evolve5.py?rev=4984&view=auto
>
>Regards,
>Stephan
>  
>
Yuhuu!! It seems to work.

So the key is to force activation and repickling of every persistent 
object in the database, then all the modulename, classname references 
are updated to the current. It certainly seems that I can use my 
original approach of overriding classFactory in DB for the duration of 
the upgrade script.

Very nice. I almost did the same thing as the evolve function but I only 
changed the objects who where of the class that I was moving to another 
module. That didn't work in 3.5.1 but worked in 3.2.


More information about the ZODB-Dev mailing list