Plone to WordPress: Exporting Data from Plone

This is Part 2 of the the documentation of my migration from plone to wordpress. Read the previous post for my reasons to choose wordpress as CMS of choice.

As there is no direct path for a migration from Plone to some of the PHP-based content management systems I choose to follow a route which I had previously used quite sucessfully for other problems, namely to use an intermediate representation.

Script-based Export to JSON Data

Out of the box plone supports various methods for export either directly or via third-party products. From my quick research it seems as if many of these approaches do not really apply to the current plone 4 or require a substantive amount of plone developers knowledge which I don’t have. Other methods exported the data to XML with quite complex data structures.

What I found – though – are various approaches that export plone data to JSON files.There is

  1. a post Exporting Plone content as JSON which  presents a nice and simple python script for JSON export,
  2. collective.jsonify which up to just recently did not support blob fields,
  3. collective.jsonmigrator which is a tool for migration from plone 2.x sites to plone 4.0.
  4. collective.blueprint.jsonmigrator which publishes a set of blueprints for the migration from plone 2.x to plone 4.0

For my purpose I used the blueprint export script plone2.0_export.py from collective.blueprint.jsonmigrator as starting point.  In a series of iterations I modified this script such that I had an export run without an error. As a result for every data object (articles, pages, images, files) in plone I get a separate json file. For objects with binary data an additional base64-encoded data file is created, too.

Limitation?

Yes, there are . All items that are non-content objects in plone (users, css module, etc.) are skipped. Non-ascii characters anywhere expect the main body text are not supported. Workflow states and security permissions are disabled and hence not exported in my version.

You can get my version of the export script here: plone_export.zip

Copy the python file to your plone installation and add an external method pointing to this script’s export_plone20 function.

FTP Access

In addition to the JSON export I used the FTP access to the plone instance to get a direct copy of all data as present in the instance. This gives the files without any content information like title, publication date etc. yet with their file names as given in plone. For articles or blog entries text files are returned which contain title, teaser text, body text and author, publication date, etc.

For artictles written in restructured text the retrieved text files contained this restructured text and not the corresponding (rendered) representation. Not that helpful.

HTTP Mirroring

Finally, I used the excellent wget tool to also get a direct export of the complete website as visibile via http. This returned not only the unchanged image files as via ftp access but also the automatically generated variants for thumbnails, preview or fullscreen perspective.

Next Steps

With the data exported the next steps of the migration from plone to wordpress are:

  • Importing data into wordpress
  • and wrapping everything up.

3 thoughts on “Plone to WordPress: Exporting Data from Plone

  1. Terry Atkinson

    Fantastic article. I agree totally with your comments about Plone and also wish to transfer a number of sites to WordPress. I’ve downloaded your script for plone export to JSON. I’m not sure how to ‘add an external method pointing to this script’s export_plone20 function’. Could you explain? Thanks again.

    Reply
  2. Terry Atkinson

    Hi
    I think I figured how to add the external method. I added your script into the root directory of my website and then added an external method pointing to export_plone20. All that happens is that I am redirected to my website with a page not found message. Any ideas?

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *