Featured image error after importing blog posts
I exported blog posts to an xml file from a WordPress website and then imported them to another. I moved over all the images in their correct folders via FTP and then used a plugin to register them in the media gallery. They are in their correct months too. So, I have the blog posts, I have the images.
I even ran a search and replace in the database to change all the domain names to the new one yet when I go to edit the post, the featured image has a loading spinner that just spins forever and the image never shows up.
When I look in console I see this error:
Failed to load resource: the server responded with a status of 404 (Not Found)
https://example.com/wp-json/wp/v2/media/24168?context=edit_locale=user
If I follow that link I see this:
{
code: rest_post_invalid_id,
message: Invalid post ID.,
data: {
status: 404
}
}
What is happening here and how can I fix it?