Wordpress -> Drupal

This is my script for migrating from Wordpress to Drupal. I know that there is already a migration script out there, but I still wrote my own for a few reasons:

  • My needs are simple, and I knew what I wanted.
  • I wanted to migrate comments and pingbacks if possible. This turned out to be easy.
  • I wanted to learn more about coding for Drupal.
  • I’d already started writing it when I saw Borek’s migrator.
  • I wanted to migrate straight to Drupal 5, not 4 first.

So here it is.

Limitations and bugs:

  • Attached files are copied by requesting them off the old server. But thumbnails aren’t migrated too.
  • Pages aren’t migrated. But I’m sure this would be a piece of cake to fix
  • I put dumped my wordpress tables into my drupal database (They are all prefixed with wp-). This is messy, but while Drupal’s multi-database system is a cool and would be perfect, it’s unworkable when you are debugging. Errors seem to be hooked in drupal, and if you have a broken SQL query (for example) the error handling code hooks Drupal themes, which aren’t findable in the alternate-db world you are visiting.
  • All blog posts are migrated to a single user on the other side.
  • I’m pretty sure that I didn’t solve the character encoding issues, just sidestepped them…
  • I didn’t look into Drupal 6 compatibility.
wordpress-import.php.txt8.51 KB


Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

RE: Wordpress -> Drupal

Hi Stefano,

Well done on the migration to Drupal! I also found that script that you talk about, and then googled some more, and found that someone had ported it to 5.x.

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.
By submitting this form, you accept the Mollom privacy policy.