The day the SEC website lost its mind

Broken lightbulb

Today I met with The Revd Canon Cliff Piper, a friend from my days in The United Diocese of Moray, Ross and Caithness, and the convenor of the Information and Communication Board of the SEC to teach him how to use and update the SEC website. It was great to catch up with Cliff, and I gave him a full behind-the-scenes low-down on how the website works and how to add and edit posts, upload images and all that jazz. But the day didn’t exactly begin quite so well.

I decided that it would be better if we worked on a mirror copy of the website on another server, rather than on the actual SEC website. That way if things went wrong it wouldn’t matter. So I backed up the database, backed up the files, and then uploaded WordPress to another server and created a new database. That all went well, no problems there.

I then restored the backed-up SEC website database to the new mirror server. And somewhere in the process of updating the options on the mirror site my poor browser got confused and updated the actual site. (Are you following me so far?) The result was that the actual SEC website now thought it was on the mirror server!

We’re talking serious problems here. We’re talking a website with a bit of a mental illness: all the physical files were in place and looked fine, but somehow the website’s ‘mind’ (the database) was all messed up!

That shouldn’t be a problem! I should just be able to restore the backed-up database. Except that Lumison, the web host that the SEC website is stored on, doesn’t use a user-friendly MySQL database management tool like phpMyAdmin. Instead they prefer you to use SSH Shell access, in other words you text type commands into a black screen to connect to a remote computer.

Thankfully, in my Geek Kit™ I have a copy of PuTTY, a client program for the SSH, Telnet and Rlogin network protocols. Here is a screenshot of it, in all its glory:

Screenshot of PuTTY SSH client
Screenshot of PuTTY SSH client.

Exciting stuff! And oh so simple to use!? It took me a couple of goes, but I eventually managed to login to the Lumison shell server ( and then login to their MySQL server and restore the backup database file, writing over the dodgy info with good, clean, newly-backed-up data, using this memorable command-line:

mysql -h mysqlhostserver -u mysqlusername -p databasename < public_html/backup/sec.sql

(The names of real passwords, usernames and locations have been changed to protect the innocent.) Always handy to know how to do these things.

Now that the real website was working fine, returning to my mirror site I logged into the MySQL database using phpMyAdmin — which my fine server host offers — and I manually edited the database, ready for Cliff and I to play around with it. And I made sure that the real SEC website was open in Firefox and the mirrored site in Opera. I sure didn’t want to get my poor browsers confused again.

It was a good idea, a shame that I broke it!

Edinburgh castle in the winter sun

View of Edinburgh Castle from George Street
View of Edinburgh Castle from George Street, looking down North Castle Street.

Yesterday, following the Eucharist at the Church of the Good Shepherd I wandered into town to meet with someone from the congregation for lunch.

I love walking through Edinburgh, especially at this time of year, with all the busyness and colours. I was struck by this view of the castle and buildings caught in the winter afternoon sun. The photo quality isn’t the highest, taken on my Nokia 5140i phone, but you get the picture.