Get objects from ZODB into MySQL

Discussion in 'Python' started by TheIvIaxx, Apr 27, 2009.

  1. TheIvIaxx

    TheIvIaxx Guest

    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
     
    TheIvIaxx, Apr 27, 2009
    #1
    1. Advertising

  2. 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
     
    Diez B. Roggisch, Apr 27, 2009
    #2
    1. Advertising

  3. En Mon, 27 Apr 2009 19:13:39 -0300, TheIvIaxx <>
    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
     
    Gabriel Genellina, Apr 28, 2009
    #3
  4. 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
     
    William Heymann, Apr 28, 2009
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Achim Domma

    loading objects from ZODB

    Achim Domma, Jul 4, 2003, in forum: Python
    Replies:
    2
    Views:
    335
    John J. Lee
    Jul 5, 2003
  2. drs

    More ZEO/ZODB issues

    drs, Jul 12, 2003, in forum: Python
    Replies:
    0
    Views:
    335
  3. Diez B. Roggisch

    zodb troubles - seeking advice for app design

    Diez B. Roggisch, May 6, 2004, in forum: Python
    Replies:
    3
    Views:
    357
    Dieter Maurer
    May 7, 2004
  4. Matteo Merli

    ZODB revision

    Matteo Merli, Jul 4, 2004, in forum: Python
    Replies:
    1
    Views:
    288
    Thomas Guettler
    Jul 6, 2004
  5. Gary

    ZODB and Boa

    Gary, Oct 13, 2004, in forum: Python
    Replies:
    4
    Views:
    535
Loading...

Share This Page