Get objects from ZODB into MySQL

T

TheIvIaxx

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 :)

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.

Any ideas on this? Where in the DB are these objects stored and how
to retrieve them?

Thanks
 
D

Diez B. Roggisch

TheIvIaxx said:
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 :)

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.

Any ideas on this? Where in the DB are these objects stored and how
to retrieve them?

The ZODB is essentially a persisted object graph. Not more, not less. In
other words: there is no way to extract any "raw" data, all are
python-objects. To persist these, you need to write a serialization of
these objects to something that you can process further. XML-pickling
might be an option. Or you write some generic thing based on dir() or
__dict__.

Diez
 
G

Gabriel Genellina

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 :)

Try Shane Hathaway's APE library [1]. Currently unmaintained, but if this
is a one-shot project it may be useful.
[1] somewhere inside http://www.hathawaymix.org -- maybe
http://hathawaymix.org/Software
 
W

William Heymann

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,819
Latest member
masterdaster

Latest Threads

Top