Skip to main content

Products.Plone3Cleaners: cleanup after migration from Plone 2.5 to 3

This package is a collection of browser views that you might need when migrating from Plone 2.5 to Plone 3. And actually, some of these can be handy also when not migration, like removing portal_factory items from the portal_catalog.

Add this package to the eggs of your buildout; no install inside Plone is needed.

Five local sites

Local sites from Products.Five have changed a lot since the Plone 2.5 days. They need migration. Products.Five offers the manage_site.html page; just add this to the url of your local site and click the ‘Migrate to Five.component’ button. You should try that first, but in my experience that usually does not work.

Note that a default Plone 2.5 Site does not use localsites, so if you have them, then they are from a third party product. If you see an error like this in the logs when looking at your Plone 3 Site you have a problem:

2009-06-23 12:30:17 ERROR ZPublisher BeforeTraverse: Error while invoking hook: "__local_site_hook__"
Traceback (most recent call last):
  File "/home/maurits/zopes/Zope-2.10.7-final-py2.4/lib/python/ZPublisher/BeforeTraverse.py", line 145, in __call__
    meth(*(container, request, None)[:args])
AttributeError: __call__

We have two browser views that help in fixing this:

  • @@find_local_sites: add this to the url of your Plone Site or of your Zope root. Click the submit button to find all objects with a problematic local site hook. Your zope instance log will have some details and the page will display links to the objects that need fixing. The links will point to our second browser view:

  • @@update_local_site: add this to the url of an object with an old local site hook that needs fixing. Likely, calling this will give that same AttributeError once or twice, but you can ignore that as you are about to fix it : click the ‘Migrate to Five.component’ button.

The object that had the old local site hook may need some fixes in the python code as well. Ask the developer of the product that this object is from. Note that a local site hook is not always the right solution; and this migration is not always enough. In a client project I got rid of one hook and used a simple attribute instead; a second hook worked fine after the above migration; a third hook needed a different migration.

portal_factory in portal_catalog

You have seen this: you write a catalog query, on one of the brains you do a brain.getObject() and this fails because the object was wrongly added to the catalog while being created and it was not cleaned up. Clean it up with @@factory_cleanup. You can choose to remove those portal_factory brains or remove any brain where getObject() fails. For various reasons this may find less or more items; certainly it takes a lot longer.

History of Products.Plone3Cleaners

1.1 (2009-08-19)

  • Added @@factory_cleanup to remove items with ‘/portal_factory/’ in their path from the portal_catalog. [maurits]

1.0 (2009-06-23)

  • Initial release. [maurits]

Release files for Products.Plone3Cleaners 1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for Products.Plone3Cleaners 1.1
File Size Uploaded
Products.Plone3Cleaners-1.1.tar.gz 12.5 kB Details

Release files / Products.Plone3Cleaners-1.1.tar.gz

Download URL Products.Plone3Cleaners-1.1.tar.gz
Size 12.5 kB
Tags Source
SHA-256 checksum
How to use checksums
0170eaf420669f75d4b1999c016c9ddc6780bfc53774f82032ebe3f7c4719dda
BLAKE2b-256 checksum
How to use checksums
64cc75b8cef49798c2fb795f7077b8f32da246b316f998942fd21435fe22a038
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

1.1 This release

1 release file

1.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page