« Bye bye, WordPress | Main | The future of software research is XXX »
June 23, 2005
From WordPress to MovableType - part 1
When switching from one weblog software to another, notably from WordPress to MovableType, problems are inevitable. Besides the technical problems of exporting and importing content, which I've covered yesterday, there are at least two more problems: static URLs and RSS content.
Static URLs are links to posts from the old weblog. Because WordPress is no longer there, attempts to access pages such as this will result in a missing page error. There are way to fix this, but more about it later.
The other problem, which I will describe here is the RSS content. In the old WordPress config, XML was dynamically created by a script called "wp-rss2.php". Note the ".php" extension, meaning that was a PHP script which produced the XML content on the fly. MovableType, on the other hand, produces a static "index.rdf".
One of the most annoying things, when subscribing to the RSS feed of a weblog, is to suddenly stop working. Whatever the reason, be it an upgrade, software glitch or simply change of location, this is bothersome. So what to do in order to maintain RSS compatibility with all the subscriber base of the old weblog?
One simple solution, which I've quickly hacked for my case, is a PHP script which takes the MovableType "index.rdf" and serves it to the clients. Of course, the name of the script is the same as the WordPress RSS 2.0 genereator: "wp-rss2.php". Here's how it looks like:
wp-rss2.php:
<?
$m=file("index.rdf");
header("Content-Type: application/xml");
foreach ($m as $mm) {
echo $mm;
}
?>
This way, whenever some(thing/body) tries to fetch the old "wp-rss2.php" to get an XML version of the weblog, they'll get the right content, without too much hassle. Except in the beginning, when a couple of duplicate entries will appear the in RSS client, the transition will be sweet and smooth.
Posted by Costin Raiu at June 23, 2005 2:06 PM