Switching from GandiBlog/Dotclear2 to WordPress4

This blog was hosted by GandiBlog since mid-2006. Thanks to the Gandi folks, it has served me well, though it was starting to show its age.

Now I intend to revive this blog, and the first step was to finally move it on my server, switching to WordPress in the process! The rest of this post will detail how I did the switch, keeping the blog content and links.

GandiBlog to self-hosted Dotclear2

GandiBlog’s only export possibility is via a flat text file export (Extensions->Import/Export). An old WordPress plugin exists to import such files, and will likely be the solution you will first find in your favourite search engine. But its last update was some years ago and it does not seem to work with current versions. Instead, I chose to set up a temporary DotClear2 installation on my server, to use the current import plugin in WordPress later.

Installing DotClear is as easy as creating a mysql user/db, unpack the latest 2.x tarball, and follow the installation wizard. No need to tweak configuration our users here, I just logged in the administration panel, imported from the GandiBlog flat file, and I was (mostly) done!

I say mostly, because I fixed 2 things before the WordPress jump. You may not need to do the same, but here they are:

  • Some blog posts were in wiki style and not in xhtml, and were not converted correctly. As there were only a few of them, I used the”Convert to XML” button available when editing a post. I think tools exist for a mass conversion
  • Some other posts were in the “Uncategorized” category, and were ignored in the import process. My manual workaround was to set them to a “Other” category I created for the occasion. Again, this can be automated

Dotclear2 to WordPress4

The next step was to set up a new vhost on my server, emerge latest wordpress and install it in this new vhost (no special steps here) .

Once WordPress was basically up and running, I installed the “DotClear2 Importer” plugin, and ran it (it is an additional entry in Tools/Import). Basically it summed up to filling the (dotclear) database connection infos, and hit next button a few times.

Some additional steps to clean the new blog posts:

  • configure the permalink settings to use “Month and name”. This along with the “Permalink Finder” plugin, allowed me to preserve old links to the blog posts (the plugin deduces the new post URL and redirects to it)
  • delete the user created by the import, moving all posts to the new user in WordPress (this is a single-user blog)
  • move back the “Other” category posts to “Uncategorized”
  • temporarily install “Broken Link Checker” plugin to fix some old/dead links. Some comments had an additional “http://” prefix in URLs, and I fixed them along with updating other real links
  • remove temporary parts (dotclear install and database, cleanup/import plugins, …)
  • And when everything looked good, I could update my DNS entries to the blog 🙂