I just restored the image links for the old entries that originally were posted with iBlog.
After exporting the iBlog entries using Agitprop and importing them in a local WordPress install using MAMP (or WAMP) – Bruce Mc Kenzie has a very good write up on this process on his blog – the image links pointed to localhost. This meant they showed fine on the local computer.
Upon importing the entries into a live WordPress blog, those links are not updated however and the images not imported. The typical result is no image is displayed and/or a blue question mark square in the entry:
Two things are going on:
1) the images are not present in WordPress
2) the paths to the images inside the entries are incorrect
There has to be an easier way to fix this outside of opening iBlog and a 3rd party offline WordPress client (can’t be done online, as images need to be uploaded) simultaneously; and copy/pasting entry data between the two.
Each problem actually has an easy fix and can be done online or offline in your MAMP/WAMP environment.
Step 1: Add iBlog images to the WordPress installation
iBlog has the following folder structure. Images are buried several levels deep.
Which would give you a serious workout if you were to manually retrieve those images.
Using FileJuicer (MacUpdate, Homepage) you can extract all the images in one step. In the Preferences, select the images file types you wish to extract (generally GIF and JPG) and in the results designate a destination folder. Deselect thumbnails as those are not needed. Drag and drop your Sites > iBlog > Bxxxxxxxxx folder over to the FileJuicer window and it will do all the heavy lifting for you.
In the result folder there will likely be some category icons and maybe some other files you know you will not need on the new blog. So delete those.
Time to upload the rest of the extracted files to your WordPress blog.
You may know that WordPress stores images in dated year and month folders, which would pose a problem. But, the old iBlog entries we imported have an image path without dates; so we can just simply upload all iBlog extracted images to one folder. To keep things neat and tidy I decided on a subfolder /iblog under uploads.
Using FTP I created iblog under uploads.
And copied all extracted images over.
That concludes step 1.
Step 2: Correct the image paths of imported iBlog entry images
Manually this would be another one of those repetitive nightmare things.
Download the plugin, copy it to the WordPress plugin directory on your server and activate it in your WordPress environment.
Safety note: There is no undo with this plugin. So, make sure you have a backup of your WordPress installation and database and familiarize yourself with how you may have to restore it in case things don’t go as planned. The fact that this Search and Replace function worked fine for me doesn’t guarantee it does for everybody or that one can’t make a mistake in using it.
With that out of the way, let’s have a look at the path of working image link, which we can do via view source on the site itself and in HTML view inside the WordPress:
And the path of a broken iBlog image link:
We know we uploaded the images to uploads > iblog in my case and so we can do the following replacement using the Search and Replace plugin.
Select the top option to search and replace inside Content.
And set the path to reflect that of your iblog images on your server installation.
Seconds later it will say it performed the action successfully. And, voila, the images are present in the old iBlog entries :)