import-command
import-command copied to clipboard
Missing the featured image remapping process after import
I tried the CLI tool, and I import the big XML file. Importing is fast and cool, but I have a big problem. When I import the post with attachment (featured image) then is not paired to the post. I don't add the post_id to the post, but I use incrementing ID at attachment and that I add to the meta_value to the post item.
Sample XML:
<item>
<title>Post content title</title>
<wp:post_type>post</wp:post_type>
<wp:postmeta>
<wp:meta_key>_thumbnail_id</wp:meta_key>
<wp:meta_value><![CDATA[1234]]></wp:meta_value>
</wp:postmeta>
</item>
<item>
<wp:post_id>1234</wp:post_id>
<title>demo.jpg</title>
<wp:post_type>attachment</wp:post_type>
</item>
I suspect this is due to the known bug in here: https://github.com/wp-cli/export-command/issues/53
I'll try to see if we can fix this bug for the upcoming v2.3.0 release.
I'm still seeing this bug. Is there any ETA on resolving it?
+1
I just used wp import
and that generally works fine but without automatically mapping the images / attachments to the posts the whole process is being rendered useless IMHO...
+1 ... will this ever be fixed?
I've just setup a new site, filled it with a 100 demo posts. Then setup a second site with 2 posts, 3 images and where 1 post had a featured image. I exported the 2nd site and imported it into the first demo site. The featured image is correctly set.
It appears this is done in the wordpress-importer plugin that the import command uses. The exact line that fixes it even is commented // if the post has a featured image, take note of this in case of remap
So I would vote to close this issue.