I have mentioned before about moving my blog from a self-hosted one to this WordPress one, and I thought it had gone surprisingly smoothly, except for the loss of all my old followers which is slowly growing back, and also something else I didn’t notice until my old blog was officially taken down, was the links to certain images within blog posts. They are broken. Argh.
I’m reminded of a quote by Robert Bateman “Creation is long and difficult, destruction is quick.”
Yep, couldn’t have said it better myself. It was tough to see years of work destroyed, or at least all screwed up. What was happening, as i found out, was that for some reason certain images did not get exported from the old site and imported into the new site. Instead they were just pointed to the old website. I hadn’t noticed because everything seemed fine while the old blog was still up and running. I had used the WordPress export plugin, a number of times actually since the blog was basically a backup of my other one. I would export the entries about once a month or so to keep this one updated. I mention this because as it will become evident later, tracking down the issues turn out to be different depending upon the entry.
After signing into the dashboard of my new blog and checking the Visual preview of my published posts in edit mode, I could see the images were missing and i was getting that cute little question mark indicating a broken link. Flipping over to “text” helped me identify the reason pretty quickly. This is when I figured out my images where pointing to the now defunct website.
the highlighted words points out the problems.
First off was the link to the image. Even though the “href” (or hypertext reference) was correct, the “src” (or source), was pointing to the old website to grab the image from. I wasn’t quite sure what the actual location should be so I just browsed to an image that was working and copy clipped its location from the inspector into the text editing screen. It didn’t matter what image or where I dropped it, since it was just so I could see what it was supposed to be. In the end, mostly it meant copy clipping “barkerp.wordpress.com/” and pasting it where “thatcomputerguy.ca/wp-content/uploads” was. The dates afterward seemed to be the same for the most part, except for a couple of instances. For some reason a number of images had been imported with a different month number. Not sure why.
the address of the image
I wondered about using a search and replace editor to substitute the one for the other everywhere, but realized after doing a few that wasn’t the only problem and hand editing each blog seemed to be the only solution. Some images still were not loading.
When I had inserted the image into the original blog post, sometimes I would insert them at one specific size, and then later edit it manually to shrink it down a bit. For instance, if an image had a suffix of -200×300 and then I manually edited the size, to say 160×240, those are the files it would have trouble with. For some reason, certain images stored the size with the image name as a suffix to it, as seen in the highlighted text in the image above. After the name “…netflix-001” was the suffix “-300×159” This wasn’t part of the actual image name that was being pointed to in the link for it. So by deleting that portion of the name, the image would then appear on the blog post as it should. You shouldn’t add an image and give it a size and then change the size manually it seems. Lesson learned.
yeah, that’s not how it should look
Another problem I found seemed to be the way the different image sizes were being handled. Most of my images were medium or large or thumbnail, for example “…img class=”size-large wp-image-5088″ title=”dlna-mac-04“. But when I checked the images that were displaying like the above with the image extending thru the text and not wrapping properly around it, I noticed the image was labeled as “full” and not large or medium as most were.
the culprit: “size-full”
By changing the word “full” to “large” the problem was fixed. I’m not sure if one of the versions of WordPress I had used over the years had allowed “full” as a size but no longer did, or if it was a throwback to one of the other numerous blogging programs I’d used, but for some reason this version of WordPress didn’t like it. Again, a simple fix, just had to look at the difference between images that were working and those that weren’t to find the commonality between them. Another lesson learned.
300 posts (6-1/2 years worth of ramblings), about 8 hours of hand editing and I’m back to where I was prior to the move. Well, plus one blog post that is. This one explaining all the trials and tribulations of the move. If one person reads this post and it stops them from tearing out their hair then its all worth it.
At least that’s what I’m telling myself.
barkerp (the blogger formerly known at tcg)