Migration complete… but where are the images?

Trello board tracking the migration of my websites
Trello board tracking the migration of my websites

For much of the last two weeks I’ve focussed on two things:

  1. Redesign my website (garethjmsaunders.co.uk)
  2. Migrate that site, this blog, my SEC digital calendar site, and the NYCGB alumni website to a new web host (SiteGround).

I’ve managed to complete the project three days early… well, kind of.

WordPress… we have a problem

One unforeseen snag has been to do with the media (images, PDFs, zip files, etc.) on this blog.

I’ve been using WordPress since version 0.7 in 2003. During that time I’ve been uploading image after image, and as WordPress changed the way that it stored images I’ve experimented with different ways of organising it—even simply uploading the images to my server via FTP. I must have tried about four or five different arrangements.

For the most part, though, I’ve been uploading files directly into /wp-content. Occasionally I’d switch on the “organise my uploads into month- and year-based folders” option.

In short the organisation of media on this blog has been a mess, and I’ve always shied away from addressing it because… well, it worked.

When I came to consider migrating this blog from Heart Internet to SiteGround I did think about the media: would it be a problem if I simply transferred everything over as is and sort it out there.

I was a fairly tight schedule (it had to be completed by 20 January so that my Heart Internet hosting account wasn’t renewed) and I reckoned that since it worked fine at Heart Internet then it should work at SiteGround.

I was wrong.

cPanel and the mystery of the 1,998 files

SiteGround uses cPanel. As Wikipedia explains, “cPanel is a Linux-based web hosting control panel that provides a graphical interface and automation tools designed to simplify the process of hosting a web site.”

cPanel uses Pure-FTPd, a free (BSD licence) FTP server which by default shows up to 2,000 files in each folder. I found that out after the event tucked away in the cPanel documentation.

I had 3,688 files plus 10 directories in my /wp-content folder and I couldn’t figure out why it would only display 1,998 files and the previously  visible directories, such as /plugins and /themes had disappeared.

So…

I am manually working my way through the media library. Uploading files into the appropriate /wp-content/uploads/<year>/<month> directories and updating the database to tell WordPress where the files are.

For those files that were uploaded before there was such a good media library I’m using the Add From Server plugin to quickly import media into the WordPress uploads manager.

This is going to take a while, so please bear with me.

Update

Monday 19 January 2015

I’m making good progress already. I’ve fixed 360/700 images in the media library. That’s 51%, just over the halfway mark.

I’m finding it strangely satisfying getting this sorted out. A bit of website gardening.

WordPress upgrade: filling in the missing pieces

Missing piece

Well, where to start?

I’ve been meaning to blog about life for ages but since Reuben and Joshua were born in November 2008 other things took more of a priority.  Things like attending to twin boys, eating, getting enough sleep, and generally trying to muddle through the days.  I’ll likely write more about that in the future.

Simplifying life

Over the last few months I’ve been working at simplifying life as much as possible, and being a good Getting Things Done / Take Back Your Life disciple and disengaging from projects and tasks that I knew I wouldn’t/couldn’t complete or which were no longer priorities.  It’s felt good.

That’s given me more of a focus on the things that I do want to do.  Sorting out my web server was one of those things.

Server upgrade

I suspect that I would have blogged more about it at the time (and I now wish that I had) but I made a promise to myself that I wouldn’t blog again until I’d upgraded my server.  Of course, that took a good few months longer than I had anticipated (doesn’t everything these days?).

In February I moved from Webfusion to Heart Internet, after an abortive attempt to simply upgrade to a better hosting package at Webfusion.  The killer feature that was missing from the Webfusion package was subdomains; I didn’t want to lose my www.garethjmsaunders.co.uk URL that I’d just had printed onto a custom-made laptop skin.

So far my experience of Heart Internet has been excellent.

Upgrade WordPress

The most pressing reason for moving to a better server was to enable me to upgrade WordPress, the software that manages my blog.  My old host had a bunch of really out-of-date features (MySQL 3.2 and PHP4) which just wasn’t enough to run the latest versions of WordPress.  What a relief to be able to upgrade from WordPress version 2.0.11 to the latest version 2.9.

And wow! there have been quite a few changes to WordPress in the interim: the addition of widgets and tags, as well as critical changes to the main API, a much nicer UI, etc.  So many changes in fact that my old theme broke.  So that had to be fixed.

The upgrade was pretty pain-free thanks to WordPress’s infamous 5-minute install and upgrade script.  (I tested it out first, of course, on my localhost machine using XAMPP.)  The only thing that I missed was matching the database character set encoding.  It was set to ISO-8859-1 (Latin-1) rather than UTF-8 (Unicode) so there are still a few odd character combinations on the blog that I need to track down.

Batch categories

WordPress now has tags.  Back it the day it only supported categories so I, like many other WordPress users, created tens of categories to organise what I was writing about.  I had 88 categories.

I found a tremendous plugin called Batch Categories which let me quickly (by which I mean over the course of two days, rather than weeks if I had to edit each post individually) move groups of posts from one category to another, and also add tags to groups of posts.

So I took the easy route of replacing most of the categories I had with tags and rationalising my categories down to nine:

  1. Books
  2. Computer
  3. Family
  4. General
  5. God Project
  6. Mah Jong
  7. Music
  8. Psion
  9. Web

Next …

I’m really keen to redesign my blog theme but I’m going to hang off on that for the time being.  I’ve got a couple of other things that I want to complete first.

CSS framework

The first thing is to complete work on what started as a plugin for the Blueprint CSS framework and which is now turning out to be a combination of different parts of my favourite CSS frameworks.

Website redesign

Once that’s done I’m going to work on a complete reworking of my main website www.garethjmsaunders.co.uk.  The last time I did any serious work on it was, I think, probably around 2003.  The code has a very serious dose of ‘classitis‘.

One of my biggest drivers is the number of emails and telephone calls that I still get for information about and software for the Psion range of PDAs.  I want to create some space for myself by putting a lot more of that information on my site, in a way that it can be found more easily.

Moving to a new server

I’m in the process of moving Web servers on my main website and blog: www.garethjmsaunders.co.uk, from a really old hosting account at Webfusion to a new shiny one with Heart Internet.

I’ll write more about why I’m moving at a later date, in the meantime simply know that there may be a little disruption to the website and blog (as well as to my email) over the next 24-48 hours while nameservers and DNS settings are updated.

I’ve been meaning to upgrade my hosting account for months, which is actually one of the reasons why I’ve not been blogging quite as much as I’d have liked. “I’ll write about that after I’ve moved servers,” I’ve thought and then postponed the move because something else got in the way. In the end, last week I decided to just do it!

I’ll see you on the other side.