Moving from Drupal to WordPress

This website began as a blog. And probably a badly made one as well. Hey, it was 2008, and I was trying to get my head around Drupal 6! Since then, I’ve moved half-way across the world, become a better Drupal and WordPress developer, and generally got into the habit of blogging a lot more.

Which is why it was time to move away from blogging on Drupal. After some consideration, I decided to migrate from Drupal to WordPress.

Why the Move?

Drupal is great for many things. Blogging isn’t one of them. I got sick of the extra time it took to upload images (WSYWIG and IMCE, sigh) and the horrible options for formatting in general. Ever since I’d been using WordPress as part of Johnny Holland, I’d been jealous. The final straw was setting up another domain on WP and live-blogging an event on it as the thought of doing it in Drupal terrified me.

Why WordPress?

There are a lot of options out there these days for writing. A lot of devs like file based systems such as Jekyll and Octopress. However, for me, the importance was ease of writing and adding media. WordPress is obviously streets ahead in this respect. While I’m really getting into Markdown, I can do without it for now as a payoff for easy media integration.

Migrating from Drupal to WordPress

A few points on the setup. I’m on Drupal 7 and migrating to WordPress 3.6.

Content

Not surprisingly, there’s a lot of ways to move content from WordPress to Drupal, but not much the other way around. After getting freaked out reading a number of posts which involved editing databases, I realised the easiest option was just to suck in the content on RSS.

I created a RSS file using the Feed view on Drupal. I then used the Multi-importer to link this to a post.

Note: in hindsight, I’d try to download the file, run bulk changes on image locations etc, and then upload it using the importer.

Images 

Images involved a bit of cleaning up on the Drupal server, as imagecache created multiple versions. To play it safe, I copied all the original size files into one folder which I then moved into WordPress. I then used the Add from Server plugin to make them all be picked up in the Media Library.

But there’s a problem! Of course, the old images have the wrong links. I went into PHPMyAdmin and search replaced all old links.

SEO

As this was a slow transition, I moved the blog site from a folder to a subdomain. Once the site was working I used .htaccess redirects to match all old urls with the new ones (the mapping is pretty close anyhow).

Comments

I’d got annoyed with spam a while back on the Drupal blog so had already moved my comments to Disqus. Luckily, there are fairly easy ways to migrate the content over. Once I installed the Disqus plugin, it was a matter of choosing the best means to migrate. As my top level mapping system had changed slightly (from http://vickyteinaki.com/blog to http://blog.vickyteinaki.com), I could use auto-mapping, but as I’d attempted to map all old URLs to new ones, I could use the option of letting Disqus sniff out the 301 redirects.

Gotchas

URL mapping

I assumed that my simple naming system would mean that the URLs would easily map. I didn’t account for one thing. Drupal’s auto-naming URL system strips out a number of small words (‘the’, ‘of’), which WordPress leaves in. This unfortunately meant that I had to go through all of the posts and check for changes. I suspect that for a large amount of posts you would just have to do bulk changes or accept a drop in SEO.

Cleaning up the WSYWIG cruft

The only real disadvantage of pulling from RSS is that you get all the formatting that comes with it. For me that was the original Disqus scripts, and numerous divs from the original feed (though this probably could have been avoided if I checked my Drupal templates).

Linking it all Back

My original all-in-Drupal site included the latest blog posts on the home page as a View. How to do that now? Again, RSS. The Drupal 7 core Aggregator module includes a block for showing feeds (though I had to add a template extra, and suspect I’ll need to make a new view so as not to end up with content duplication/SEO issues).

Coding , , ,

If you enjoyed this post, subscribe to updates.
Email once a month. Unsubscribe at any time with a single click.

One Pingback/Trackback

  • Marco Kravchik

    Hello,
    thanks for posting!
    In addition to your instructions, I’d like to suggest cms2cms converter. It includes the migration of content, some modules, seo URLs and 301 redirect that is set up automatedly and the migration custom fields. It’s possible to try demo ,to check whether cms2cms suits fro your website migration.

    Hope it helps smbody!

  • Pingback: Migrating Drupal to WordPress… | loginesta

  • http://anothercoffee.net anothercoffee

    Using RSS is a clever way of going about it. I didn’t think of that! It seems like a good option for people who don’t want to mess with the database.

    When I started doing migrations, I found a bunch of sites going through the SQL queries needed to run the conversion. It seemed like a lot of trouble to go through the queries each time so I built a web front end around them. You can find it here:
    http://anothercoffee.net/the-drupal-to-wordpress-migration-tool/

    You install it on your server and it will run the queries for you, similar to David Coveney’s WordPress Search and Replace Tool.

    For anyone inclined to go through the database route, I also wrote a step-by-step explanation of what happens:
    http://anothercoffee.net/drupal-to-wordpress-migration-explained/

    Hopefully this will help your readers who want to migrate the database but need a starting point.