Well it's finally done, I've moved my blog to ikiwiki.
I was able to complete the CSS last weekend in order to mimick as best I can the theme that I had on Drupal. Then was able to import all the contents.
Unfortunately I lost the article post times since I didn't know how to tell ikiwiki when each post was published, but it's not too big a problem, especially since I didn't have that many articles.
The comments went a little more smoothly. For fun, here's the bash command I used to extract all comments from Drupal's DB and dump them as comment files for ikiwiki.
echo "select n.title, concat('| [[!comment format=mdwn|| username=\"', c.name, '\"|| ip=\"', c.hostname, '\"|| subject=\"', c.subject, '\"|| date=\"', FROM_UNIXTIME(c.created), '\"|| content=\"\"\"||', b.comment_body_value, '||\"\"\"]]') from node n, comment c, field_data_comment_body b where n.nid=c.nid and c.cid=b.entity_id;" | drush sqlc | tail -n +2 | while read line; do if [ -z "$i" ]; then i=0; fi; title=$(echo "$line" | sed -e 's/[ ]\+|.*//' -e 's/ /_/g' -e 's/[:(),?/+]//g'); body=$(echo "$line" | sed 's/[^|]*| //'); mkdir -p ~/comments/$title; echo -e "$body" > ~/comments/$title/comment_$i._comment; i=$((i+1)); done
That was really far from perfect, though: I settled for placing a double
vertical bar for a newline placemark because piping from drush sqlc
to the
while
loop was truncating the backslashes in the \n
symbols. I then had to
edit every file and replace the markers by new lines, and then verify all
comment contents to find the n letters that were out of place to replace them
with new lines, too.
Here are the main reasons why I decided to move away from Drupal:
- No more regular security upgrades needed: this web site is all static files (except for the cgi)
- Site will be a lot easier on the server. Drupal is a big chunk of php code and takes lots of resources.
- It's now possible for me to write a post while offline, commit it and push it as soon as I have connectivity. This gives me the possibility to just assemble notes while in a conference or other events, and then complement during free time and post right away. I might not be shying away from writing a bunch of quick articles anymore.
- I expect comment spam to be reduced. I'll see in the near future whether that is true or not.
Please note that the URLs to the RSS feeds and to the posts have changed. There's now also an atom feed. I haven't setup a redirection map from the old posts to the new URLs, but I'll try to do that in the next few days.
It's now also possible to follow the "Recent comments" via the RSS/Atom feed so that you can see when replies are sent.
I keep thinking I should find a new CMS that renders to flat HTML. It would need a GUI backend for entering content before clients would use it, though. And you could render PHP or some other end-user language for handling comments, a search engine, etc. Anyways, one day I'll research the options.
PS: I know you probably won't need to do this again, but using Views you can export arbitrary data from Drupal as CSV, XML, or other formats more easily than writing your own SQL: https://drupal.org/project/views_data_export
ah! I can finally see when I recieve a comment! what an upgrade
that's nice to know about views, I'll try to remember that.
ikiwiki has a web interface for creating new posts, but it's rather primitive.. maybe there's a plugin to add a wysiwyg on the forms but I didn't really search for that since I don't really want one here.
so far my experience with
views_data_export
has been less than satisfactory. i would need to create multiple views for comments, tags, nodes, etc, and fiddle with the Web UI until it does what i want.considering i know the MySQL schema behind all this stuff, it seems simpler to me to tap directly in the database in the back. it certainly feels better than parsing ill-formatted XML spewed by Views 2.x in D6... whee...
i'm documenting my migration work here: http://anarc.at/services/wiki/drupal/
so far my experience with
views_data_export
has been less than satisfactory. i would need to create multiple views for comments, tags, nodes, etc, and fiddle with the Web UI until it does what i want.considering i know the MySQL schema behind all this stuff, it seems simpler to me to tap directly in the database in the back. it certainly feels better than parsing ill-formatted XML spewed by Views 2.x in D6... whee...
i'm documenting my migration work here: http://anarc.at/services/wiki/drupal/
@Anarcat : oh hey just a quick note after reading your blog post: don't forget to grab all files and to drop them in the appropriate directories (I currently have the habbit of just dropping attachments in dirs named the same as articles, but I guess one could go at this differently)
Also for the article contents, well since I really had very few articles on Drupal, instead of scripting it I just copied contents manually into a bunch of different .md files. What really helped me was that I was already using Markdown in Drupal, so the only changes to the contents that were necessary were for links pointing to images and for embedded videos.
Good luck on the migration! The efforts are really worth it
p.s.: on and wrt that last line in my post: I do indeed receive NO comment spam since I migrated over to ikiwiki. I guess needing to "login" with the cgi script is deterring those pesky pollution generators. (that or the fact that there aren't that many ikiwiki sites out there...)