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.
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.
- 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
- Is this a SQL insert for a new blog post?
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:
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.
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.
Look under Tools -> Export for the default export tool but of course there are plugins if you need something specific.
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.
Oh dang, this would be nice for Jaedia’s Menagerie and Once Upon a Time!
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)
To be brutally honest, now that I can read WK again, it’s not really worth saving. I don’t remember doing most of the “game log” kind of things I write about, and I’m not as funny as I thought it was. Maybe the past was best left buried.
But now that I’m on this train, I kinda feel I should see where I end up.
So here’s a thing that exists: https://web.archive.org/web/20110131174108/http://funingames.net/2011/01/rift-an-impression-of-impressions-on-an-impression-plus-an-actual-impression-of-the-game/
Where I unironically called your response out on WK to the Rift/Jef Reahard/Massively debacle ‘over the top’ while, also, myself, being over the top.
It is amazing (and a little mortifying) how much The Internet Way Back Machine has archived of this particular thread, and how many familiar names there are associated to it. Can link back through to your post, and from there to one from Pete on Dragonchasers and several others too.
Nutty.
In any case. What was I saying? Oh yeah- definitely keen to see where you end up. xD
And here is that over the top post — resurrected: https://github.com/tipa16384/westkarana/blob/somethingelse/posts/2011/January/6043.md
I loved reading about Darkfall. And Age of Conan. People were desperately believing that a PvP MMO experience would ever be sustainable.
Hah, complete with image! 😀
Yes- I was one of those people hoping desperately for Darkfall to be a success. Looked after the WarCry DF site for a while and everything. *sigh*
Ah well.
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.
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.
I hadn’t heard of Netlify! I’m going to give it a look — thanks!