Resurrecting West Karana

I was fascinated by UltrViolet’s DevOps-ification of his blog, “Endgame Viable“. The sort of stuff he’s doing is the sort of stuff I do every day at work. I’m getting paid to get better at doing all of this stuff, but my own blog can’t take advantage?

That ends today. Today, I bring my old blog, West Karana, back to life, via the magic of DevOps.

One of my old banners 🙂

DevOps is just a fancy way of bringing every IT position into one person — the developer.

  • We don’t need an architect for our code, the developer can do it (lol)
  • We don’t need a QA person for our code, the developer can do it (Cypress and Karate)
  • We don’t need a DBA to manage our databases, the developer can do it (Liquibase)

Jack of all trades, master of none. I present to you the DevOps developer.

Anyway. UltrViolet made a whole new workflow where he creates documents in a text editor marked up in Markdown format, and then has scripts crawl through stuff and do magic and out spits a blog. It’s all very magical.

I’m not nearly up to that point. But, I’m sitting on years worth of SQL code that could, in theory, move my old blog, West Karana, to a new place, potentially even this blog. But there’s conflicts with newer versions of WordPress, categories, tags, all sorts of cruft. If I could just bring both blogs into Python, then I could fix all the inconsistencies and then spit out a new back end that contains both blogs.

First, though, I’d have to start writing code to turn the old SQL backup into something I could work with.

Python fragment to save a blog post as Markdown
  • Open the backup SQL file
  • For each line
    • Is this a SQL insert for a new blog post?
      • Use my SQLConsumer action to parse the line into a dictionary of column name: data pairs
      • Create a new “Post” object with that data
      • call the “Post” object to write itself to a file in Markdown format
    • Is this a SQL insert for a new comment?
      • Worry about this later

So, as a proof of concept, all the text of all the posts (sans images, comments, and meta information) is now backed up, in Markdown format, in GitHub.

Here’s a sample post from the past:

Blast from the Past

The link above goes into the actual repo, where, with a little poking around, you can find some of my very dirty, banging together at midnight, code that does the deed.

I don’t remember any of this stuff — especially the DDO stuff. I don’t remember Kasul ever playing DDO with me — and I bet if I asked him, he wouldn’t, either. But here it is, in black and white.

Next steps are to get the images loaded. I can put them into GitHub as well, or I could copy them into an AWS S3 bucket and then talk to them from there. It would be fun to put them in AWS, but then I might have to pay actual money.

But, for those who’ve been, for some reason, wanting to look at the old stuff, it’s all there, and will only be becoming more “there” as time goes on.

16 thoughts on “Resurrecting West Karana”

  1. That’s an interesting approach.

    If I had done this, I would’ve spun up a Docker container, installed wordpress, imported the the database (assuming West Karana was on WordPress) and then exported the posts as XML and done with them what I wished.

    Or even lazier, used a plugin to export them from that local copy and then imported them into Chasing Dings.

    But then, I don’t know Python because, I dunno, apparently it is super useful and cool and I stick to using shoddy tools out of stubborness. 🙂

    • I did consider using an AWS RDS instance to just get all the stuff in a database. I didn’t know you could export your blog via XML in WordPress. That would make things SO MUCH EASIER.

      I mean, Python IS super useful 🙂 Your way is probably a faster means to get where I want to go, though. I’ll have to look into it.

      Thanks!

      • My end goal is to have both blogs together in a JSON document that I can toss into a NOSQL database. I don’t know the structure of the XML export, so I’ll have to see how close that is to what I want.

        • Thanks! The XML does look like what I’m looking for, except for wanting it to be JSON so I could use that as the input to an Angular app.

  2. This is great. 🙂

    My *ahem* ‘process’ for this sort of thing so far has been to:
    1) Start a blog
    2) Not back it up
    3) Let the hosting lapse
    4) Be sad

    This sounds *way* better.

    (Although side note: I have actually been backing TTL up this time around, using UpDraft to keep last 5 fortnightly back-ups on a Google Drive)

  3. I used to enjoy it, it was one of the first blogs I put on my roll back in the day. I would be willing to bet that it will get more traffic than you would think once it’s back up and google searches can find it.

    • Yeah, I am working through the SEO aspects, or will be soon. It’s been a fun journey, even if it gets no traffic.

  4. Nothing wrong with Github pages, but most people I know seem to be using Netlify for this, maybe worth a look. Can’t really comment on quality or availability, my test thingy is just 5 html pages I push there daily and it works, on the free plan.

Comments are closed.