Migrated to WordPress

As you can see, and as previously predicted, I’ve now migrated my Drupal (5.1) based blog, to WordPress (2.2.2).

The changeover was fairly easy to do, thanks largely to this post: Migrating Drupal to Wordpress. Since that post is almost two years old, the sql needed some tweaking to work with the 5.x series of Drupal. If you need the tweak’s I’ve made them available here: convert-drupal-wp.txt

In the process of converting over, I noticed a large number of sp4m comments - so I decided to purge all comments. Also keep in mind that user accounts were not copied across either. There shouldn’t be anymore sp4m comments now, due to the trustly WP plugin: Akismet which is like a blacklist for comments.

From a blogger perspective, WP is pretty damn neat! It’s really polished with its ajax, and overall design.

15 Comments so far

  1. Michelle on August 26th, 2007

    Hello,

    Your script worked great, but I can’t seem to get the Users to import. Any help would be much appreciated, it’s the last piece that I need of the conversion.

    When I use

    INSERT INTO wp_users
    (ID, user_login, user_pass, user_nickname, user_email, user_registered)
    SELECT
    uid, name, pass, name, mail, FROM_UNIXTIME(timestamp)
    FROM users;
    */

    I get this error –

    Error
    SQL query:
    INSERT INTO wp_users(
    ID,
    user_login,
    user_pass,
    user_nickname,
    user_email,
    user_registered
    )
    SELECT uid, name, pass, name, mail, FROM_UNIXTIME( timestamp )
    FROM users;
    MySQL said:
    #1054 - Unknown column ‘timestamp’ in ‘field list’

  2. optik on August 27th, 2007

    Hi Michelle,

    I didn’t bother migrating my users across when I did it, but a quick look at the old drupal database, reveals the column name for creating date is “created”.

    So:

    INSERT INTO wp_users(
    ID,
    user_login,
    user_pass,
    user_nickname,
    user_email,
    user_registered
    )
    SELECT uid, name, pass, name, mail, FROM_UNIXTIME( `created` )
    FROM users;

  3. [...] also managed to migrate most of the content (posts and comments) from Drupal to WordPress. Alex’s post and script saved me lot of time. The script is not up-to-date and required some tweaks. I could not manage to [...]

  4. Kjell H A on December 27th, 2007

    Thanks, this worked like a charm. I had to find the older version of WP since they obviously changed their database scheme recently. I haven’t made the change complete yet, but this was a great help getting there.

  5. Jeff on May 15th, 2008

    I know that this is an old post, but I am wondering if you have tried this with wordpress 2.5?

    If so please let me know how that went.

    Thanks

  6. optik on May 15th, 2008

    Hey Jeff,

    Nope, haven’t tried it out, but if you analyse the new structure of wp 2.5 database tables, you can see if anythings changed and if so adjust where needed.

  7. [...] use an old version for the conversion and upgrade from there. So I went right to the version that this guy used, [...]

  8. Jeffro2pt0 on July 12th, 2008

    How much would you need to be paid to create a migration script from drupal 5.3 to WordPress 2.5.1 or 2.6? No one on the net seems to have migrated drupal to anything past wordpress 2.2

  9. optik on July 12th, 2008

    Hi Jeff,

    Because theres so many different versions of Drupal and Wordpress, it can be a big job creating and then maintaining a conversion script for all of these versions.

    It’s easier just to do the migration manually through mysql.

    I can provide this service to you if you like, just drop me an email, and we’ll discuss.

    Thanks

    - Alex

  10. Jeffro2pt0 on July 13th, 2008

    Ok optik, We will need to speak about this issue because we need to talk with someone who can explain what is possible and what is not possible in terms of migration. We pretty much know what we want and are willing to sacrifice things just to get the content into WordPress.

    I can not find your email address nor is their a contact form. Is there any way you can get in touch with me or vice versa?

  11. optik on July 13th, 2008

    Drop me an email on: alex@akb.com.au :)

  12. Jeffro2pt0 on July 14th, 2008

    Email sent. Looking forward to your reply.

  13. steve on September 14th, 2008

    Playing around with this, I noticed some tweaks to convert the posts are necessary with 2.6. This worked for me, albeit all of my drupal posts are in one catergory, and I only want one catergory in my WP installation.

    INSERT INTO wp_posts(
    ID, post_author, post_date, post_date_gmt, post_content, post_title, post_excerpt,
    post_name, post_modified, to_ping, pinged, post_content_filtered
    )
    SELECT a.nid, 1, FROM_UNIXTIME(a.created), FROM_UNIXTIME(a.created), b.body, a.title, b.teaser, concat(’OLD’,a.nid), FROM_UNIXTIME(a.changed), ‘(Excluded)’, ‘(Excluded)’, ”
    FROM node as a, node_revisions as b
    WHERE a.nid = b.nid AND (a.type=’blog’ OR a.type=’page’ OR a.type=’story’ OR a.type=’forum’);

  14. AlbertC on November 4th, 2008

    Hi, I’m also interested in the migration to WP 2.6, including the user database and comments. Any progress on that? Thanks.

  15. Hippy Randall on April 23rd, 2009

    is there an updated version of this? I am running Drupal 6 and want to migrate over to the latest WP. tired of drupal breaking or chewing up the allotted memory on my server.

Leave a reply