Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Python: Python

Get objects from ZODB into MySQL

 

 

Python python RSS feed   Index | Next | Previous | View Threaded


theiviaxx at gmail

Apr 27, 2009, 3:13 PM

Post #1 of 4 (750 views)
Permalink
Get objects from ZODB into MySQL

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
--
http://mail.python.org/mailman/listinfo/python-list


deets at nospam

Apr 27, 2009, 3:20 PM

Post #2 of 4 (703 views)
Permalink
Re: Get objects from ZODB into MySQL [In reply to]

TheIvIaxx schrieb:
> 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
--
http://mail.python.org/mailman/listinfo/python-list


gagsl-py2 at yahoo

Apr 27, 2009, 4:14 PM

Post #3 of 4 (705 views)
Permalink
Re: Get objects from ZODB into MySQL [In reply to]

En Mon, 27 Apr 2009 19:13:39 -0300, TheIvIaxx <theiviaxx [at] gmail>
escribió:

> 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

--
Gabriel Genellina

--
http://mail.python.org/mailman/listinfo/python-list


kosh at aesaeion

Apr 27, 2009, 5:08 PM

Post #4 of 4 (699 views)
Permalink
Re: Get objects from ZODB into MySQL [In reply to]

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
--
http://mail.python.org/mailman/listinfo/python-list

Python python RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.