Migrating data from Plone to Liferay, or how could I retrieve information from Plone's Data.fs

Posted by brandizzi on Stack Overflow See other posts from Stack Overflow or by brandizzi
Published on 2010-03-06T23:33:25Z Indexed on 2010/04/15 0:33 UTC
Read the original article Hit count: 473

Filed under:
|
|
|
|

Hello, all.

I need to migrate data from a Plone-based portal to Liferay. Has anyone some idea on how to do it?

Anyway, I am trying to retrieve data from Data.fs and store it in a representation easier to work, such as JSON. To do it, I need to know which objects I should get from Plone's Data.fs. I already got the Products.CMFPlone.Portal.PloneSite instance from the Data.fs, but I cannot get anything from it. I would like to get the PloneSite instance and do something like this:

>>> import ZODB
>>> from ZODB import FileStorage, DB
>>> path = r"C:\Arquivos de programas\Plone\var\filestorage\Data.fs"
>>> storage = FileStorage.FileStorage(path)
>>> db = DB(storage)
>>> conn = db.open()
>>> root = conn.root()
>>> app = root['Application']
>>> plone_site = app.getChildNodes()[13] # 13 would be index of PloneSite object
>>> a = plone_site.get_articles()
>>> for article in a:
...    print "Title:", a.title
...    print "Content:", a.content
Title: <some title>
Conent: <some content>
Title: <some title>
Conent: <some content>

Of course, it did not need to be so straightforward. I just want some information about the structure of PloneSite and how to recover its data. Has anyone some idea?

Thank you in advance!

© Stack Overflow or respective owner

Related posts about plone

Related posts about zope