• Skip to primary navigation
  • Skip to main content
  • Skip to footer
  • Store
  • Support
  • Theme Documentation
  • My Account
  • Cart

9seeds

Building Custom WordPress Solutions | Plugin Development

 
  • Custom Development
  • Themes
  • Plugins
  • About
  • Contact
  • Blog

News

Drupal to WordPress migration

Posted on October 2, 2010

Updated: 8/19/2013 – 9seeds does not offer Drupal to WordPress conversion as a stand-alone service. If you need to convert from one CMS to another, we suggest you check out https://9seeds.com/cms2cms

A client came to us this week with a problem; he had a Drupal site with over 1000 articles that he wanted to convert to WordPress. So we headed to Google for some help. There are several tutorials out there on how to migrate Drupal content to a WordPress site, but many of them are really outdated. After kicking the tires on a few, this post by Mike Smullin seemed to be the best jumping off point.

Mike is right up front in his instructions with the fact that you’ll need to do a bit of tweaking to his set of instructions to get it to work for your setup. After a few failed attempts, we came up with an updated set of instructions. We’ve included the updated version along with notes about changes made.

These instructions are a set of SQL statements. It assumes you have a database named WordPress using ‘wp_’ as the prefix and another database named Drupal.

This should go without saying, but I’ll say it anyway; do not move forward without backing up your databases FIRST!

Clear all existing WordPress content

TRUNCATE TABLE wordpress.wp_comments;
TRUNCATE TABLE wordpress.wp_links;
TRUNCATE TABLE wordpress.wp_postmeta;
TRUNCATE TABLE wordpress.wp_posts;
TRUNCATE TABLE wordpress.wp_term_relationships;
TRUNCATE TABLE wordpress.wp_term_taxonomy;
TRUNCATE TABLE wordpress.wp_terms;

Create Categories

INSERT INTO wordpress.wp_terms (term_id, `name`, slug, term_group)
SELECT
 d.tid, d.name, REPLACE(LOWER(d.name), ' ', '_'), 0
FROM drupal.term_data d
INNER JOIN drupal.term_hierarchy h
 USING(tid);

Add Taxonomies

INSERT INTO wordpress.wp_term_taxonomy (term_id, taxonomy, description, parent)
SELECT
 d.tid `term_id`,
 'category' `taxonomy`,
 d.description `description`,
 h.parent `parent`
FROM drupal.term_data d
INNER JOIN drupal.term_hierarchy h
 USING(tid);

Import posts/pages
We added ‘article’ to the array on the last line to solve an issue with the way Drupal had categorized the posts.

INSERT INTO wordpress.wp_posts (id, post_date, post_content, post_title, post_excerpt, post_name, post_modified, post_type, `post_status`)
SELECT DISTINCT
 n.nid `id`,
 FROM_UNIXTIME(n.created) `post_date`,
 r.body `post_content`,
 n.title `post_title`,
 r.teaser `post_excerpt`,
 IF(SUBSTR(a.dst, 11, 1) = '/', SUBSTR(a.dst, 12), a.dst) `post_name`,
 FROM_UNIXTIME(n.changed) `post_modified`,
 n.type `post_type`,
 IF(n.status = 1, 'publish', 'private') `post_status`
FROM drupal.node n
INNER JOIN drupal.node_revisions r
 USING(vid)
LEFT OUTER JOIN drupal.url_alias a
 ON a.src = CONCAT('node/', n.nid)
WHERE n.type IN ('post', 'page', 'article');

Turn articles in to posts
This will turn the ‘articles’ from the previous step in to ‘posts’ in WordPress.

update wordpress.wp_posts set post_type='post' where post_type='article';

Add post to category relationships

INSERT INTO wordpress.wp_term_relationships (object_id, term_taxonomy_id)
SELECT nid, tid FROM drupal.term_node;

Update category count

UPDATE wordpress.wp_term_taxonomy tt
SET `count` = (
 SELECT COUNT(tr.object_id)
 FROM wordpress.wp_term_relationships tr
 WHERE tr.term_taxonomy_id = tt.term_taxonomy_id);

Import comments

INSERT INTO wordpress.wp_comments (comment_post_ID, comment_date, comment_content, comment_parent, comment_author, comment_author_email, comment_author_url, comment_approved)
SELECT nid, FROM_UNIXTIME(timestamp), comment, thread, name, mail, homepage, status FROM drupal.comments;

Update comment counts
After fighting with the original syntax, I added the ‘use wordpress’ step to get around it.

use wordpress;
UPDATE `wp_posts` SET `comment_count` = (SELECT COUNT(`comment_post_id`) FROM `wp_comments` WHERE `wp_posts`.`id` = `wp_comments`.`comment_post_id`);

Fix breaks in post content

UPDATE wordpress.wp_posts SET post_content = REPLACE(post_content, '', '');

Fix images in post content

UPDATE wordpress.wp_posts SET post_content = REPLACE(post_content, '"/files/', '"/wp-content/uploads/');

If your posts have any images you’ll need to move them from your ./files directory to the ./wp-content/uploads directory. The final step above should take care of fixing any image calls in your pages and posts, but you still may need to manually update them if you are having issues.

