All posts tagged sql

U+1F92A

Martin · 2 years

A while ago I tried making a post here with an emoji in it, because WordPress supports that now, and the characters always came up blank after I submitted the form.

Investigating why this was happening sent me down a WordPress rabbit hole. The cause I arrived at is that, because my WordPress install has some long roots, the underlying database didn't support the character set required by emojis. The solution was to update the database, which isn't something WordPress can do by itself.

Being a DIY guy (when it comes to tech, anyway) I read a little more about what was involved, backed everything up, and dove headfirst into the database. Not long after, I resurfaced from my edits, made a post with an emoji, and basked in its glory. I checked a few other posts to make sure the rest of my database was still intact, and satisfied with the results, left things at that.

You can guess where this is going: unseen problems were afoot. Technically, they still are, I suppose.

Not long after the update, I noticed that one of my main pages was almost entirely blank. WordPress couldn't recover it, so I loaded up my backup and dug through the SQL code to find the post and restore it. It took some time to sort everything out (this particular page had a lot of formatting), but it was fixed.

Curious, I started looking through other posts/pages. Most were okay, but the further back into my blog's history, the more missing pages I encountered. Many of these posts contained characters that didn't survive the database edits, and they got cut off at random points.

So now I'm aware of this problem, and I've been slowly combing through the dusty, cobwebbed corners of the site, cleaning things up and restoring lost posts when necessary. Most of it isn't really worth preserving, honestly. But I feel bad leaving it in such a rough state - and I've been mildly enjoying following my own path as I read things I wrote 15 years ago.

Good grief, I'm feeling old! 👴

743 92 0