plone更新升级的补充说明

plone更新升级的补充说明
Upgrade tips[align=left]Description[/align][align=left]Advanced tips for upgrading Plone.[/align]
IntroductionThis guide contains some tips for Plone upgrades.
Recommended set-upTest upgrade on local computer first.
Create two buildouts. One for old Plone version (your existing buildout)and one for new version.
Prepare the migration in old buildout.After all preparations are done, copy Data.fs to new buildoutand run plone_migration tool there.


Clear catalogBefore moving Data.fs to new version, clear all site portal_catalog information.

Fix persistent utilitiesYou might need to clean up some leftovers from uninstalledadd-ons which have not performed a clean uninstall.
Use this utility:
[align=left]Note[/align][align=left]Perform this against old buildout[/align]

Upgrading themeMake sure that your site them works on Plone 4.Official upgrade guide has tips how the theme codebase shouldbe upgraded.

Theme fixing and portal_skinsYour theme might be messed up after upgrade.
Try playing around setting in portal_skins Properties tab.You can enable, disable and reorder skins layer applied in the theme.
Upgrade may change the default theme and you might want to restorecustom theme in portal_skins.

Enabling plone.app.discussion after Plone 4.1 upgradeAfter migration from an earlier version of Plone, you will may notice that youdo not have a Discussion control panel for plone.app.discussion, the newcommenting infrastructure which now ships as part of new Plone installs beyondversion 4.1. If a check of your Site Setup page reveals that you do not havethe Discussion control panel, implement the following.
Install plone.app.discussion manually
  1. [align=left]Log into your Plone site as a user with Manager access[/align]
  2. [align=left]Browse to the following URL to manually install plone.app.discussion:[/align]http://<your-plone-url>:<port>/<plone-instance>/portal_setup/manage_importSteps
  3. [align=left]In the Select Profile or Snapshot drop-down menu, selectPlone Discussions.[/align]
  4. [align=left]Click the Import all steps button at the bottom of the page.[/align]
  5. [align=left]Confirm that Discussion is now present as a control panel in yourSite Setup[/align]
Migrate existing commentsFollow the instructions regarding How to migrate comments toplone.app.discussionto migrate existing Plone comments.

Fixing Creator details on existing commentsYou may notice that some of your site's comments have the user's ID as theirCreator property. At time of writing (for plone.app.discussion==2.0.10),the Creator field should refer to the user's full name and not their user ID. You'll likely notice that a number of other fields, including author_username, author_name and author_email are not present on some of your migrated comments. Reasons why comments get migrated but unsuccessfully are being investigated.
This may change for future versions of plone.app.discussion. For now,though, having the user ID left as the Creator is less than helpful and meansaspects like the username, name, and email not present affect usability ofcomments.
If a site has many comments with this issue, it is possible to step through allof them and correct them. Using a script like the following will process eachof the affected comments accordingly:
from Products.CMFPlone.utils import getToolByName
from zope.app.component import hooks
context = hooks.getSite()
catalog = getToolByName(context, 'portal_catalog')
mtool = getToolByName(context, 'portal_membership')
brains = catalog.searchResults(object_provides='plone.app.discussion.interfaces.IComment')
for brain in brains:
    member = mtool.getMemberById(brain.Creator)
    comment = brain.getObject()

    if member and not comment.author_username and not comment.author_name and not comment.author_email:
        fullname = member.getProperty('fullname')
        email = member.getProperty('email')
        if fullname and email:
            comment.author_username = brain.Creator #our borked user ID
            comment.creator = fullname
            comment.author_name = fullname
            comment.author_email = email
            comment.reindexObject()
            print 'Fixed and reindexed %s' % comment
        else:
            print 'Could not find properties for author of %s' % comment



This can be run anywhere an Acquisition context object is available, suchas running your Zope instance in debug mode, an ipython prompt, or someother function on the filesystem. The getSite() function call can (and mayneed to) be replaced with some other pre-existing context object if that ismore suitable.
Keep in mind that this script was successfully used in a situation where nopossible collisions existed between correctly-migrated comments Creators' fullnames and user IDs (the code looks up the Creator in the hope of finding avalid Plone member). So, if you had a situation where you had some correctlymigrated comments written by a user with ID david and full name ofAdministrator, and also had a user with the ID of Administrator, thenthis script may not be suitable. In the test situation, the three attributesof author_username, author_name, and author_email were observed asall being None, so in checking for this too, this may avoid problems. Testthe code first with something like a print statement to ensure all commentswill get modified correctly.







设置