I'm migrating my old blog to Wordpress. I imported all old posts. I copied all images from the old website under uploads
and the posts display everything correctly.
The problem is when I try to update a new media because the upload is failing and I can't see all my pictures.
What can I do to fix this issue?
Update
If I open Media
everything seems fine
but when I change view I see that:
I'm migrating my old blog to Wordpress. I imported all old posts. I copied all images from the old website under uploads
and the posts display everything correctly.
The problem is when I try to update a new media because the upload is failing and I can't see all my pictures.
What can I do to fix this issue?
Update
If I open Media
everything seems fine
but when I change view I see that:
Share Improve this question edited Mar 26, 2020 at 11:33 Enrico asked Mar 26, 2020 at 8:58 EnricoEnrico 1214 bronze badges1 Answer
Reset to default 0The problem is a failed assumption, the media library is not a file directory, it doesn't even look at the uploads folder.
When you upload things to WP, it creates an attachment
post, and it's those that get shown in the media library. Otherwise, if it just listed what was in the uploads folder, every file would appear 3 or 4 times for each image size. Not only that, where would it store the descriptions, titles, etc
So to get these images to appear in the media library, you should have migrated the attachment
posts, not just the post
and page
posts. Adding them to the database would fix this
You might also have issues with nav menus, as there are other custom post types WordPress uses behind the scenes, e.g. nav_menu_item
.
Also, because you didn't migrate attachment posts, if you restore them they may have incorrect post IDs, which means all your featured images will be broken, and possibly a number of other things such as header images in themes. This is because plugins and themes are meant to store the attachment ID, then ask for the image size they want, instead of storing the URL. As a result you might need to clear your database, and migrate again from scratch.
If you're using the WordPress importer, make sure to export all content, and when you import, that you tell it to import media