1

I borrowed ideas from the configuration files at https://github.com/aclark4life/wordpress2plone/ to extend my Plone 4.3 buildout.

The intention is to make it possible to import data that had been exported from a wordpress site into my Plone site. The exported format was Wordpress eXtended RSS (wxr).

When I run the following migration command,

bin/migrate --pipeline=pipeline.cfg

I get the following error:

AttributeError: Context instance has no attribute 'getPhysicalPath'

Here's the full traceback:

Traceback (most recent call last):
  File "bin/migrate", line 293, in <module>
    sys.exit(mr.migrator.runner.runner())
  File "/home/zope/Plone/buildout-cache/eggs/mr.migrator-1.0.1-py2.7.egg/mr/migrator/runner/__init__.py", line 132, in runner
    transmogrifier(pipelineid, **overrides)
  File "/home/zope/Plone/buildout-cache/eggs/collective.transmogrifier-1.4-py2.7.egg/collective/transmogrifier/transmogrifier.py", line 59, in __call__
    pipeline = constructPipeline(self, sections)
  File "/home/zope/Plone/buildout-cache/eggs/collective.transmogrifier-1.4-py2.7.egg/collective/transmogrifier/utils.py", line 56, in constructPipeline
    pipeline)
  File "/home/zope/Plone/buildout-cache/eggs/collective.transmogrifier-1.4-py2.7.egg/collective/transmogrifier/sections/splitter.py", line 132, in __init__
    pipeline = constructPipeline(transmogrifier, sections, condition)
  File "/home/zope/Plone/buildout-cache/eggs/collective.transmogrifier-1.4-py2.7.egg/collective/transmogrifier/utils.py", line 56, in constructPipeline
    pipeline)
  File "/home/zope/Plone/side/src/transmogrify.wordpress/transmogrify/wordpress/blueprints.py", line 300, in __init__
    self.site_path = '/'.join(transmogrifier.context.getPhysicalPath())
AttributeError: Context instance has no attribute 'getPhysicalPath'

My hunch is that it is not finding my Plone instance and I'm wondering if there is something that I have not declared about the location of my Plone site, it seems that for some reason transmogrifier.context is not being set to my Plone site.

For further reference the options in my pipeline.cfg file look like this:

[options]

#Full path to the Wordpress WXR export file.
filename = /home/zope/Plone/side/myblog.wordpress.2013-06-29.xml

#Path, relative to the site root, of the folder where blog entries
#should be created.
#path = blog
path = Plone

#The desired portal_type for blog entries.  Must be something with
#a 'text' field, and must already exist in the site.  The default,
#'Blog Entry', may be obtained by installing Scrawl.
#type = Blog Entry
type = Page

#A CSS selector to find the body of a post within its full HTML page.
entry-selector = div.entry
David Bain
  • 2,439
  • 1
  • 17
  • 19

1 Answers1

0

Assuming "Plone" is the Id of your Plonesite, change the path to /Plone.

Ida
  • 3,994
  • 21
  • 40
  • So it assumes the id "Plone"? What if "Plone" is not the id? (I should really go read the code at this point :) ). – David Bain Jul 16 '13 at 16:08
  • :) True, true, should contain sitename, too, updatet answer. Just had a quick look at Alex Clark's example, which quotes '/' as path. Have you tried with '/Plone'? I stumbled also into this script, which looks promising: https://github.com/zedr/wordpress2plone/blob/master/wp2plone.py – Ida Jul 18 '13 at 05:48
  • Would love to get this mr.migrator based script working. In the meantime I've taken ideas from zedr and aclark and combined them to create my own version of a WXR importer. https://github.com/collective/wordpress2plone – David Bain Jul 20 '13 at 04:01
  • @DavidBain: It's great, that you found another solution, abandoning a question isn't. You'd just had to change the path, see what happens and share the results with us, in return of claiming time from people trying to help you to solve your problems, maybe. Besides, that this quest is low of interest (who upvoted it and why?), shows poor research and could be closed anyway. – Ida Aug 08 '13 at 11:36
  • Ida, You're right, I bit less motivated but I actually do want to get the mr.migrator approach working as it is my preferred approach. If you look at the history of questions I've asked on stackoverflow, sometimes I don't find a resolution until months later, I don't want to accept an answer unless I actually think it is the appropriate solution. I tested with other paths and so far haven't had anything that works. – David Bain Aug 09 '13 at 02:51
  • @DavidBain: I didn't want you to accept my answer, but to just share your results and was trying to kindly make you aware, that asking without being interested in a resolution, is taking unneccesary time from others. Anyway good luck with the migration(s)! – Ida Aug 09 '13 at 06:17