Upgrading Plone

Plone recently released an important update to address possible cross-site request forging attacks. You should upgrade your sites as soon as possible. If you haven’t upgraded before, here’s how.

This procedure can be used in order to upgrade a Plone 3.x site, running on Linux in a zeocluster configuration, to any later 3.x release (currently 3.1.7). The procedure assumes an installation at /var/plone/zeocluster/.  Adjust as necessary by changing any appearances of “3.1.x” to the appropriate release version.  As always, ensure that you have valid and working back-ups before doing any such maintenance on your sites.

Preparation

This part can be done without affecting your site or its users, and should be performed before the upgrade.

Before doing anything, take a backup!

tar cvfz ~/plone_working_backup.tgz /var/plone/*

Change directories to your Plone/Zope installation:

cd /var/plone/zeocluster/

Get and extract the tarball:

wget http://launchpad.net/plone/3.1/3.1.x/+download/Plone-3.1.x.tar.gz
tar xvfz Plone-3.1.x.tar.gz

Compress the contents of the new lib/ and Product/ directories:

cd Plone-3.1.x/lib
tar cvfz new_lib.tgz *
cd ../Products/
tar cvfz new_products.tgz *

Move the new tarballs to their destinations:

cd ..
mv lib/new_lib.tgz ../lib/
mv Products/new_products.tgz ../Products/

Upgrade

This part of the procedure is the actual upgrade and will affect your site and its users. Be sure to do your back-ups and prep work beforehand.

Extract the new tarballs to their destination directories:

cd ../lib/
tar xvfz new_lib.tgz
cd ../Products/
tar xvfz new_products.tgz

Fix permissions for your plone user:

cd ..
chown -R plone:wheel lib/ Products/

Restart the instance:

/var/plone/zeocluster/bin/restartcluster.sh

Using a web browser, navigate to your site.

In Site Setup -> ZMI, go to the root of your Plone site.

Next to portal_migration, you’ll notice a red exclamation icon, which indicates that your Plone site is now outdated in comparison to your upgraded Plone software:

Plone portal migration icon

Plone portal migration icon

Click portal_migration.

Select Dry Run to check your migration first, and then click Migrate.  Note that a dry run doesn’t really gain you anything, as either the migration will work or it won’t; it’s just a nice, warm feeling when the test run works.

If this works, go back and click Migrate again, this time without selecting Dry Run.

Back on your site, re-install any upgraded products in Site Setup -> Add/Remove Products.

Verify that the new version (Plone 3.1.x) is displayed in Site Setup.

If all is well, clean up:

cd /var/plone/zeocluster/
rm -rf Plone-3.1.x/ Plone-3.1.x.tar.gz lib/new_lib.tgz Products/new_products.tgz

If all is really well, finish your clean-up by removing the back-up .. but don’t do this until you’re sure everything is working as expected!

rm -f plone_working_backup.tgz
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s