I've been working on a new version of this website for a year or so now, in and around the other things I'm doing. In that time I've re-written the entire engine behind it: every line of script running this new version is new: there's no copy/paste code. The architecture has changed, the database has changed, and so on.
I've finally reached the point where I can copy all the data across from the old site, and go live with the new codebase, and all its bells and whistles.
Some people may remember a few months back, when I accidentally deleted a load of comments from the database while trying to beat back a particularly violent attack of spam (a couple of thousand comments over an hour or so: hard to handle by normal means). After that particular debacle, I decided to write a database backup script, so it could never happen again, and if it did, I'd be able to recover from it with a minimum of data lost.
Well, I just did it again. I was testing the comment data import script, got it working pretty much correctly, then emptied out the destination table ready to receive the real data, and pressed the button. As no data came for a few seconds, I had that sinking feeling, and checked both DBs... yes. The source table? Completely empty. In the destination table, my useless and incomplete test data grinned at me evilly. Wrong damned window. I swore I'd do all my DB maintenance in GUI tools after fat-fingering the command line last time, and it turns out that I'm no safer in a world of coloured rectangles than a world of white text and blinking cursors.
For the finale, the backup script that was diligently ticking away in the background? An empty file. I've no idea where I wrote the backup script, but it certainly wasn't the file that was being run once per day. So no backups either.
So, upshot: all my blog entries came across successfully. None of the comments did. If you've left a comment on this site at any time in the past, it's not there any more, and I am so, so sorry. This may be a personal site, and all, but I value other peoples' contributions, and accidentally destroying them feels like it implies disrespect for their value. I really don't mean that.
So, new year, new start, new comments table. The backup script will be the very next thing I write after this blog entry (but tomorrow morning, since I don't trust my fingers any more in a domain where I could potentially further damage the database), and will be running by the time the site goes live tomorrow and this post becomes visible. Fuckups like this are part of the risk involved in running a bespoke blogging system instead of one of the off-shelf ones like wordpress or movable type. I keep trying to defend against mistakes as they happen, and this is the first time one's happened twice.
Keep the Faith. I'll write something a bit more upbeat later, once I have the site moved over and the backup script running.
I'm importing content into the database for the new version of this site, ready to send it live at some point over the Christmas/New Year period. I've been doing it for most of the day, on and off, as there's over 500 entries and 200 comments to import (would be a lot more if I hadn't fat-fingered a lot of them out of existence a few months back). I've finally managed to get all the entries copied across. And now I've added another, so I have to turn the handle one more time.
It wouldn't be quite so bad if it was automatable. The trouble is, the data structure backing the site has evolved a lot since the last one was built, and a lot of the metadata that's necessary to an entry these days can't be extrapolated from the data that's present in the old DB. Thus, I've spent most of the day dragging up old memories, correcting spellings and setting tags, and stacks, and timestamps, and, and...
I've come away from the experience a little down, because the overall tone of the entries I've imported was kinda dark. I mean, sure there's up and there's downs, but for the most part this is a pretty depressive blog (which is, at least, appropriate given the name). I don't want to be depressed, and tired all the time, and barely able to cope with going out of the house some days. That I can't seem to be otherwise is somewhere between annoying and concerning.
New Year, new perspectives? New promises made to myself, and some, with luck, kept. I guess we'll see.
For the interested, I think I've fixed the timestamp drift that's been getting really silly on GHE lately. If anyone notices it sliding out of touch with reality again, please let me know: the fix is scripted, so should be self-maintaining, but I don't trust two-AM scripts implicitly.
So, I'm on jury service this week. The case is dragging on, and on: we might be finished by the middle of next week, if we're lucky. But that's basically all I can tell you about it till it's done, and it isn't very interesting. So, other things...
I seem to be managing to fill the day, despite getting up earlier and going to bed earlier than usual. I may have to see if this schedule fits in with my normal work (0900-1700, as opposed to my normal 1000-1800 + whatever is necessary), as it's quite relaxing. Even if it is weird to see the sun still up at 9PM.
Outside the courthouse, I'm managing to get a few things done. I've built a couple of papercraft kits to get some practice for a rather complex set of papercraft I want to try building for use as terrain in a possible Necromunda campaign. I'm fiddling with an AVR development kit again, with a view to actually doing something non-pointless with it (although I've yet to figure out what), and started working on the next grand re-write of glasshalfempty.
Yes, I'm revamping the codebase behind these pages again, and hopefully for the last time, since the new design is extremely modular and flexible (not to mention object-oriented). Hopefully I should just be able to plug in new features, instead of having to rewrite huge swathes of code again. So GHE will become simpler for a time, as I make the changes, then hopefully a lot nicer (in the back end, at least: I don't promise that it'll look any better, per se).
I have just learned the hard way that it is not possible to have a foreign key in SQL indexing into more than one table. My housemate Craig finds this hilarious.
I was trying to arrange things so that comments could be parented either to entries, or to other comments (allowing me to build a comment tree for a given post). I still fully intend to do this, I just can't do it as elegantly (or, in Craig's terms, hackily) as I was going to originally.
I haven't really touched SQL in far too long, and it shows.