October 5, 2006

There is always hope...

A Plone 2.0b1 -> 2.5.1 migration adventure

At some point you have to migrate a Plone site from time to time. So I helped a friend to migrate his institute website to Plone 2.5.1. Unfortunately the original site was something like Plone 2.0 beta 1 (at least the migration tool was telling that). The first tries using the default Plone migration failed in differently ways badly depending on the Zope and Plone version (we also tried to migrate to Plone 2.1 first but with no success). So no way out? No chance to get the data in a sane way back into Plone 2.5? Don't give up the hope, there is always hope!Actually the following steps worked well to perform a half-way automated migration:

  • Set up a clean Plone 2.5.1 instance with Zope 2.9.5/Python 2.4.3
  • Try to export parts of old site using the ZMI export. You will get a bunch of .zexp files e.g. for the top-level folders
  • Move the .zexp file to your Plone 2.5.1 instance and try to import the .zexp files through the ZMI inside a scratch folder. It might be necessary to install some of the old 3rd-party products used within your old site in order to make the .zexp import work!
  • I wrote a small migration script that walks of the hierarchy of the old objects and creates new instances inside a shadow folder. The current implementation recreates folders, documents and files. Adding support for images and other types should be straight-forward. Basically after creating the new object you must call the mutator methods of the new object with the data of the old object (requires some sniffing in the old CMFDefault code)
  • The script does not care about ownership issues, workflow states or other esoteric metadata since this was not necessary in this particular case. It might be useful for other people where the standard Plone migration fails however if there is a  need to migrate your content without  engaging a bunch of cut&paste monkeys.