How To Convert Drupal To WordPress

Note: This will work for converting up to the latest version of Drupal to the latest version of WordPress, as of January 1, 2015.

convert drupal to wordpressAfter hunting down some tutorials and finding some missing important parts, no explanations, and being disappointed, I had to do some experimenting. As a developer, I do not mind solving a challenge and putting puzzles together. There were some decent tutorials, however, I found that once I completed my own Drupal to WordPress conversion, I needed to share the process in the easiest way possible.

Please note that that this tutorial to convert Drupal to WordPress is not giving you the goods on how to convert your stat counters over, if you need to make sure your Disqus comments match up (in the case you use Disqus instead of the content management system’s native comments), or special modules that are storing information in the database. You will need to seek building a extended custom plan for you to convert Drupal to WordPress.

Some of the issues I ran into were questions that other developers had with whether tables could be converted over as well as users. In fact, a lot of the questions I saw were over the user conversion from Drupal to WordPress. Also, this was a problem that was not addressed in some of the tutorials to convert Drupal to WordPress. Some of the scripts did not properly work, or did not have anything about converting over users.

I also found issues with the categories and tags not being translated over to the correct taxonomy when doing my conversion. In fact, they were all slopped into the tags in most cases. My solution is before converting to make sure in the original Drupal install that these taxonomies are correctly labeled. Tags are non-hierarchical and Categories are hierarchical.

Another big problem was running into duplicate errors when feeding the SQL through the conversion process. The solution for this was to check the last known table that was converted over and only convert from after that table. It was tedious, especially since my conversion was for 17,000 posts and over 2,500 users. What a way to break in figuring out how to convert Drupal to WordPress, right?

This post goes over how to convert Drupal to WordPress, mostly the core the database (like posts, post meta, taxonomies, and post types, users, and comments), and a little bit about converting the theme.

Convert Drupal To WordPress: The Database

1. Export the Drupal SQL file from the old host.

2. Install a fresh new WordPress site. You need to clear the tables with the TRUNCATE command by going into your database’s SQL queries tab in phpmyadmin. The code is:

Replace the wordpress before the period with the database table name before executing the query. In the case you are doing the query from that WordPress database directly, you do not need the wordpress and the period in the code when executing the script.

3. If you have multiple users to convert over, you will need to use the following code.

Again, replace the wordpress before the period with the database table name before executing the query.

4. The following query will convert over tags:

5. The following converts over posts.

Please note that if your Drupal installation has several post types, you will want to add the name of the post type into the to the line that says WHERE n.type IN (‘post’, ‘page’, ‘blog’). If you do not add all post types, then not all will be converted over.

6. In the case you want to combine post types in WordPress. Say you wanted post and blog together, you would put the following code:

7. The following code defines the post/ tag relationship

8. The following code is for comments:

9. If you are keeping your Drupal images and filed in the same place, you do not have to do anything. However, if you are FTP-ing your files to the uploads folder in your WordPress wp-content folder, you will want to use the following script to fix the URLs to the images.

10. The following code is suppose to help fix taxonomy… that is if it was set up correctly in the original Drupal site.

11. Author roles for your users:

This sets the author role’s permissions.

You may want to uncomment (remove the number sign) before the line that has the email address and put your own in so your role remains as an administrator.

12. Assign and give administrator status.

13. The following code helps assign authors to the posts they wrote.

UPDATE wordpress.wp_posts
SET post_author = NULL
WHERE post_author NOT IN (SELECT DISTINCT ID FROM wordpress.wp_users)

14. Depending on how the original Drupal site has been set up, sometimes the URLs are funny, try feeding the following query. It does not hurt to try.

15. The following is some extra clean up for the editor so your posts do not look too funky from the conversion.

There are quite a few other options, but I found these the most necessary for my install. In the case you want to look through for more options, you can check out the Drupal to WordPress Migration at the Underdog of Perfection.

I did run into one last thing that was a problem to convert Drupal to WordPress. Once I had everything over, I went to click on the individual posts and pages. I did already set the permalinks to postname. However, the links kept redirecting back to the home page. I had to update the slugs.

