Migrating data from Plone to Liferay, or how could I retrieve information from Plone's Data.fs
- by brandizzi
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!