.. title: Migrating from Radiant CMS to... *anything* else
.. slug: migrating-from-radiant-cms-to-anything-else
.. date: 2015-06-12 11:46:13 UTC+01:00
.. tags:
.. category: software radiant rails db hack web
.. link:
.. description:
.. type: text
I `mentioned recently `_ about the painful transition of this
website from the Ruby/Rails `Radiant `_ content
management server to... well, anything that would actually work. Given its
popularity, I have to assume that Ruby and Rails *can* be made to work well --
or that 1000s of development teams are herd-following idiots, but that can't be
true, right? -- but my experience was a nightmare.
Mysterious `Rakefiles`, UI-disaster server commands, *awful* integration with
system packages, god-awful outdated Radiant documentation, and changes with
every release. In the end, an update of the base Ubuntu OS completely broke
Radiant. I tried using Ruby Gems in all the ways I could find, and updated every
package to the latest that Radiant thought it wanted but couldn't get it to run
again. I tried making a new Radiant site and migrating the database via the
advertised commands: it crashed. And in the end it seemed that Radiant's own
declaration of package dependencies was inconsistent. This was just the final
straw after several years of expecting a Rails epiphany, and dreading every time
that I'd have to restart the server and somehow get the creaking mess up and
running again.
Well, enough was enough. I'venow moved to using the `Nikola
`_ static site generator instead and couldn't be happier:
it's got a great command-line UI, it's totally clear what's going on, I can hack
and extend it if I want to, and my data is forever in a human-readable, editable
(even when offline!) format.
Radiant's page data is categorically *not* available in a human-readable format,
so a significant part of the effort to get this site back to life was the need
to write a script to access its article database, and dump out the pages in a
form I could use. Fortunately the db is just an `sqlite` single-file database,
and the table structure was pretty simple, so the dump script was easy. Here it
is for posterity:
.. listing:: radiant2txt python
To get a bunch of pages out in the format I wanted (my site was using Markdown
syntax, so the script writes out to a bunch of `.md` files), I ran this like:
.. code-block:: sh
./radiant2txt myradiantsite/db/radiant_live.sqlite.db -o out-nikola
A bit of manual hacking followed, but 95% of the job was done by the script
above. Use if you like, but don't ask me for support; if you need something a
bit different, hack it!