Download a copy/paste friendly version of the Drupal to WordPress instructions here.

if you have any questions, leave us a comment below.

Continue Reading

john

    More by john

    OMG, we’re a year old!

    Posted on October 1, 2010

    It’s hard to believe it was one year ago today that Todd, Shayne and I set out on this journey together. A year already? How is that even possible?

    I’ve been asked several times how 9seeds started. So for those who have wondered but never asked, here’s a quick history of how 9seeds came to be.

    Back in 2008 I had heard about a series of events going on around the country called WordCamp. I sent a message on twitter asking if anybody was planning one for Las Vegas. The responses I got back all said pretty much the same thing, “no, but you should organize one.” Having never organized an event of this size before, I did what any (in)sane person would do, I dove in head first!

    In early January of 2009, WordCamp took place in Las Vegas. It came together far better than it should have given my lack of experience. A lot of that had to do with the amazing lineup of speakers that weekend. One of which was Shayne Sanderson. Though we had never met in person and had only chatted online a few times to that point, we became good friends right away.

    During that time, Todd and I were working for a marketing company here in Las Vegas. The owners had sold a large portion to an investment company and though we had both been there for several years our interest in staying there was quickly fading.

    Over the next several months, Shayne and I spoke at a handful of WordCamp events. This lead to both of us receiving several requests for side projects. Shayne and I were working nights and weekends as we both found no end to the amount of people looking for help. We started collaborating on more and more projects. When we needed extra help, we would hit up Todd.

    We weren’t happy with our day jobs and there were a slew of people looking to pay us for help. It didn’t take a rocket scientist to realize where this was going. Within a few months, we decided to start a company together.

    While October 1st is our “official” anniversary, last year at this time we all still had full time jobs. But that got old pretty quickly. By the end of January, we had all quit our jobs and have been building 9seeds ever since.

    We are amazingly lucky to have made so many friends in the WordPress community. It has been an amazing first year and we can’t thank you enough for your friendship and support.

    From the bottom of our hearts, thanks!

    – John

    Continue Reading

    john

      More by john

      9seeds in Savannah

      Posted on August 3, 2010

      Well….guess what? Another WordCamp…surprise surprise!

      This time, I’ll be at WordCamp Savannah on August 21st and 22nd, and I’m excited to be there as I have never been to Georgia before.  I am a little worried about the humidity, but I’m sure I’ll survive.

      This is actually a 3 day event. Friday the 20th will be a Pre-WordCamp Workshop day where you can get your own domain and site setup and get familiarized with WordPress before the actual event. This is a great idea for those who want to start a site but aren’t just quite sure how. Lisa-Sabin Wilson will be heading up this workshop, so anyone attending will be in good hands.

      9seeds is sponsoring this event and I was asked to do a short version of my PHP/CSS for Beginners presentation as well as hang out at the Genius Bar on Sunday the 22nd. So I’ll do a quick version of how to understand and modify PHP and CSS for beginners and then answer the flood of questions that will probably come into the Genius Bar on Sunday. If you have WordPress questions and have not taken advantage of a Genius Bar at WordCamps you’re missing out…it’s a great resource to get questions answered. I’m sure it will be a great time and the list of speakers looks great, so if you don’t have a ticket yet you really should go get one!

      So, Savannah looks like a great city and I’m looking forward to seeing it and catching up with WordPress friends there. Hope to see you there!

      Continue Reading

      shayne

        More by shayne

        Affiliate plugin for WP-ecommerce

        Posted on July 25, 2010

        Since Shayne has spent so much time helping people out in the WP e-Commerce user’s forum, it’s no surprise that we receive a steady stream of requests for people looking to enhance their online store. One of the requests we get the most is from people who would like to pay affiliates to drive traffic to their site. With no real solution available, we did what any enthusiastic development team would do; we built it!

        Introducing the Affiliate Plugin for WP e-Commerce

        The Affiliate Plugin makes it simple to sign up and manage affiliates for your online store. You can easily set the payout amount (flat rate or % of sale) per affiliate, add custom banners and text links with unique tracking codes, view stats and more.

        We didn’t forget about your affiliates. They will have the ability to get their unique tracking links and see their traffic and earnings stats.

        Screenshots (click to enlarge)

        Display a list of your affiliates

        Easily create and edit your creatives.

        See which sales your affiliates drive.

        The Affiliate plugin is available now. Purchase your copy today.

        If you need assistance with the plugin or have a feature request, please let us know!

        Continue Reading

        john

          More by john

          Drop Thesis For Half Price

          Posted on July 15, 2010

          With the licensing controversy between WordPress and the Thesis theme, there are a lot of users having to rethink what theme they want to use for their WordPress site. Matt Mullenweg has made an open invitation to purchase a GPL compliant theme for anyone wanting to move away from Thesis. As part of the WordPress community we would like to do our part and offer to install and modify a new GPL compliant theme for half price*!

          What does this mean? It means….if you want rid of Thesis and want to give your site a whole new look, we’ll do the conversion for you for half price*!

          If you’re interested in keeping your site’s existing look and still want a conversion, then you can visit our friends at WebDevStudios where they have a sale for that running currently.

          So, let us know how we can help you get converted to a GPL compliant theme and we’ll happily do it for half price*.

          *Half price offer is good for conversions from Thesis themes only. GPL compliant theme must be provided and is not included in discounted rate. Prices may vary depending on complexity of site design. This offer ends Saturday, July 31st at midnight, Pacific time.
          Continue Reading

          shayne

            More by shayne
            • Prev
            • Page 1
            • Interim pages omitted …
            • Page 8
            • Page 9
            • Page 10
            • Page 11
            • Page 12
            • Page 13
            • Next

            Footer

            Get in Touch

            • New Project Inquiry
            • Product Support and General Inquiry
            • Store Purchase Terms and Conditions
            • Store FAQ
            • Cookie Policy
            • Privacy Policy

            Our Services

            • Custom WP Development
            • Theme Store
            • Plugin Store

            WordPress Plugins for Sale

            • Time Tracker
            • Authorize.net SIM Gateway

            WordPress Plugins for Free

            • Simple Calendar
            • WP Chargify
            • Facebook
            • Twitter
            • LinkedIn
            • WordPress
            • GitHub

            Copyright 2025 | 9seeds, LLC

            Like nearly all websites this one uses cookies too. Like most users we think consent banners like these are a dumb solution, but it's what we've got until new laws are passed. We use cookies on our website for remembering your preferences, for example if you're logged in or what is in your cart. We also use 3rd party cookies for analytics so we know what pages on the site are most popular. By clicking “Accept”, you consent to the use of ALL the cookies.
            Do not sell my personal information.
            Cookie SettingsAccept
            Manage consent

            Privacy Overview

            This website uses cookies to improve your experience while you navigate through the website. Out of these, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may affect your browsing experience and may even preclude you being able to login to the website.
            Necessary
            Always Enabled
            Necessary cookies are absolutely essential for the website to function properly. These cookies ensure basic functionalities and security features of the website, anonymously.
            CookieDurationDescription
            __stripe_mid1 yearThis cookie is set by Stripe payment gateway. This cookie is used to enable payment on the website without storing any patment information on a server.
            __stripe_sid30 minutesThis cookie is set by Stripe payment gateway. This cookie is used to enable payment on the website without storing any patment information on a server.
            cookielawinfo-checkbox-advertisement1 yearSet by the GDPR Cookie Consent plugin, this cookie is used to record the user consent for the cookies in the "Advertisement" category .
            cookielawinfo-checkbox-analytics1 yearSet by the GDPR Cookie Consent plugin, this cookie is used to record the user consent for the cookies in the "Analytics" category .
            cookielawinfo-checkbox-necessary1 yearSet by the GDPR Cookie Consent plugin, this cookie is used to record the user consent for the cookies in the "Necessary" category .
            cookielawinfo-checkbox-others1 yearSet by the GDPR Cookie Consent plugin, this cookie is used to store the user consent for cookies in the category "Others".
            cookielawinfo-checkbox-performance1 yearSet by the GDPR Cookie Consent plugin, this cookie is used to store the user consent for cookies in the category "Performance".
            Functional
            Functional cookies help to perform certain functionalities like sharing the content of the website on social media platforms, collect feedbacks, and other third-party features.
            Performance
            Performance cookies are used to understand and analyze the key performance indexes of the website which helps in delivering a better user experience for the visitors.
            Analytics
            Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics the number of visitors, bounce rate, traffic source, etc.
            CookieDurationDescription
            _ga2 yearsThe _ga cookie, installed by Google Analytics, calculates visitor, session and campaign data and also keeps track of site usage for the site's analytics report. The cookie stores information anonymously and assigns a randomly generated number to recognize unique visitors.
            _gid1 dayInstalled by Google Analytics, _gid cookie stores information on how visitors use a website, while also creating an analytics report of the website's performance. Some of the data that are collected include the number of visitors, their source, and the pages they visit anonymously.
            CONSENT2 yearsYouTube sets this cookie via embedded youtube-videos and registers anonymous statistical data.
            Advertisement
            Advertisement cookies are used to provide visitors with relevant ads and marketing campaigns. These cookies track visitors across websites and collect information to provide customized ads.
            CookieDurationDescription
            VISITOR_INFO1_LIVE5 months 27 daysA cookie set by YouTube to measure bandwidth that determines whether the user gets the new or old player interface.
            YSCsessionYSC cookie is set by Youtube and is used to track the views of embedded videos on Youtube pages.
            yt-remote-connected-devicesneverYouTube sets this cookie to store the video preferences of the user using embedded YouTube video.
            yt-remote-device-idneverYouTube sets this cookie to store the video preferences of the user using embedded YouTube video.
            Others
            Other uncategorized cookies are those that are being analyzed and have not been classified into a category as yet.
            CookieDurationDescription
            cookielawinfo-checkbox-functional1 yearThe cookie is set by GDPR cookie consent to record the user consent for the cookies in the category "Functional".
            SAVE & ACCEPT
            Powered by CookieYes Logo