Media library images "missing" after migrating them using SQL
-
I am migrating a lot of posts from an old site to a new site, and these posts have a lot of Advanced Custom Field “relationship” data attached to them. Because of this, I want to keep all of the ids of my posts, taxonomy terms, images, etc the same in the new database so that none of these relationships will be lost. I managed to do that successfully with the taxonomies, but I can’t figure out how to get the images to work.
In an attempt to do this, I exported all the posts with type “attachment” from the old database and imported them into the new database. I changed all the GUIDs so they point to the new domain rather than the old. I copied the entire /wp-content/uploads/ folder from the old site to the new site, so the paths are still correct.
When I go to the Media Library I can see all the image posts listed, however they all have the default /wp-includes/images/media/default.png “not found” image. If I click on “view” it brings me to the default single.php page but doesn’t display the image – rather, it has a text link to the GUID value and when I click that, it does display the image file directly. If I click Edit, I have the fields to enter Caption, Alt Text, and Description, but the large image at the top with the “Edit Image” button is missing. The GUID on the right side is correct.
It seems like there’s another connection in the database that I wasn’t aware of, since the GUID is correctly connected and yet WordPress isn’t able to find the images anywhere. What did I miss and how can I get it out of the old DB into the new one?
- The topic ‘Media library images "missing" after migrating them using SQL’ is closed to new replies.