[ZODB-Dev] Moving ZODB data into a relational database

Dieter Maurer dieter at handshake.de
Tue Mar 8 14:12:04 EST 2005


Ruchith Fernando wrote at 2005-3-8 13:45 +0600:
> ...
>I'm trying to transfer contents of a ZODB database (Data.fs from ZOPE)
>to a ralational database. Can someone please advice me as to how to
>browse through the objects in zodb and extract the properties and
>values of those objects? Is it possible at all?

Sure, as the ZMI does it.

Containers are almost always "ObjectManager"s.
You can use their "object*" methods ("objectIds", "objectValues",
"objectItems") to access their children.

Property extraction is a bit more difficult (because there
are innumerous ways to implement properties).

Almost all Zope objects have a "getId()" method and
a "title" attribute.

Many Zope objects are so called "PropertyManager"s.
They provide the "PropertyManager" API to access
the properties (see "OFS/PropertyManager.py").

Many objects implements their properties in non-standard ways...
You must look at their source to find out how to access
such properties.

>The Data.fs file that
>I'm dealing with is about 500MB :-(

Maybe, you pack the database. Some chance that "Data.fs"
gets drastically smaller...


>Also do you know any freely available tool (Other than ZMI) that would
>help me view the contents of a ZODB database?

Do you like XML?

Then the XML export feature of Zope might please you.

You can export the content of selected folders
as a (horribly looking) XML file.

-- 
Dieter


More information about the ZODB-Dev mailing list