I am migrating a blog from the backup flat HTML files created from a now-defunct blogging platform by converting them to XML for import. I am experiencing difficulties importing some of the content, comments to posts specifically.
WordPress includes built-in import and export functions that work with particularly-formatted XML files. On the WordPress v4.9.x versions I’ve tested with at least, these functions do not work as expected. Exporting posts seems to work as expected but does not, the difficulty becomes apparent on import.
Using “miscellaneous” for the example, export produces lines like this for post categories:
<category domain="category" nicename="miscellaneous"><![CDATA[Miscellaneous]]></category>
Oddly, that category will not import correctly. If imported, when the post is looked at the category will be reported as “uncategorized.” This however, will import and be recognized:
<category>Bicycles</category>
So that issue was worked around, but something similar is happening with comments – which are included as part of posts in the export.
To reproduce, install WordPress in your local sandbox. Note that the “Hello World” post has one comment. Export the post. Delete the “Hello World” post and its comment, then import from the XML file created in the export step.
Where is the comment?
What changes need to be made to the XML so that the comment will import properly?
I tried searching to see if this had already been addressed, the search function appears to be on the fritz. I scrolled back through 10 pages (+9 weeks worth) of posts but didn’t see anything relevant.