Get objects from ZODB into MySQL

William Heymann kosh at
Tue Apr 28 02:08:24 CEST 2009

On Monday 27 April 2009, TheIvIaxx wrote:
> Hello, I have searched for some solution to getting the object data
> from a ZODB Data.fs file into something i can work with for MySQL.  So
> far, no such luck.  I can open the DB and poke around, but im not sure
> where or what to even poke :)

Normally what you would do is make sure zope can connect to your mysql db. 
Then you write something like a catalog query in zope to find all the objects 
your interested in and you use a zsql method and insert each object into your 
database. So you need to find the attributes you care about in your zope 
objects. Usually this is fairly trivial to do 10-20 minutes or so.

The whole key is to do it from inside zope not from outside. Since from 
outside zope you can't really load the objects involved.

> It was a simple plone site, with mainly Pages/Documents (the basic
> content type).  I would imagine getting the object information into
> some sort of csv or txt format would be easy.  I can't really find
> anything in the ZMI that would do what i need either.

I doubt it would be easy to put it in some csv format without massive data 
loss. What do you do with images? files? workflow? document relationships? 
hierarchy? etc

More information about the Python-list mailing list