There are a good number of blog posts out there helping people migrate their sites to Orchard, but few, it seems, heading in the other direction.
I toyed with a few ideas, but I ended up using XSLT (Xml Stylesheet) to transform the XML generated by Orchard's export feature into WXR (Wordpress eXtended RSS). I used Visual Studio to perform the transform, which limited me to XSLT 1.0, but it got the job done.
The transformation is pretty smooth, for the most part. I'm working to migrate the Kabbage blog (http://www.kabbage.com/blog), and there are a few caveots to the XSLT below:
We're assuming all blog posts are authored by the same user (admin), so we're not importing users
We hardcode the post links to be in a blog subdirectory: www.example.com/blog/something
It assumes that Wordpress will eat duplicate categories (XSLT 1.0 seems to have issues making distinct values)
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="msxsl" xmlns:fn="http://www.w3.org/2005/xpath-functions">
<xsl:output method="xml" indent="yes" />
<xsl:template match="/">
<xsl:variable name="loop" select="Orchard/Data/Blog[BodyPart/@Text != ''] | Orchard/Data/BlogPost[BodyPart/@Text != '']" />
<rss version="2.0"
xmlns:excerpt="http://wordpress.org/export/1.2/excerpt/"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:wfw="http://wellformedweb.org/CommentAPI/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:wp="http://wordpress.org/export/1.2/">
<channel>
<wp:wxr_version>1.2</wp:wxr_version>
<wp:author>
<wp:author_id></wp:author_id>
<wp:author_login>
<xsl:value-of select="Orchard/Recipe/Author" />
</wp:author_login>
<wp:author_email>admin@example.com</wp:author_email>
<wp:author_display_name><![CDATA[admin]]></wp:author_display_name>
<wp:author_first_name><![CDATA[]]></wp:author_first_name>
<wp:author_last_name><![CDATA[]]></wp:author_last_name>
</wp:author>
<xsl:comment>
The first loop defines categories. WP uses this to create new categories.
</xsl:comment>
<xsl:for-each select="$loop">
<wp:category>
<wp:term_id>
<xsl:value-of select="position()"/>
</wp:term_id>
<wp:category_nicename>
<xsl:value-of select="substring-before(substring-after(TaxonomyField.Category/@Terms,'/alias=categories\/'),'/')"/>
</wp:category_nicename>
<wp:category_parent></wp:category_parent>
<wp:cat_name>
<xsl:value-of select="translate(substring-before(substring-after(TaxonomyField.Category/@Terms,'/alias=categories\/'),'/'),'-',' ')"/>
</wp:cat_name>
</wp:category>
</xsl:for-each>
<xsl:for-each select="$loop">
<xsl:variable name="slug" select="substring-before(substring-after(substring-after(@Id,'='),'/'),'/Identifier')" />
<xsl:variable name="body">
<xsl:text disable-output-escaping="yes"><![CDATA[</xsl:text>
<xsl:value-of select="BodyPart/@Text"/>
<xsl:text disable-output-escaping="yes">]]></xsl:text>
</xsl:variable>
<xsl:variable name="publishDate">
<xsl:value-of select="substring-before(CommonPart/@PublishedUtc,'T')"/>
<xsl:text> </xsl:text>
<xsl:value-of select="substring-before(substring-after(CommonPart/@PublishedUtc,'T'),'Z')"/>
</xsl:variable>
<item>
<wp:post_type>post</wp:post_type>
<wp:status>publish</wp:status>
<wp:post_name>
<xsl:value-of select="$slug"/>
</wp:post_name>
<category domain="category">
<xsl:attribute name="nicename">
<xsl:value-of select="substring-before(substring-after(TaxonomyField.Category/@Terms,'/alias=categories\/'),'/')"/>
</xsl:attribute>
<xsl:value-of select="translate(substring-before(substring-after(TaxonomyField.Category/@Terms,'/alias=categories\/'),'/'),'-',' ')"/>
</category>
<title>
<xsl:value-of select="TitlePart/@Title" disable-output-escaping="yes"/>
</title>
<link>
<xsl:text disable-output-escaping="yes"><![CDATA[http://www.example.com/blog/</xsl:text><xsl:value-of select="$slug" disable-output-escaping="yes"/>
<xsl:text disable-output-escaping="yes">]]></xsl:text>
</link>
<dc:creator>
<xsl:text disable-output-escaping="yes"><![CDATA[</xsl:text>
<xsl:value-of select="substring-after(CommonPart/@Owner,'=')" disable-output-escaping="yes"/>
<xsl:text disable-output-escaping="yes">]]></xsl:text>
</dc:creator>
<wp:post_date>
<xsl:value-of select="$publishDate"/>
</wp:post_date>
<wp:post_date_gmt>
<xsl:value-of select="$publishDate"/>
</wp:post_date_gmt>
<content:encoded>
<xsl:value-of select="$body" disable-output-escaping="yes"/>
</content:encoded>
<wp:postmeta>
<wp:meta_key>custom_permalink</wp:meta_key>
<wp:meta_value>
<xsl:text disable-output-escaping="yes"><![CDATA[</xsl:text>
<xsl:value-of select="substring-after(AutoroutePart/@Alias,'blog/')" disable-output-escaping="yes"/>
<xsl:text disable-output-escaping="yes">]]></xsl:text>
</wp:meta_value>
</wp:postmeta>
</item>
</xsl:for-each>
</channel>
</rss>
</xsl:template>
</xsl:stylesheet>
We will be performing the blog migration in the coming weeks and this migration will be a key step in the process. I'm sure it will change between then and now, so I'll be sure to update the code provided.