Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing the featured image remapping process after import #53

Open
GonZOO82 opened this issue Jul 22, 2019 · 5 comments
Open

Missing the featured image remapping process after import #53

GonZOO82 opened this issue Jul 22, 2019 · 5 comments

Comments

@GonZOO82
Copy link

GonZOO82 commented Jul 22, 2019

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>
@schlessera
Copy link
Member

I suspect this is due to the known bug in here: wp-cli/export-command#53

I'll try to see if we can fix this bug for the upcoming v2.3.0 release.

@curtismchale
Copy link

I'm still seeing this bug. Is there any ETA on resolving it?

@E-VANCE
Copy link

E-VANCE commented Oct 19, 2020

+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...

@dzg
Copy link

dzg commented Sep 4, 2021

+1 ... will this ever be fixed?

@janw-me
Copy link
Member

janw-me commented Oct 8, 2021

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants