The 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