Skip to content. | Skip to navigation

Personal tools
Sections
You are here: Home Blog Dogfood Dinner Bell

Dogfood Dinner Bell

by admin last modified Apr 01, 2010 09:02 PM
It's that time again to upgrade my Blog to the latest Plone.

With the first Plone 4 Beta out it's time to eat my own dogfood and upgrade my blog. This site is now running on Plone 4.0b1-1. So come poke around if you like and tell me what's broken. :)

The upgrade went pretty smoothly for my main site. I had some other, older, Plone portals where I've installed various add-ons in the past and for those I had to do some manual cleanup of some broken objects.

The unified folder implementation makes removing broken objects very difficult. The manage_delObjects(), _delObject, and _delOb methods are all broken before the folders have been migrated but the migration won't complete if there are broken objects in the folder. I had to do something like this where "idx" is the index in _objects of the broken object and 'foo' is the id:

>>> folder._objects = folder._objects[:idx]+folder._objects[idx+1:]
>>> delattr(folder, 'foo')
>>> import transaction
>>> transaction.commit()

On two of my portals I also had some regular TextIndex'es in the catalog, which I guess are no longer around. Those I was able to just delete in the "Indexes" tab of the ZMI for portal_catalog. Since these were core indexes like "Title" I used portal_setup to install just the catalog import step from the Plone base profile. Being a base profile this means running the import step cleared the indexes so I also had to update those catalogs.

After all that was done I just uninstalled the classic theme and Kupu and then installed and configured plone.app.caching. Everything seems to be working well.

Just to polish things off, I wanted to make sure I was getting the full benefit of Hanno's ExtensionClass/ZODB fix. The one thing I can't find is a clear migration procedure. As far as I understand the ZODB, the objects created before the fix would need to be written to the ZODB again to see the benefit from the fix. So I used the following at a "bin/instance debug" prompt:

>>> app.ZopeFindAndApply(app, search_sub=1, apply_func=lambda obj, path: setattr(obj, '_p_changed', True))
>>> import transaction
>>> transaction.commit()

That should do it, but if anyone knows how that's insufficient or knows a better way to accomplish the migration, please do leave a comment.

Filed under: , ,

Comments (6)

http://aclark.myopenid.com/ Apr 02, 2010 05:36 AM
Death to NuPlone. Long live Sunburst! :-)
http://david.wglick.org/ Apr 02, 2010 08:08 AM
I wonder if there's some way we can fix the folder migration so that it doesn't b0rk on broken objects. I haven't taken a close look at it yet.

I would recommend against using the ExtensionClass fix yet. It currently causes references to objects in acquisition wrappers to be pickled incorrectly (see http://dev.plone.org/plone/ticket/10318). Plone 4.0b2 will not ship with the fix unless Hanno finds a way to fix this issue in the next few days.
http://blog.hannosch.eu/ Apr 02, 2010 09:37 AM
David already pointed out one problem we found with this stuff. Should we be able to fix it, Laurence did post a conversion script at some point that uses ZODB level API's. ZopeFindAndApply won't catch most of the objects here, as catalog indexes, Archetypes BaseUnit's, __annotations__, portlet assignments and all these kind of objects won't be found. Content objects are only a tiny minority of all affected objects.

But I put this whole change into a large site with a ZEO server on a different physical box, then the ZEO clients - a setup where one would expect this to have an effect. Unfortunately there was no measurable effect whatsoever from this change. So while it seems to help a bit with startup time and has some effect in artificial benchmarks, performance in real live is dominated by other factors.

I therefor decided not to spent time on polishing a migration script. The optimization will silently be enabled one object at a time during real use instead.
Ross Patterson Apr 02, 2010 10:58 AM
Good to know, thanks for the heads up.

That migration script is here:

http://n2.nabble.com/Plone-[…]34.html#post-subject4664421
Ross Patterson Apr 02, 2010 03:48 PM
Here's a migration script that works under both Plone 3 and 4 and skips pickles with broken objects:

http://rpatterson.net/blog/extensionclass_update.py
Ross Reedstrom Apr 20, 2010 09:06 AM
I note that you've made a blog post after this dogfood post (on the extensionclass upgrade script) which shows up as a 'next' link at the bottom of this post, but not in the sidebar nav, nor blog title list.
Navigation
OpenID Login

Contact

me@rpatterson.net

IRC: zenwryly@irc.freenode.net
plone.org: rossp
GTalk: mer@patterson.net
Yahoo IM: patterson_ross
AIM: rosspatters
MSN: me@rpatterson.net

PO Box 7775 #10587
San Francisco, CA
94120-7775

Phone
+1 (415) 894-5323