ashishb / wp2hugo

The best WordPress to Hugo migrator (written in Go)
https://ashishb.net/tech-thoughts/migrating-from-wordpress-to-hugo/
Other
194 stars 9 forks source link

multisite-export: ignore Unknown publish status / filter posts by dc:creator #26

Closed Finkregh closed 1 month ago

Finkregh commented 2 months ago

I´d like to migrate a blog from a single multisite installation. The export seems to contain all posts from all blogs and/or attatchments as posts. Seems to be a mess :|

The error I get:

{"level":"fatal","time":1721118731,"message":"Unknown publish status: attachment for gras - 1.thumb"}

XML:

                                        <item>
                <title><![CDATA[gras - 1.thumb]]></title>
                <link>https://bar.de/?p=9</link>
                <pubDate>Thu, 14 Sep 2006 20:10:19 +0000</pubDate>
                <dc:creator><![CDATA[Finkregh]]></dc:creator>
                <guid isPermaLink="false">http://foo.net/photoblog/wp-content/uploads/2006/09/1thumb.jpg</guid>
                <description></description>
                <content:encoded><![CDATA[]]></content:encoded>
                <excerpt:encoded><![CDATA[]]></excerpt:encoded>
                <wp:post_id>9</wp:post_id>
                <wp:post_date><![CDATA[2006-09-14 22:10:19]]></wp:post_date>
                <wp:post_date_gmt><![CDATA[2006-09-14 20:10:19]]></wp:post_date_gmt>
                <wp:post_modified><![CDATA[2024-07-16 10:21:41]]></wp:post_modified>
                <wp:post_modified_gmt><![CDATA[2024-07-16 08:21:41]]></wp:post_modified_gmt>
                <wp:comment_status><![CDATA[open]]></wp:comment_status>
                <wp:ping_status><![CDATA[open]]></wp:ping_status>
                <wp:post_name><![CDATA[gras-1thumb]]></wp:post_name>
                <wp:status><![CDATA[attachment]]></wp:status>
                <wp:post_parent>0</wp:post_parent>
                <wp:menu_order>0</wp:menu_order>
                <wp:post_type><![CDATA[post]]></wp:post_type>
                <wp:post_password><![CDATA[]]></wp:post_password>
                <wp:is_sticky>0</wp:is_sticky>
                                                                                <category domain="category" nicename="uncategorized"><![CDATA[Uncategorized]]></category>
                                                </item>

Other values:

❯ grep 'wp:status' bar.WordPress.2024-07-16.xml | sort -u           
        <wp:status><![CDATA[attachment]]></wp:status>
        <wp:status><![CDATA[draft]]></wp:status>
        <wp:status><![CDATA[inherit]]></wp:status>
        <wp:status><![CDATA[private]]></wp:status>
        <wp:status><![CDATA[publish]]></wp:status>
        <wp:status><![CDATA[static]]></wp:status>
        <wp:status><![CDATA[trash]]></wp:status>

A possibility to filter by dc:creator would already help :)

Thanks!

ashishb commented 1 month ago

Thanks. Can you email me a sample file to experiment with?

ashishb commented 1 month ago

{"level":"fatal","time":1721118731,"message":"Unknown publish status: attachment for gras - 1.thumb"}

Fixed in https://github.com/ashishb/wp2hugo/commit/1b52f8aabd636c858d42f9ab0d97f112deb9b9dc

ashishb commented 1 month ago

A possibility to filter by dc:creator would already help :)

Added in https://github.com/ashishb/wp2hugo/commit/405d428962cd6ccd2990fa1eec345b5ed6d1b7f9

Finkregh commented 1 month ago

Thanks! Sorry for no reply, I was a little swamped :/