Notes on migrating from Blosxom to WordPress, Fedora edition

I’ve used blosxom for a few years to manage my blog, and while I appreciate its simplicity and “Unix nature”, it’s not actually very usable. It’s difficult to extend; the code is impenetrable; and it’s been orphaned by its author, who has gone on to better things. For example, as I couldn’t find a simple automated way to deal with the tide of comment spam I was receiving, I ended up disabling comments entirely. Since I’d still like to be able to blog, and would prefer to host the service myself, the only realistic-looking choice to migrate to was WordPress. I’m feeling nervous about the move, as WordPress is written in PHP, and PHP has a deserved notoriety for security problems. Indeed, WordPress and its plugins have a history of security problems. But the alternatives all appear less usable and less widely supported. After taking a deep breath, I started the migration process yesterday. A nice benefit of running Fedora on my new server is that I was able to install a prebuilt package from Extras, named wordpress, and have the necessary dependencies (PHP and MySQL) installed automatically for me. A quick glance through the README.fedora file that ships with the wordpress package, and a few configuration tweaks, and I was ready to get started. The first thing that I wanted to do was import my old blog postings from blosxom. After trying other approaches for an hour or so, I wrote a small Python script to generate an RSS 2.0 feed directly from the text files that blosxom reads. This let me handle the obscure markup format I’d been using with blosxom. At this point, I hit the first serious snag. No way could I get WordPress to successfully import my carefully crafted RSS 2.0 feed, no matter how I tried. I ended up reading the WordPress source, and found a bug in the code that tries to print an informative error message when WordPress fails to import a file successfully. It tries to print the value of the wrong variable, which is undefined, and so (PHP trying to be helpful) prints an empty string:
The uploaded file could not be moved to .
Thanks for playing, PHP! Come back when you’re a real programming language! Once I had corrected the error-message-printing bug in WordPress, I at least had an idea of the file it was trying to write to. This led me to conclude that I was being bitten by every Fedora user’s pet hate, SELinux. In its default configuration, it will not allow PHP to write to any files outside of /tmp, but WordPress wanted to write to /usr/share/wordpress. Rather than try to fix the SELinux policies, I disabled SELinux entirely. Once I made /usr/share/wordpress/wp-content/uploads writable by the apache user, my upload problems disappeared, and I was able to import my old postings.
Posted in Uncategorized

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>