mr.migrator: wordpress2plone AttributeError: Context instance has no attribute 'getPhysicalPath'

272 Views Asked by At

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
1

There are 1 best solutions below

6
On

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