People proudly say WordPress powers more than 20% of the sites on the web. But you will be surprised to see how difficult it is, when using the popular content management system. Migrating from one company to other company is one of the serious problems in hosting WordPress sites. This will be easier when you move the entire cPanel and the new hosting company helps in free or paid migration. Unfortunately it is not always the case that you move entire hosting account to another service. Most of the time, what you need is to move only some of the sites on your own. In such kind of scenario there are plenty of practical problems will arise. And moving images is the biggest pain in migrating sites.
Why Moving Image is Pain?
Over the period of time you might have accumulated lots of images on your site. Each image will have different thumbnail sizes based on your theme. In general, any commercial theme will use at least 8 to 15 thumbnails for each image. So when you have 1000 images on your site, the total file count will become 8000 to 15000 depending on your theme.
So downloading such large volume of image files and again uploading to the new platform through FTP will easily take few days of your time. On top of this, the problem is different that WordPress does not support registering these images. This essential means you will not see any of the uploaded images through FTP under “Media > Library” in WordPress admin dashboard.
Remember, your site will still work properly and show all the images from the server.
But you can’t see them in the WordPress dashboard under “Media > Library”.
It will lead to a situation that you can’t reuse those images anywhere on the site because it will not be visible from “Add media” option in post editor.
Let’s see how to fix this problem with least time consuming method.
Install Media to FTP Plugin
Though the situation is bad, the good part is that WordPress has plugin for every problem. Go to “Plugins > Add New” and search for “media to FTP”. Install and activate the plugin.
Verify Media Upload Paths
Go to “Media from FTP” menu and verify the “Server path status” section that all upload paths are correct. This is required especially if you have changed the default WordPress media folder path.
Set Image Register Date
Here is the problem again, if you were using organize uploads into month and year based folders. Let’s say you have an image1 on the original site uploaded on 08/2017. If you have arranged the uploads into month-and-year-based folder, then the URL should be:https://yoursite.com/wp-content/uploads/2017/08image1.png
Now that you have uploaded the image to the new hosting platform through FTP on, say 28.06.2018. You may be using the plugin on the same day or one day later like 01.07.2018. The plugin will not help you to retain the original date of 2017/08. What you can get is either 2018/06 or 2018/07. Go to “Media from FTP > Settings” and set the necessary option for this date and choose the organize uploads option if you previously use.
Update Images to Media Folder
Go to “Search & Register” option to see the screen like below:
- You will see the warning message showing that the images will be updates into month-year structured folders. So be sure that you were previously using the same structure, otherwise disable the option on your new site.
- Choose the folder from where you want to import the images. You can either do folder by folder or choose “/wp-content/uploads” folder from the drop-down.
- Click on the “Search” button to get the list of images from the server. You can also filter different media types and extensions.
- The bulk change date option will set the month/year for all image URLs based on this date.
- You can set different date for each image in the text box. The date shown in this box is the date you had uploaded the image through FTP.
- Remember none of the above dates are the original image uploaded date on the site. You can get this only from the image URL. If you have less images then check the current image URL and set the same month/year in the date field. This will ensure the image URL is not changed. If you have many images then it’s up to you to either modify one by one or use bulk change date.
- Select either individual images or select all for bulk update.
- Click on the “Update Media” button to upload the selected images to media library.
The upload process will take some time based on the number of images selected.
Attach Images to Posts
Once the process is completed, you can view all the imported images in “Media > Library” folder. The images are not attached to any posts, so you should select and attach images to the correct post. This is required especially if you are redirecting image attachment URL to post URL in Yoast SEO.
If you don’t attach the image to any post URL, they will be indexed in search engines with the image URL.
Fixing Broken Links
If the image URLs changed in the above process then you should check for broken links and fix the errors manually. Remember when the imported image URL is different, the image will still be showing on the site from the server. So you will not see broken images but the same image will be available in two different folders, probably like “/2017/08/image.png” and “/2018/06/image1.png”.