If the types are otherwise compatible, you can probably write a
migration script that just switches the __class__ of every instance in
the ZODB.
Martin
This question has come up a few times, so I would like to provide a
utility to assist with making this change in Dexterity. But I haven't
had a chance to write it yet. Anyone else want to have a go at it?
cheers,
David
I think I ran into ZODB-related limitations of this for which anything
other than an offline approach like zodbupdate would not work. I
cannot remember what they are at the moment, though.
> I doubt that will be sufficient, since containers have internal data
> structures that would need to get set up in order for the object to function
> as a container. (See the migration to BTree-based folders in
> plone.app.folder for some hints about what those are.)
>
> This question has come up a few times, so I would like to provide a utility
> to assist with making this change in Dexterity. But I haven't had a chance
> to write it yet. Anyone else want to have a go at it?
I might be willing to take a look at this again.
I punted on this problem, but when I was looking into it for myself,
as an alternative, I tried replacing the state of a newly constructed
Container with the state of an item, but this would fail for the
reasons you have documented. Below is a not-yet-working example of
what I was attempting many months back:
https://teamspace.upiq.org/trac/wiki/DexterityClassMigration
I think there may be some way to selectively copy parts of the state
of the old object to a new container and then finally replace the item
with a new container with copied/merged state of the Item it is
replacing.
Sean
--
You received this message because you are subscribed to the Google Groups "Dexterity development" group.
To post to this group, send email to dexterity-development@googlegroups.com.
To unsubscribe from this group, send email to dexterity-development+unsub...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/dexterity-development?hl=en.