How do I move uploaded images from one WordPress host to another?
This question was recently asked in the WordPress sub-reddit.
Here is my interpretation of the user’s question and what I will be attempting to answer in this post:
My WordPress website was transferred to a new hosting account and made live on a new domain. My /wp-content/uploads/ directory only contains folders back to 2013, while I have posts with images dating back to 2006. The images for these older blog posts are not displaying on the new website. I still have access to the old website where the images for those posts display properly. What should I do to fix this?
You’ll want to transfer those images via FTP to your new website into the /wp-content/uploads/ directory while maintaining their year / month directory structure. If the previous developer just simply didn’t transfer the website’s images over then this should solve your problem and the images should begin to load.
If it were me, I would check the URL for one of the images which is failing on the new website and compare it to the same post’s image URL on the old website. If the only thing that is different between the two URLs is the domain name then simply transferring the files over will fix your problem. But, it should be noted that those images will not begin displaying in the media library after you transfer them. To display in the media library an image which has been uploaded requires a database entry. This is created automatically when an image is uploaded via the media library or via a post editor. By simply uploading the images via FTP, however, these database records are not created. To add those records, if you’d like / need them, you’ll probably want to make use of a plugin. I’ve had mixed success with the Add From Server plugin, but there are other options available. It looks like Media Sync might be another alternative. I do urge you to create a backup of your database before utilize one of these plugins. If they do something unanticipated or undesired you may wish to revert the changes.
I’d guess that the individual who transferred your website used the post export / import feature which has an option to “Download and import file attachments.” In the past this has been notorious for not working as anticipated.