To do so, you need to put the following code in the wp-config.php file before the ending PHP tag. Once you have, click save and then reload the front of your site. The script will run and should not take long at all. Once the front of your site loads, go back into the wp-config.php file and remove the code.

Convert Drupal To WordPress: The Theme

If you are familiar with, HTML, PHP, CSS, WordPress theming, and Drupal theming, great! Most people usually write about how to convert Drupal to WordPress, and not talk about the theme conversion, especially for those who love their theme and just want to switch the content management system. You should know that the concepts of theming in WordPress are similar in Drupal. You design the theme, and in the parts that you want WordPress to do the work, like pages, posts, and widgets, you place the code with the coordinating loop and dynamic sidebar PHP call to those areas. If you are not familiar with theming, you can refer to my podcast presentation that includes a slideshow on PSD to WordPress, which delves a little deeper into WordPress theme templates.

You can literally remove all the codes for modules and such from the Drupal theme templates and replace with the WordPress code.

I hope this helps explain the steps to convert Drupal to WordPress. Please use at your own risk and always have a back up before you remove anything for good.


  1. says

    Hi Nile,
    thank you very much indeed for these easy-to-use steps and clear explanations. To be honest, I am fascinated with your ability to find simple words for explaining these complicared issues. Thank you very much once again.

  2. says

    Wow..i just can say that these kind of explanations are very very helpful. I work with WordPress and I was wondering if there was a way to convert WordPress to Drupal. Like you said, there are some tutorials but this explanation is very good and i like to hear it from you if it is possible. Tnx

    • says

      Hi Aleksandar! I am pretty sure there is a way to do the opposite and much of it would most likely be using the same code above, but opposite on the query commands. However, I normally convert sites to WordPress, because it is much easier for people.

  3. says

    I heard that drupal was alo a big deal in the blogosphere, but I never used it, I won’t really be needing this since I rarely find look for any drupal themes

  4. says

    Oh My Gosh!

    I wouldn’t wish this on anyone. I don’t know nothin’ bout no Drupal and hope I don’t ever have to convert it to WordPress!

    But Thanks for sharing anyways!


    ~ Jupiter Jim

    (please delete the parentheses — Nile, don’t worrry, this ain’t my comment for the week. Just had to share this thought!)

  5. says

    Hmmm….converting from drupal to wordpress. The first thing you must do is BACKUP your drupal site before you try this. This is because something unpredictable could happen during conversion.

  6. says


    Thanks for the informative post. I will try the same and if will need any further guidance will approach you.

    Thanks and Regards,
    Nishant Desai | SEO Expert India

  7. says

    Thank you so much for this article! I right now use both Drupal and Wordpress in their own separate worlds, but if I ever need to convert, I know where to go to! Bookmarked! Thanks again!!

  8. says

    Wow! Thank you so much.. you’re a real lifesaver. I had a client today who came to me with his Drupal site and a wanted me to edit the site for him, but I was totally clueless about Drupal. Got it converted to Wordpress thanks to you! Keep on rocking ๐Ÿ™‚

  9. says

    Not familar with Drupal, looks like a nightmare doing this though. Some sites we have are Joomla sites and I’m not a fan. It’s more sophisticated but not as simple :-p

  10. says

    Whoa! Thanks a lot a great deal.. youโ€™re a true lifesaver. I’d a customer at the moment whom located anyone together with his Drupal web site and a noticeably necessary anyone to switch the website meant for him or her, web hosts on the other hand I has been totally clueless concerning Drupal. Started using it turned into WordPress on account of somebody! Proceed rocking.

  11. Ellen says

    thanks for sharing this info! It’s awesome! the fact that you really share this instead of just keep it to yourself or make money…
    The truth is, I am not capable of doing anything more than publishing content on my Drupal site, cause I am afraid to break something (which happened several times already) But I’ve found a tool at that migrates Drupal to WordPress like without any efforts on my site and for free (this is the weirdest thing:)
    Do you think I can try it?
    Sorry, but your wonderful script is something too complex for me to use…

    • says

      I am sure you can try it out. It seems to be in beta version. If you do try it out and it works great, let me know. ๐Ÿ™‚ Just make sure to have a backup of your original Drupal site before trying the migration. ๐Ÿ™‚

      The script is one that is open source and worked for me from scripts that had some missing areas. I am just sharing my experience and hope it helps.

    • says

      That is no longer free. I tried it and it converted about 10 posts/users. Then asked me to pay $50 to convert more. After doing some research online someone else had to pay over $100.

      They just entice you to use the software, and then pressure you to pay after you get the conversion done at 25% or less.

      So Nile’s method is good to use as a free option, though I do know some people feel scared to even look or touch code.

      I also have a converter that does everything for you no coding skills required.

      I’m not allowed to post the link here, but you can always search google. If you know some code or feel okay with it then go with Nile’s route.

  12. says

    As wordpress provides all the features without any head ache of coding. I don’t have any idea about Drupal but I think wordpress is best at this time.

  13. says

    hello Nile..
    I never used drupal yet ,But I learn converting procedure for my future.May be this will be very helpful to me in future.Thanks for nice sharing.

  14. says

    I haven’t used drupal as I am always connect with wordpress. As it is the nice interface for blogging. Thanks for this tutorial for converting drupal to wordpress.

  15. says

    I am a new user to this blog. so informative. i learned few methods from your site. Drupal is another CMS like wordpress. but i am completely new to this. anyway it will be useful in future. i will practice with this. thank you

  16. Amy says

    Arghh… I wish I had come across this before moving my site over. I’ve already populated a lot in Wordpress, but I still want to import my older Drupal articles into WP.

  17. says

    Hi – I am a newbie to wordpress. I’m happy to have found this tutorial but I have a really basic question. I want to make sure I follow the steps correctly.
    1) So When I export the Drupal database, I’m assuming that I I then import it to the fresh wordpress install? Or I make the truncation changes on the database before importing it to wordpess?

    • says

      You will want to have the drupal tables on the same web hosting account as your WordPress install before converting over… that is why you have to label your database tables properly in order to do the conversion. You don’t have to have the Drupal database in the same exact database as WordPress… just the same web hosting account’s MySQL. So if i were converting here, I’d more than likely put my drupal database in blondish_drpdb and convert it over to blondish_wrdp as an example.

      • says

        Thank you for the clarification. You are extremely helpful. But just to be sure…

        1) copy the original database and place it in the wordpress site.
        2) Does the fresh wordpress install have to happen AFTER putting the database there? I already installed Wordpress.
        3) make of copy of that original database and make the changes to the new database as listed above – so that there is an original drupal database and a modified/converted wordpress database on the same site.

        Please excuse my “blondness” ๐Ÿ™‚ (I use to be anyway…)

        • says

          Hi Heather!

          You do not have to put the Drupal database into the same database as WordPress. You can create a new mySQL database and import the database through MySQL.

          However, if you do want to convert the Drupal database in the same one as WordPress, just import the sql or compressed sql file of the Drupal database into the WordPress one. Now, once you are done converting, you can select the Drupal tables and drop them. You may need to take notes on what tables to actually drop so you don’t accidentally delete a WordPress table.

          You don’t have to have a fresh install of WordPress when you are done converting, but like I said above, and recommend… remove the Drupal tables if you are indeed working in the same database account as your WordPress installation. I hope that helps.

  18. says

    Wait – so the first part – deleting the users greater than 1, doesn’t make sense to me. Why would I do that? Sorry… but I have the users already listed just fine so I don’t understand why I should delete them…

    • says

      This is to remove the users. If you have users in drupal, you will need to remove any that you have in WordPress except for 1, which is your admin. If you don’t have more than one, you can skip this step.

      • says

        The proper answer here is that you DO have to delete users >1. Why? because if you have a user with the user ID 2 in Wordpress already and your drupal database has another user with a user ID 2. Then when you port over the drupal user2 it will either overwrite the wordpress user2 or it will not port that user over. In this case you now have a problem…..

        That’s why you need to delete the users on the wordpress end or better yet start WP from a fresh install. That way you’ll only have 1 user with the user ID 1.

  19. says

    I can call myself an expert in Drupal and PHP, but I haven’t worked on any conversions yet, as I do have a separate team working on stuffs like that.

    I will pass over this info to my team, might be of use in the future. But most of my customers come in to get converted to Drupal and not otherwise. But I loved reading this post as you are so precise with your steps in conversion.

  20. emilio says

    Hi there,
    I used your SQL to import the “posts” and “pages” into WordPress. When I go into wp-admin, everything is listed under pages, and nothing is under posts. In the wp-db, post_type correctly contains all the types from drupal, “blog, image, story, etc” any thoughts?


      • says

        You could move the images to your uploads folder and change the links to direct the path there as per one of the steps. The only issue is that you will not be able to manage them in the Media Library unless you load them from the WordPress admin.

    • says

      You have to either register a custom post type in WordPress, OR, you will have to change in your Drupal database the line for the post type. blog and story are normally for post.

      • Emilio says

        Hi thanks for replying. But it doesn’t explain why everything is listed as a page in wp. What is the correct value for a “post” and “page”? In your code example above it might be useful to indicate that “WHERE n.type IN (‘post’, ‘page’, ‘blog’)” will certainly pull the content, but it won’t correctly produce posts in wp. wp expects post_type=’post’ to display as post and you’ll have to convert everything else to ‘post’ or register the custom post_types.
        Additionally, images are stored as:

        Thanks for the article, it definitely helped jump start the process. ๐Ÿ™‚

        • says

          If you don’t want blog, don’t put it in your MySQL. post_type for posts are ‘post’ and ‘page’ for pages. If you want other post_types like image or other, like blog, you can still carry those over, BUT… you are going to have to create a custom post type (register it in your themes functions.php or install the Custom Post Types UI plugin) for blog or story, or anything else.

  21. Victor says

    Looks like this is exactly what I need. However, I am not sure at what stage I should bring in the actual data from the exported Drupal .sql? Should this be the last step after all the SQL statements are run? If yes, shouldn’t this be pointed out in the article?
    On the third step I get “#1142 – SELECT command denied to user ‘my_user_name’@’localhost’ for table ‘term_data’ “.

    Thanks for your help.

    • says

      There are some scanners in WordPress that will grab from the original site and import. Right now, the Image Scanner plugin available in WordPress is old and only works on individual posts, and not the mass one. I’d like to see someone fork it over and work with it. I may try to fork the plugin over and hopefully it could help.

  22. says

    Thanks so much for the article.

    I’ve attached an updated sql query from inserting posts & pages from drupal 7 –> wordpress 3, for posterity’s sake.

    You’ll need to change one of the IF statement in the select clause to make sure the correct drupal node type turns into a post (our node type was “article” in drupal):

    INSERT INTO wordpress.wp_posts
    (id, post_author, post_date, post_content, post_title, post_excerpt,
    post_name, post_modified, post_type, post_status)
    n.nid id,
    n.uid post_author,
    FROM_UNIXTIME(n.created) post_date,
    rb.body_value post_content,
    n.title post_title,
    rb.body_summary post_excerpt,
    IF(SUBSTR(a.alias, 11, 1) = ‘/’, SUBSTR(a.alias, 12), a.alias) post_name,
    FROM_UNIXTIME(n.changed) post_modified,
    IF(n.type = “article”,”post”,n.type) as post_type,
    IF(n.status = 1, ‘publish’, ‘private’) post_status
    FROM drupal.node n
    INNER JOIN drupal.node_revision r
    INNER JOIN drupal.field_revision_body rb ON rb.entity_id = r.nid
    LEFT OUTER JOIN drupal.url_alias a
    ON a.source = CONCAT(‘node/’, n.nid)
    # Add more Drupal content types below if applicable.
    WHERE n.type IN (‘article’, ‘page’)

  23. Abdul Moiz says


    This is a great post, I am about to convert a very very heavy website to Wordpress, I hope I can do it. Is there any way I can be in direct contact with your via Email or something like that.

    • says

      Hi Abdul! If you’re asking me to consult with you even through email for your Drupal to WordPress conversion, I do charge per hour – $50/hour flat rate. You’re welcome to use my contact form to ask, but I’m no longer answering questions via email for free because I’ve had to give up time in the past.

  24. Michele says

    I imported my drupal 7.25 directly into my wordpress 3.9 install. the wordpress wp is actually 5ma. The drupal tables have nothing in from of the names. I keep getting this error:

    #1054 – Unknown column ‘n.body’ in ‘field list’
    Please help!

    Here is my sql. accessed from phpmyadmin:

    INSERT INTO 5ma_posts
    (id, post_author, post_date, post_content, post_title, post_excerpt,
    post_name, post_modified, post_type, post_status)
    n.nid id,
    n.uid post_author,
    FROM_UNIXTIME(n.created) post_date,
    n.body post_content,
    n.title post_title,
    n.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 node n
    INNER JOIN node_revision r
    LEFT OUTER JOIN url_alias a
    ON a.src = CONCAT(‘node/’, n.nid)
    # Add more Drupal content types below if applicable.
    WHERE n.type IN (‘post’, ‘page’, ‘blog’)

    • says

      your name is wrong for your database table, which you are missing…. and you need the period before it. Usually if your converting, your converting to a fresh WordPress install with default tables

  25. Nitz says

    So I decided to code a converter after finding none out there. Itโ€™s pretty indepth since I was doing it for a clients website.

    I posted more details here if anyone is interested.

    • says

      I removed your link as it was posted in a forum. You need to put a website up. The directions in this tutorial are complete and still work even on Drupal 7.

  26. philip says

    thanks for the awesome tutorial. i am having a problem with converting the tags. whenever i run the queries i get the following error:
    Duplicate entry ’77-post_tag’ for key ‘term_id_taxonomy’

    any help is greatly appreciated.

    • says

      HI Philip. If the database your’re converting from is a duplicate of the original (I hope it is), go to the Drupal database and remove the tag giving the problem. Then run the query through again. This is like the issue I had with the posts giving a problem with the primary key. I’m thinking something got corrupted. You should still have the taxonomy, but you just need to remove it now in order to proceed.

      • philip says

        thanks for the help. unfortunately, i’m still having problems. but it’s okay, the client is only worried about the last 6 months worth of posts (which isn’t a lot) so they will just manually convert the tags.

        i did notice something, the SQL for steps 13 and 14 are the same. just thought you should know.

        thanks again for the help.

  27. says

    Hello Nile,
    I’m a designer from Miami, FL,
    I want to thank you for this post very illustrative and useful!! Thanks a lot!!
    I wonder if you could recommend me some effective guide for theming wordpress.?

  28. says

    Hi there, I’m trying to do this but I am having the HARDEST time getting it to work. Hoping you can please help me out…

    This is what I’ve done….

    1.) exported drupal database
    2.) set up a wordpress site
    3.) in myphp admin, Iv’e imported the drupal sql database

    now this is where I get stuck…

    4.) I’ve pasted the TRUNCATE tables (with this):
    # Empty previous content from database.
    TRUNCATE TABLE .wp_comments;
    TRUNCATE TABLE .wp_links;
    TRUNCATE TABLE .wp_postmeta;
    TRUNCATE TABLE .wp_posts;
    TRUNCATE TABLE .wp_term_relationships;
    TRUNCATE TABLE .wp_term_taxonomy;
    TRUNCATE TABLE .wp_terms;

    5.) when I try to paste the step 4 of your tutorial (even when removing the “wordpress” in front of the periods), I get the following error: MySQL said: Documentation

    #1142 – SELECT command denied to user ‘wordpress_5f’@’localhost’ for table ‘term_data’

    Can you please let me know what might be going wrong? Would be amazing to get this to work…

    • says

      It should work. Hopefully you didn’t add the drupal tables into the same database you were converting over, or it won’t work right.

      • Mike says

        Hmm. maybe that’s where I’m confused… since what I’m trying to do is set up a wordpress site on a server that’s DIFFERENT than the already live and hosted drupal site…

        I have access to the live site’s drupal database though which I’ve exported – So, from here, am I supposed to set up a SEPERATE drupal database on the dev server, called “drupal”, and another wordpress database, where in my phpadmin it knows to look for the “drupal” database and port things over? Sorry if that’s confusing…

        I thought the process involved importing the drupal database tables into the wordpress ones as well… which is incorrect?

        Thanks for replying so quickly.

        • says


          Did you ever figure this out? I know it’s been almost a year since your comment, but I’m running into the same issue & I’m not sure exactly where I’m supposed to import the Drupal database if not into the same database as the WP tables.

          • says

            You import it into a fresh WordPress database.

            You will have a backup sql of Drupal.

            You will have a database of that Drupal install for reference.

            You will have a fresh copy/ database of WordPress to work with.

            You only need to make sure to add your database name in the parts that are drupal., for your drupal database, and wordpress., for your WordPress. You will be working in that WordPress installs SQL tab.

          • says

            Thanks, Nile! I had left the drupal. in there & it was causing the error message. All set now. Great article & very nice of you to continue to respond to those of us hitting our heads against the proverbial wall.

          • says

            Not a problem. Better to reply in the comments and I can go back to edit the article in the future for anything you all have had issues understanding. ๐Ÿ™‚

  29. ameet says

    “Another big problem was running into duplicate errors when feeding the SQL through the conversion process. The solution for this was to check the last known table that was converted over and only convert from after that table. It was tedious…”

    Could you elaborate on this, I too am getting stuck here. I have several post types but even if I pull almost all of them out, I always get a “#1062 – Duplicate entry ‘14405’ for key ‘PRIMARY’ ”

    I’m not sure I know what you mean about the “last known table” and start after that. As far as I can see nothing ever gets converted, so not sure what the last known table would be in the scenario.

    thx so much, this blog post is amazing.

    • ameet says

      It is happening when I try to copy the posts over. Once I get the error, I select from wp_posts and it is still empty so it must just rollback out.

    • says

      Look up the entry and see if it did convert. Then, go back to the Drupal copy that you’re converting and delete that table. It’s also a possibility that if it didn’t convert, it’s corrupted, so make a notation and after the conversion, you WILL have to manually insert the post into it. It’s strange when it does happen, but it’s nothing to panic over unless the data in the original Drupal is not there at all.

  30. says

    Is there any WordPress plugin to do automatic Drupal to WordPress migration service for free? Steps described by you in above post are too technical and hard to do.

  31. says

    I’ve used your notes to migrate a Drupal site to a temporary WP site ( and it did surprisingly well.

    However, I’m only seeing 1 post in the dashboard while the database shows 595 rows in the wp_posts table. I’m not an experienced database person so I don’t really know what to do to get the wp_posts to register on the site.


    • says

      There’s a possibility you didn’t pay attention to the post types when you did the database. If you had blog, story, news, etc… and you needed all of them to be posts, you needed to include them in when you brought in the database. After that, you needed to do the step to turn blog to posts, story to posts, etc so that the post format was correct.

      However, if you intend to keep those post formats, then you need to use the Custom Post Types UI plugin and create the blog and story post types… the slugs MUST be the same as in Drupal.

      • says


        I did the import step with all the different content types,but in my ignorance I didn’t convert each of the types to posts. Once you pointed that out it came over fine.

        Unfortunately, all the drupal categories are rendered as tags rather than WP categories. That’s something I can fix manually, but I’m wondering if I could have populated the categories with what are now tags?

        Thanks again for the help, Lloyd

  32. says

    Still checking the transfer site and find there are also 57 rows in wp_terms but no Categories in the Dashboard.

    Also, I FTPed the image files/folders to wp-content>uploads. I ran the script to change the image URLs in the posts but they aren’t registered in Media. Did I do this wrong?

    Sorry to be so needy, this is a new stretch for me and I really appreciate your post.

    • says

      You’re going to have to redo the categories as all taxonomies in Drupal will lop themselves into the tags taxonomy. There is a plugin called Simple Tags that can help –

      You won’t see the images in the media library to be able to preview… kind of sucks. I know there is a plugin called Image Cache that if the existing website is still up, you can import. However, mass importing would be bad. The plugin is free and searchable in the WordPress plugin director, but it is old.

      • says

        Thanks again,

        Simple tags made conversion of tags to categories easy, and it kept the assignments to the posts.

        For bulk uploading images and files to Media the “Add From Server” plugin is working well, except it doesn’t maintain the image links to the posts and pages.

        Thanks again, Lloyd

  33. alinka says

    I’m at step 5 and I keep getting term_data table not found. I checked the drupal database and there’s no table with such name in it. I have Drupal 7.31. Can you please help?

  34. Scott says

    Thank you for this, it has been a great help.

    I had to modify a number of queries as my drupal set up was different to yours, but it provided a great starting point.


  35. says

    Hi, I’m new around PHP MyAdmin and I’ve been trying to copy/paste your code into the queries tab for some time and with no result. When I click the queries tab, I do so after having clicked on the database title (it’s called wordpress). So far I’ve had 0 results. Surely, I must select the appropriate tables in the queries tab before submitting my query. I’m really at a loss and I’ve been trying to follow these instructions for a week.

      • says

        Hi, so in the end I see I must enter these queries in the MYSQL console instead of the queries tab in phpmyadmin. I was just about to remove my post!

        I’m still facing issues with queries not being recognized such as: INNER JOIN drupal.node_revisions r (my table here would be drupal.node_revision) but when i remove the s I get another error. Another example is my inexistant drupal.term_data table which makes even the second query impossible! I’m not out of the woods yet…

        • says

          replace drupal of drupal.node_revisions and other similar queries with the database name from the database you’re converting from. same thing with WordPress.

          • says

            My database names are drupal and wordpress (I named them according to the names given in the instruction in the hope it would save me some tweaking). I guess we can diagnose that the table names still aren’t recognized.

  36. YK says

    Migrated from Drupal 6 (single author) to Wordpress 4.1.1, it just worked. The only thing i had to modify was the drupal content type which, in my case, was called story instead of post. Thanks a lot!

  37. says

    I have a client who has a drupal site and a wordpress site. The old developer does not want me ftping into the host server so they sent me the drupal database backup and all the files from the server folders….one for the wordpress site and one for the drupal site.
    If I was to place that into a folder on my bluehost server do you think it would work after creating a new database and using the backup file to populate it? My thinking is that after I have full access to the drupal site and database converting it over to wordpress might be easier. Your thoughts please?

    • says

      You need to create 2 backups of the Drupal database first… that is my recommendation. Load one up to your development site’s database. Use the other as a just in case you need it.

      If the database is over, 55MB, you will need to load the sql file to your web host and ask BlueHost to restore the database for you so you can work on it. ALWAYS keep your Drupal copy and your WordPress on SEPARATE databases.

      Your client will still need to give you FTP details eventually, and there is a way to log in to phpmyadmin without having access to everything.

  38. says


    I felt lucky finding this article to convert our Drupal site to WP. I was able to execute all queries.
    But stuck at the script in last script. I don’t see any closing PHP tag and hence I pasted it at the end of wp-config.php and now I am getting error. Is there anything need to be removed/replaced like $wpdb?
    Is there SQL version for this script, so it can be easily execute. May be as a stored procedure.

  39. Julie Lawrence says

    Thanks so much Nile!! Your code worked beautifully.

    A couple of other points for anyone else following along …

    I had problems with bringing over the taxonomy where there were duplicate tags (eg nested in other non-duplicate parents) … I ended up manually changing them to be unique over at the drupal site, it was easier than messing with the code. Also, your code brings over the taxonomy all as post_tag, I changed that to category and it worked fine.

    USERS – I made 3 changes
    1. Bringing over ALL users, not just authors
    2. I notice your code didn’t bring over the passwords. Apparently drupal and wordpress both use MP5, so it IS possible to copy over the passwords.
    3. Your code sets the login name to be the email address – I wanted to use the login name they’d had initially, so I used REPLACE(, ‘ ‘, ”) to remove the spaces

    The code I ended up with is:

    INSERT IGNORE INTO wordpress.wp_users
    (ID, user_login, user_pass, user_nicename, user_email,
    user_registered, user_activation_key, user_status, display_name)
    u.uid, REPLACE(, ‘ ‘, ‘.’), u.pass,, u.mail,
    FROM_UNIXTIME(created), ”, 0,

    I then made sure there were no duplicate user names (not sure if Drupal allows them, just thought I’d be safe):

    SELECT user_login, COUNT( user_login )
    FROM wp_users
    GROUP BY user_login
    HAVING COUNT( user_login ) >1

    Thanks again for the guide!!

Comment Policy: Your words are your own, so be nice and helpful if you can. Please, only use your real name, otherwise your comment will be removed. Most comments are moderated until you've been approved as a trusted commentator.

Leave a Reply

Your email address will not be published. Required fields are marked *