<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Complex CMS Migration Service - Migrate Content (Posts about sql)</title><link>https://migratecontent.com/</link><description></description><atom:link href="https://migratecontent.com/categories/sql.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><lastBuildDate>Mon, 23 Mar 2026 12:51:16 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>How to change the WordPress table prefix prior to a migration</title><link>https://migratecontent.com/change-wordpress-table-prefix-prior-migration/</link><dc:creator>Anthony Lopez-Vito</dc:creator><description>&lt;p&gt;When working on a &lt;a href="https://migratecontent.com/drupal-to-wordpress-migration-service/"&gt;Drupal to WordPress migration&lt;/a&gt; project, I like to migrate into a set of intermediary WordPress tables that live in the Drupal database. These are working tables where I can run various scripts to process and clean up the content before exporting to a working WordPress installation. It's not &lt;em&gt;necessary&lt;/em&gt; to do this but I find it convenient to run scripts on the same database rather than deal with two separate database connections.&lt;/p&gt;


&lt;figure class="figure d-flex flex-column align-items-center"&gt;
    &lt;img src="https://migratecontent.com/images/gavin-allanwood-q92hWEdK8p8-unsplash.jpg" alt="Overhead image of cafe tables" class="figure-img img-fluid rounded" width="800" height="533"&gt;
&lt;/figure&gt;

&lt;p&gt;Note that some people suggest renaming the table prefixes to improve security. My use of the table prefixes is simply to create temporary containers for the migration. While non-standard prefixes might help prevent 'script kiddie' attacks, I find it isn't worth the disadvantages that come with this sort of &lt;a href="https://en.wikipedia.org/wiki/Security_through_obscurity"&gt;security through obscurity&lt;/a&gt; (or more precisely, &lt;a href="https://en.wikipedia.org/wiki/Security_through_obscurity#Security_through_minority"&gt;security through minority&lt;/a&gt;) approach. Here are two articles give a deeper explanation of topic:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;wordfence.com: &lt;a href="https://www.wordfence.com/blog/2016/12/wordpress-table-prefix/"&gt;WordPress Table Prefix: Changing It Does Nothing to Improve Security&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;wpkrauts.com: &lt;a href="https://web.archive.org/web/20150129082218/http://wpkrauts.com/2015/the-database-prefix-is-not-a-security-feature/"&gt;The database table prefix is not a security feature&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;SQL queries to change the WordPress table prefixes&lt;/h2&gt;
&lt;p&gt;You can start with a freshly installed WordPress database. Dumping this and importing to your Drupal migration database will give you all the tables with the correct WordPress schema. I use the &lt;em&gt;acc_&lt;/em&gt; prefix but you can use whatever you want.&lt;/p&gt;
&lt;p&gt;Rename the tables with these queries:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;RENAME table `wp_commentmeta` TO `acc_commentmeta`;
RENAME table `wp_comments` TO `acc_comments`;
RENAME table `wp_links` TO `acc_links`;
RENAME table `wp_options` TO `acc_options`;
RENAME table `wp_postmeta` TO `acc_postmeta`;
RENAME table `wp_posts` TO `acc_posts`;
RENAME table `wp_terms` TO `acc_terms`;
RENAME table `wp_termmeta` TO `acc_termmeta`;
RENAME table `wp_term_relationships` TO `acc_term_relationships`;
RENAME table `wp_term_taxonomy` TO `acc_term_taxonomy`;
RENAME table `wp_usermeta` TO `acc_usermeta`;
RENAME table `wp_users` TO `acc_users`;&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;Testing the migration results&lt;/h2&gt;
&lt;p&gt;If you need to point a WordPress installation to these tables for testing, you'll need to do two things:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Update the &lt;em&gt;$table_prefix&lt;/em&gt; setting in the &lt;em&gt;wp-options.php&lt;/em&gt; file&lt;/li&gt;
&lt;li&gt;Update the &lt;em&gt;options&lt;/em&gt; and &lt;em&gt;usermeta&lt;/em&gt; tables&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Updating the &lt;em&gt;$table_prefix&lt;/em&gt; setting in the &lt;em&gt;wp-options.php&lt;/em&gt; file is straightforward. Open the file and edit the line:&lt;/p&gt;
&lt;pre&gt;$table_prefix  = 'acc_';&lt;/pre&gt;
&lt;p&gt;In WordPress, prefixes are saved as entries in the &lt;em&gt;options&lt;/em&gt; and &lt;em&gt;usermeta&lt;/em&gt; table. Check for entries containing the prefix:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;SELECT * FROM `acc_options` WHERE `option_name` LIKE '%wp_%';
SELECT * FROM `acc_usermeta` WHERE `meta_key` LIKE '%wp_%';&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;When you have all the entries, update them with the new prefix. The query will probably look something like this:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;UPDATE `acc_options` SET `option_name` = 'acc_user_roles' WHERE `option_name` = 'wp_user_roles';
UPDATE `acc_usermeta` SET `meta_key` = 'acc_capabilities' WHERE `meta_key` = 'wp_capabilities';
UPDATE `acc_usermeta` SET `meta_key` = 'acc_user_level' WHERE `meta_key` = 'wp_user_level';
UPDATE `acc_usermeta` SET `meta_key` = 'acc_user-settings-time' WHERE `meta_key` = 'wp_user-settings-time';
UPDATE `acc_usermeta` SET `meta_key` = 'acc_user-settings' WHERE `meta_key` = 'wp_user-settings';
UPDATE `acc_usermeta` SET `meta_key` = 'acc_dashboard_quick_press_last_post_id' WHERE `meta_key` = 'wp_dashboard_quick_press_last_post_id';
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;A word of warning:&lt;/strong&gt; it's easy to forget to change the prefixes back to match the final WordPress installation. If you do, the WordPress user accounts will have problems, such as the Dashboard controls not being visible after logging in. Because of this, I tend to have a separate testing installation that gets an import of the working tables.&lt;/p&gt;

&lt;div class="footnotes"&gt;
&lt;p&gt;Cover photo by &lt;a href="https://unsplash.com/@gavla?utm_content=creditCopyText&amp;amp;utm_medium=referral&amp;amp;utm_source=unsplash" target="_blank" rel="nofollow"&gt;Gavin Allanwood&lt;/a&gt; on &lt;a href="https://unsplash.com/photos/aerial-photo-of-grey-tables-q92hWEdK8p8?utm_content=creditCopyText&amp;amp;utm_medium=referral&amp;amp;utm_source=unsplash" target="_blank" rel="nofollow"&gt;Unsplash&lt;/a&gt;&lt;/p&gt;
&lt;/div&gt;


&lt;section class="breakout-white"&gt;
&lt;div class="breakout-inner text-center"&gt;

&lt;h2&gt;Need Help With Your Drupal to WordPress Migration?&lt;/h2&gt;

&lt;p&gt;I specialise in complex Drupal to WordPress migrations, including database preparation, table prefix management, and post-migration testing. Get a free, no-obligation consultation.&lt;/p&gt;

&lt;div class="button-container" style="margin:2em 0;"&gt;
&lt;a class="cta-button" href="https://migratecontent.com/contact/" title="Get a quote for your Drupal to WordPress migration"&gt;Get a Free Quote&lt;/a&gt;
&lt;/div&gt;

&lt;/div&gt;
&lt;/section&gt;</description><category>database</category><category>drupal</category><category>migration</category><category>sql</category><category>wordpress</category><guid>https://migratecontent.com/change-wordpress-table-prefix-prior-migration/</guid><pubDate>Thu, 16 Mar 2017 13:12:02 GMT</pubDate></item><item><title>Migrating Bare Bones Yojimbo to WordPress</title><link>https://migratecontent.com/migrating-bare-bones-yojimbo-wordpress/</link><dc:creator>Anthony Lopez-Vito</dc:creator><description>&lt;p&gt;In a &lt;a href="https://migratecontent.com/yojimbo-to-tomboy-notes-migration-tool/"&gt;previous post&lt;/a&gt;, I wrote about exporting data from Bare Bones Software's Yojimbo and using &lt;a href="https://wiki.gnome.org/Apps/Tomboy"&gt;Tomboy&lt;/a&gt; as an alternative. My migration script scraped the content from Yojimbo Sidekick and wrote XML files in Tomboy Note format. Though there were some drawbacks, such as tags being unavailable in Yojimbo Sidekick, I thought Tomboy's search feature would be adequate. A couple of weeks trialling Tomboy proved that it wasn't going to be a Yojimbo killer. Tomboy can't compete in terms of overall usability and though it'll work on my Linux and OS X machines, note synchronisation takes &lt;a href="https://wiki.gnome.org/Apps/Tomboy/Synchronization"&gt;some setup&lt;/a&gt; that didn't warrant further time investment.&lt;/p&gt;

&lt;p&gt;Once again I turned to WordPress as an easy solution. There's a risk of seeing WordPress as my hammer for everything that looks like a nail but it has taxonomies, a reliable-enough search functionality and being web-based, works across all my devices. I'm very familiar with the platform and have already built up my own set of tools to export and migrate content. Why &lt;em&gt;not&lt;/em&gt; use WordPress? Getting data out of Yojimbo was another issue. The quick and easy Yojimbo Sidekick route already proved inadequate so it was time to dig in and reverse engineer Yojimbo's storage mechanism.&lt;/p&gt;

&lt;h2&gt;Analysing and exporting the Yojimbo database&lt;/h2&gt;

&lt;p&gt;'Reverse engineering' turned out to be too lofty a term for the task. It was obvious after quick look that Yojimbo uses an SQLite database to store information. Firing up &lt;a href="http://sqlitebrowser.org/" title="DB Browser for SQLite "&gt;DB4S&lt;/a&gt; to analyse the tables and bit of analysis revealed the tables, columns and relationships that are important for exporting our notes. The columns are a little oddly named but it didn't take long to figure out the necessary fields for migrating to WordPress.&lt;/p&gt;

&lt;table width="60%" class="table-bordered"&gt;
&lt;caption&gt;Table: ZITEM&lt;/caption&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th width="10%"&gt;Column&lt;/th&gt;
&lt;th width="50%"&gt;Description&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr class="odd row-first"&gt;
&lt;td&gt;ZBLOB&lt;/td&gt;
&lt;td&gt;This looks like an ID&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class="even"&gt;
&lt;td&gt;ZNAME&lt;/td&gt;
&lt;td&gt;The Yojimbo note title&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class="odd"&gt;
&lt;td&gt;Z_PK&lt;/td&gt;
&lt;td&gt;The ID to the Z_15TAGS relationship table&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;

&lt;table width="60%" class="table-bordered"&gt;
&lt;caption&gt;Table: ZTAG&lt;/caption&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th width="10%"&gt;Column&lt;/th&gt;
&lt;th width="50%"&gt;Description&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr class="odd row-first"&gt;
&lt;td&gt;Z_PK&lt;/td&gt;
&lt;td&gt;The Tag ID&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class="even"&gt;
&lt;td&gt;ZNAME&lt;/td&gt;
&lt;td&gt;The tag name&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;

&lt;table width="60%" class="table-bordered"&gt;
&lt;caption&gt;Table: ZBLOBLSTRINGREP&lt;/caption&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th width="10%"&gt;Column&lt;/th&gt;
&lt;th width="50%"&gt;Description&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr class="odd row-first"&gt;
&lt;td&gt;ZBLOB&lt;/td&gt;
&lt;td&gt;ID&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class="even"&gt;
&lt;td&gt;ZSTRING&lt;/td&gt;
&lt;td&gt;String for unencrypted item&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;

&lt;table width="60%" class="table-bordered"&gt;
&lt;caption&gt;Table: Z_15TAGS&lt;/caption&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th width="10%"&gt;Column&lt;/th&gt;
&lt;th width="50%"&gt;Description&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr class="odd row-first"&gt;
&lt;td&gt;Z_15ITEMS1&lt;/td&gt;
&lt;td&gt;Relationship ID&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class="even"&gt;
&lt;td&gt;Z_25ITAGS&lt;/td&gt;
&lt;td&gt;Tag ID&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;

&lt;img src="https://migratecontent.com/images/yojimbo-tables.jpg" alt="Yojimbo SQLite tables" width="363" height="213" class="aligncenter size-full wp-image-1822"&gt;

&lt;p&gt;It became a simple matter of tweaking my Drupal to WordPress migration queries to extract from the Yojimbo database and create WordPress posts. Unlike with the Tomboy Notes route, it was possible to recreate the tags, which is what makes Yojimbo so useful. One drawback is that I haven't figured out how to extract encrypted notes but I didn't use Yojimbo to store important encrypted information so that wasn't a priority.&lt;/p&gt;

&lt;h2&gt;WordPress as a Yojimbo alternative&lt;/h2&gt;

&lt;p&gt;Using WordPress as a Yojimbo alternative might not work for everyone but after several months use, I've found it to be an excellent cross-platform replacement. The installation and database runs on a NAS drive connected to my local network so is accessible to all my devices. Standard WordPress taxonomies, search and plugins makes content management simple once you've imported the Yojimbo content. In fact, by migrating away from Yojimo, I've ended up creating my own full-blown personal knowledge management system.&lt;/p&gt;

&lt;p&gt;If you need to export your Yojimbo notes to a cross-platform alternative, give WordPress a try. You can grab my migration script from &lt;a href="https://gitlab.com/anthonylv/pyYojimboMigrate" title="pyYojimboMigrate: Yojimbo to WordPress export and migration"&gt;GitLab&lt;/a&gt; but please keep in mind that it was a quick hack to achieve a specific one-time objective. You may need to hack it to suit your own setup.&lt;/p&gt;</description><category>database</category><category>migration</category><category>sql</category><category>tomboy</category><category>wordpress</category><category>yojimbo</category><guid>https://migratecontent.com/migrating-bare-bones-yojimbo-wordpress/</guid><pubDate>Wed, 04 Jan 2017 11:28:07 GMT</pubDate></item><item><title>Drupal to WordPress migration: user table mapping</title><link>https://migratecontent.com/drupal-to-wordpress-migration-user-table-mapping/</link><dc:creator>Anthony Lopez-Vito</dc:creator><description>This is part four of a series of posts documenting the table mappings for a &lt;a href="https://migratecontent.com" title="Drupal to WordPress migration service"&gt;site migration&lt;/a&gt; from Drupal 6 to WordPress 3. For more information, please see the &lt;a href="https://migratecontent.com/drupal-to-wordpress-migration-posts-table-mapping/"&gt;first article&lt;/a&gt; in the series.

&lt;h2&gt;Table mapping for WordPress users&lt;/h2&gt;

This maps Drupal user export to WordPress.

&lt;table cellspacing="0" cellpadding="0" class="t1"&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td valign="top" class="td1"&gt;
        &lt;p class="p2"&gt;&lt;span class="s1"&gt;&lt;b&gt;Drupal 6.x&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;
      &lt;/td&gt;
      &lt;td valign="top" class="td2"&gt;
        &lt;p class="p2"&gt;&lt;span class="s1"&gt;&lt;b&gt;WordPress 3.x&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;
      &lt;/td&gt;
      &lt;td valign="top" class="td3"&gt;
        &lt;p class="p2"&gt;&lt;span class="s1"&gt;&lt;b&gt;Notes&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td valign="top" class="td4"&gt;
        &lt;p class="p2"&gt;&lt;span class="s1"&gt;&lt;b&gt;users&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;
      &lt;/td&gt;
      &lt;td valign="top" class="td5"&gt;
        &lt;p class="p2"&gt;&lt;span class="s1"&gt;&lt;b&gt;wp_posts&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;
      &lt;/td&gt;
      &lt;td valign="top" class="td6"&gt;
        &lt;p class="p3"&gt;&lt;br&gt;&lt;/p&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td valign="top" class="td7"&gt;
        &lt;p class="p2"&gt;&lt;span class="s1"&gt;uid&lt;/span&gt;&lt;/p&gt;
      &lt;/td&gt;
      &lt;td valign="top" class="td8"&gt;
        &lt;p class="p2"&gt;&lt;span class="s1"&gt;ID&lt;/span&gt;&lt;/p&gt;
      &lt;/td&gt;
      &lt;td valign="top" class="td6"&gt;
        &lt;p class="p3"&gt;&lt;br&gt;&lt;/p&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td valign="top" class="td9"&gt;
        &lt;p class="p2"&gt;&lt;span class="s1"&gt;name&lt;/span&gt;&lt;/p&gt;
      &lt;/td&gt;
      &lt;td valign="top" class="td10"&gt;
        &lt;p class="p2"&gt;&lt;span class="s1"&gt;user_login&lt;/span&gt;&lt;/p&gt;
      &lt;/td&gt;
      &lt;td valign="top" class="td11"&gt;
        &lt;p class="p2"&gt;&lt;span class="s1"&gt;Format to lowercase, replace spaces with underscores&lt;/span&gt;&lt;/p&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td valign="top" class="td9"&gt;
        &lt;p class="p2"&gt;&lt;span class="s1"&gt;pass&lt;/span&gt;&lt;/p&gt;
      &lt;/td&gt;
      &lt;td valign="top" class="td10"&gt;
        &lt;p class="p2"&gt;&lt;span class="s1"&gt;user_pass&lt;/span&gt;&lt;/p&gt;
      &lt;/td&gt;
      &lt;td valign="top" class="td11"&gt;
        &lt;p class="p3"&gt;&lt;br&gt;&lt;/p&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td valign="top" class="td9"&gt;
        &lt;p class="p2"&gt;&lt;span class="s1"&gt;name&lt;/span&gt;&lt;/p&gt;
      &lt;/td&gt;
      &lt;td valign="top" class="td10"&gt;
        &lt;p class="p2"&gt;&lt;span class="s1"&gt;user_nicename&lt;/span&gt;&lt;/p&gt;
      &lt;/td&gt;
      &lt;td valign="top" class="td11"&gt;
        &lt;p class="p3"&gt;&lt;br&gt;&lt;/p&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td valign="top" class="td9"&gt;
        &lt;p class="p2"&gt;&lt;span class="s1"&gt;mail&lt;/span&gt;&lt;/p&gt;
      &lt;/td&gt;
      &lt;td valign="top" class="td10"&gt;
        &lt;p class="p2"&gt;&lt;span class="s1"&gt;user_email&lt;/span&gt;&lt;/p&gt;
      &lt;/td&gt;
      &lt;td valign="top" class="td11"&gt;
        &lt;p class="p3"&gt;&lt;br&gt;&lt;/p&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td valign="top" class="td9"&gt;
        &lt;p class="p2"&gt;&lt;span class="s1"&gt;created&lt;/span&gt;&lt;/p&gt;
      &lt;/td&gt;
      &lt;td valign="top" class="td10"&gt;
        &lt;p class="p2"&gt;&lt;span class="s1"&gt;user_registered&lt;/span&gt;&lt;/p&gt;
      &lt;/td&gt;
      &lt;td valign="top" class="td11"&gt;
        &lt;p class="p2"&gt;&lt;span class="s1"&gt;Formatted from UNIX time&lt;/span&gt;&lt;/p&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td valign="top" class="td12"&gt;
        &lt;p class="p2"&gt;&lt;span class="s1"&gt;name&lt;/span&gt;&lt;/p&gt;
      &lt;/td&gt;
      &lt;td valign="top" class="td10"&gt;
        &lt;p class="p2"&gt;&lt;span class="s1"&gt;display_name&lt;/span&gt;&lt;/p&gt;
      &lt;/td&gt;
      &lt;td valign="top" class="td11"&gt;
        &lt;p class="p3"&gt;&lt;br&gt;&lt;/p&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td valign="top" class="td13"&gt;
        &lt;p class="p3"&gt;&lt;br&gt;&lt;/p&gt;
      &lt;/td&gt;
      &lt;td valign="top" class="td14"&gt;
        &lt;p class="p2"&gt;&lt;span class="s1"&gt;user_status&lt;/span&gt;&lt;/p&gt;
      &lt;/td&gt;
      &lt;td valign="top" class="td6"&gt;
        &lt;p class="p2"&gt;&lt;span class="s1"&gt;Whitespace string&lt;/span&gt;&lt;/p&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td valign="top" class="td15"&gt;
        &lt;p class="p3"&gt;&lt;br&gt;&lt;/p&gt;
      &lt;/td&gt;
      &lt;td valign="top" class="td16"&gt;
        &lt;p class="p2"&gt;&lt;span class="s1"&gt;user_activation_key&lt;/span&gt;&lt;/p&gt;
      &lt;/td&gt;
      &lt;td valign="top" class="td11"&gt;
        &lt;p class="p2"&gt;&lt;span class="s1"&gt;Set to 0&lt;/span&gt;&lt;/p&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
 &lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;

&lt;h2&gt;Table mapping for WordPress user meta values&lt;/h2&gt;

User information like capabilities and roles in the &lt;em&gt;wp_usermeta&lt;/em&gt; table.

&lt;table cellspacing="0" cellpadding="0" class="t1"&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td valign="top" class="td4"&gt;
        &lt;p class="p2"&gt;&lt;span class="s1"&gt;&lt;b&gt;users&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;
      &lt;/td&gt;
      &lt;td valign="top" class="td5"&gt;
        &lt;p class="p2"&gt;&lt;span class="s1"&gt;&lt;b&gt;wp_usermeta&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;
      &lt;/td&gt;
      &lt;td valign="top" class="td6"&gt;
        &lt;p class="p3"&gt;&lt;br&gt;&lt;/p&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td valign="top" class="td20"&gt;
        &lt;p class="p2"&gt;&lt;span class="s1"&gt;uid&lt;/span&gt;&lt;/p&gt;
      &lt;/td&gt;
      &lt;td valign="top" class="td8"&gt;
        &lt;p class="p2"&gt;&lt;span class="s1"&gt;user_id&lt;/span&gt;&lt;/p&gt;
      &lt;/td&gt;
      &lt;td valign="top" class="td6"&gt;
        &lt;p class="p3"&gt;&lt;br&gt;&lt;/p&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td valign="top" class="td13"&gt;
        &lt;p class="p3"&gt;&lt;br&gt;&lt;/p&gt;
      &lt;/td&gt;
      &lt;td valign="top" class="td14"&gt;
        &lt;p class="p2"&gt;&lt;span class="s1"&gt;meta_key&lt;/span&gt;&lt;/p&gt;
      &lt;/td&gt;
      &lt;td valign="top" class="td6"&gt;
        &lt;p class="p2"&gt;&lt;span class="s1"&gt;Set to string e.g. 'wp_capabilities'&lt;/span&gt;&lt;/p&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td valign="top" class="td15"&gt;
        &lt;p class="p3"&gt;&lt;br&gt;&lt;/p&gt;
      &lt;/td&gt;
      &lt;td valign="top" class="td16"&gt;
        &lt;p class="p2"&gt;&lt;span class="s1"&gt;meta_value&lt;/span&gt;&lt;/p&gt;
      &lt;/td&gt;
      &lt;td valign="top" class="td11"&gt;
        &lt;p class="p2"&gt;&lt;span class="s1"&gt;Set to string e.g. 'a:1:{s:6:"author";s:1:"1";}'&lt;/span&gt;&lt;/p&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;


More information about the settings for appropriate &lt;em&gt;meta_key&lt;/em&gt; and &lt;em&gt;meta_value&lt;/em&gt; can be found in the WordPress Codex:
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://codex.wordpress.org/Roles_and_Capabilities"&gt;Roles and Capabilities&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://codex.wordpress.org/User_Levels"&gt;User Levels&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;Node authors and comment authors&lt;/h2&gt;

Drupal stores both node authors and comment authors in the &lt;em&gt;users&lt;/em&gt; table. WordPress handles things differently. Page and post authors are stored in the &lt;em&gt;wp_users&lt;/em&gt; table but comment authors are stored in &lt;em&gt;wp_comments&lt;/em&gt; together with the comment data.


  &lt;style type="text/css"&gt;
    p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; min-height: 14.0px}
    p.p2 {margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Helvetica; -webkit-text-stroke: #000000}
    p.p3 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; -webkit-text-stroke: #000000; min-height: 14.0px}
    span.s1 {font-kerning: none}
    table.t1 {border-collapse: collapse}
    td.td1 {width: 80.0px; height: 12.0px; border: none; padding: 4.0px 4.0px 4.0px 4.0px}
    td.td2 {width: 120.0px; height: 12.0px; border-style: solid; border-width: 0.0px 0.0px 1.0px 0.0px; border-color: transparent transparent #515151 transparent; padding: 4.0px 4.0px 4.0px 4.0px}
    td.td3 {width: 256.0px; height: 12.0px; padding: 4.0px 4.0px 4.0px 4.0px; border: none}
    td.td4 {width: 79.0px; height: 12.0px; background-color: #bfbfbf; border-style: solid; border-width: 1.0px 1.0px 1.0px 1.0px; border-color: #515151 #515151 #515151 #515151; padding: 4.0px 4.0px 4.0px 4.0px}
    td.td5 {width: 119.0px; height: 12.0px; background-color: #bfbfbf; border-style: solid; border-width: 1.0px 1.0px 1.0px 1.0px; border-color: #515151 #515151 #515151 #515151; padding: 4.0px 4.0px 4.0px 4.0px}
    td.td6 {width: 256.0px; height: 13.0px; border-style: solid; border-width: 0.0px 0.0px 0.0px 1.0px; border-color: transparent transparent transparent #515151; padding: 4.0px 4.0px 4.0px 4.0px}
    td.td7 {width: 79.0px; height: 12.0px; border-style: solid; border-width: 1.0px 1.0px 0.0px 1.0px; border-color: #515151 #515151 transparent #515151; padding: 4.0px 4.0px 4.0px 4.0px}
    td.td8 {width: 119.0px; height: 12.0px; border-style: solid; border-width: 1.0px 1.0px 0.0px 1.0px; border-color: #515151 #515151 transparent #515151; padding: 4.0px 4.0px 4.0px 4.0px}
    td.td9 {width: 79.0px; height: 12.0px; border-style: solid; border-width: 0.0px 1.0px 0.0px 1.0px; border-color: transparent #515151 transparent #515151; padding: 4.0px 4.0px 4.0px 4.0px}
    td.td10 {width: 119.0px; height: 12.0px; border-style: solid; border-width: 0.0px 1.0px 0.0px 1.0px; border-color: transparent #515151 transparent #515151; padding: 4.0px 4.0px 4.0px 4.0px}
    td.td11 {width: 256.0px; height: 12.0px; border-style: solid; border-width: 0.0px 0.0px 0.0px 1.0px; border-color: transparent transparent transparent #515151; padding: 4.0px 4.0px 4.0px 4.0px}
    td.td12 {width: 79.0px; height: 12.0px; border-style: solid; border-width: 0.0px 1.0px 1.0px 1.0px; border-color: transparent #515151 #515151 #515151; padding: 4.0px 4.0px 4.0px 4.0px}
    td.td13 {width: 79.0px; height: 12.0px; border-style: solid; border-width: 1.0px 1.0px 0.0px 0.0px; border-color: #515151 #515151 transparent transparent; padding: 4.0px 4.0px 4.0px 4.0px}
    td.td14 {width: 119.0px; height: 13.0px; border-style: solid; border-width: 0.0px 1.0px 0.0px 1.0px; border-color: transparent #515151 transparent #515151; padding: 4.0px 4.0px 4.0px 4.0px}
    td.td15 {width: 79.0px; height: 12.0px; border-style: solid; border-width: 0.0px 1.0px 0.0px 0.0px; border-color: transparent #515151 transparent transparent; padding: 4.0px 4.0px 4.0px 4.0px}
    td.td16 {width: 119.0px; height: 12.0px; border-style: solid; border-width: 0.0px 1.0px 1.0px 1.0px; border-color: transparent #515151 #515151 #515151; padding: 4.0px 4.0px 4.0px 4.0px}
    td.td17 {width: 80.0px; height: 13.0px; padding: 4.0px 4.0px 4.0px 4.0px}
    td.td18 {width: 120.0px; height: 12.0px; border-style: solid; border-width: 1.0px 0.0px 0.0px 0.0px; border-color: #515151 transparent transparent transparent; padding: 4.0px 4.0px 4.0px 4.0px}
    td.td19 {width: 256.0px; height: 13.0px; padding: 4.0px 4.0px 4.0px 4.0px}
    td.td20 {width: 79.0px; height: 12.0px; border-style: solid; border-width: 1.0px 1.0px 1.0px 1.0px; border-color: #515151 #515151 #515151 #515151; padding: 4.0px 4.0px 4.0px 4.0px}
  &lt;/style&gt;</description><category>drupal</category><category>migration</category><category>scripts</category><category>sql</category><category>wordpress</category><guid>https://migratecontent.com/drupal-to-wordpress-migration-user-table-mapping/</guid><pubDate>Tue, 20 Jan 2015 11:01:06 GMT</pubDate></item><item><title>Drupal to WordPress migration: comments table mapping</title><link>https://migratecontent.com/drupal-to-wordpress-migration-comments-table-mapping/</link><dc:creator>Anthony Lopez-Vito</dc:creator><description>This is part three of a series of posts documenting the table mappings for a &lt;a href="https://migratecontent.com" title="Drupal to WordPress migration service"&gt;site migration&lt;/a&gt; from Drupal 6 to WordPress 3. For more information, please see the &lt;a href="https://migratecontent.com/drupal-to-wordpress-migration-posts-table-mapping/"&gt;first article&lt;/a&gt; in the series.

&lt;h2&gt;Table mapping for WordPress comments&lt;/h2&gt;

&lt;table cellspacing="0" cellpadding="0" class="t1"&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td valign="top" class="td1"&gt;
        &lt;p class="p2"&gt;&lt;span class="s1"&gt;&lt;b&gt;Drupal 6.x&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;
      &lt;/td&gt;
      &lt;td valign="top" class="td2"&gt;
        &lt;p class="p2"&gt;&lt;span class="s1"&gt;&lt;b&gt;WordPress 3.x&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;
      &lt;/td&gt;
      &lt;td valign="top" class="td3"&gt;
        &lt;p class="p2"&gt;&lt;span class="s1"&gt;&lt;b&gt;Notes&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td valign="top" class="td4"&gt;
        &lt;p class="p2"&gt;&lt;span class="s1"&gt;&lt;b&gt;comments&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;
      &lt;/td&gt;
      &lt;td valign="top" class="td5"&gt;
        &lt;p class="p2"&gt;&lt;span class="s1"&gt;&lt;b&gt;wp_posts&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;
      &lt;/td&gt;
      &lt;td valign="top" class="td6"&gt;
        &lt;p class="p3"&gt;&lt;br&gt;&lt;/p&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td valign="top" class="td7"&gt;
        &lt;p class="p2"&gt;&lt;span class="s1"&gt;cid&lt;/span&gt;&lt;/p&gt;
      &lt;/td&gt;
      &lt;td valign="top" class="td8"&gt;
        &lt;p class="p2"&gt;&lt;span class="s1"&gt;comment_ID&lt;/span&gt;&lt;/p&gt;
      &lt;/td&gt;
      &lt;td valign="top" class="td6"&gt;
        &lt;p class="p3"&gt;&lt;br&gt;&lt;/p&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td valign="top" class="td9"&gt;
        &lt;p class="p2"&gt;&lt;span class="s1"&gt;nid&lt;/span&gt;&lt;/p&gt;
      &lt;/td&gt;
      &lt;td valign="top" class="td10"&gt;
        &lt;p class="p2"&gt;&lt;span class="s1"&gt;comment_post_ID&lt;/span&gt;&lt;/p&gt;
      &lt;/td&gt;
      &lt;td valign="top" class="td11"&gt;
        &lt;p class="p3"&gt;&lt;br&gt;&lt;/p&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td valign="top" class="td9"&gt;
        &lt;p class="p2"&gt;&lt;span class="s1"&gt;timestamp&lt;/span&gt;&lt;/p&gt;
      &lt;/td&gt;
      &lt;td valign="top" class="td10"&gt;
        &lt;p class="p2"&gt;&lt;span class="s1"&gt;comment_date&lt;/span&gt;&lt;/p&gt;
      &lt;/td&gt;
      &lt;td valign="top" class="td11"&gt;
        &lt;p class="p2"&gt;&lt;span class="s1"&gt;Converted from UNIX timestamp&lt;/span&gt;&lt;/p&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td valign="top" class="td9"&gt;
        &lt;p class="p2"&gt;&lt;span class="s1"&gt;comment&lt;/span&gt;&lt;/p&gt;
      &lt;/td&gt;
      &lt;td valign="top" class="td10"&gt;
        &lt;p class="p2"&gt;&lt;span class="s1"&gt;comment_content&lt;/span&gt;&lt;/p&gt;
      &lt;/td&gt;
      &lt;td valign="top" class="td11"&gt;
        &lt;p class="p3"&gt;&lt;br&gt;&lt;/p&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td valign="top" class="td9"&gt;
        &lt;p class="p2"&gt;&lt;span class="s1"&gt;pid&lt;/span&gt;&lt;/p&gt;
      &lt;/td&gt;
      &lt;td valign="top" class="td10"&gt;
        &lt;p class="p2"&gt;&lt;span class="s1"&gt;comment_parent&lt;/span&gt;&lt;/p&gt;
      &lt;/td&gt;
      &lt;td valign="top" class="td11"&gt;
        &lt;p class="p3"&gt;&lt;br&gt;&lt;/p&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td valign="top" class="td9"&gt;
        &lt;p class="p2"&gt;&lt;span class="s1"&gt;name&lt;/span&gt;&lt;/p&gt;
      &lt;/td&gt;
      &lt;td valign="top" class="td10"&gt;
        &lt;p class="p2"&gt;&lt;span class="s1"&gt;comment_author&lt;/span&gt;&lt;/p&gt;
      &lt;/td&gt;
      &lt;td valign="top" class="td11"&gt;
        &lt;p class="p3"&gt;&lt;br&gt;&lt;/p&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td valign="top" class="td9"&gt;
        &lt;p class="p2"&gt;&lt;span class="s1"&gt;mail&lt;/span&gt;&lt;/p&gt;
      &lt;/td&gt;
      &lt;td valign="top" class="td10"&gt;
        &lt;p class="p2"&gt;&lt;span class="s1"&gt;comment_author_email&lt;/span&gt;&lt;/p&gt;
      &lt;/td&gt;
      &lt;td valign="top" class="td11"&gt;
        &lt;p class="p3"&gt;&lt;br&gt;&lt;/p&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td valign="top" class="td9"&gt;
        &lt;p class="p2"&gt;&lt;span class="s1"&gt;homepage&lt;/span&gt;&lt;/p&gt;
      &lt;/td&gt;
      &lt;td valign="top" class="td10"&gt;
        &lt;p class="p2"&gt;&lt;span class="s1"&gt;comment_author_url&lt;/span&gt;&lt;/p&gt;
      &lt;/td&gt;
      &lt;td valign="top" class="td11"&gt;
        &lt;p class="p2"&gt;&lt;span class="s1"&gt;Truncated to WordPress limit of 200 chars&lt;/span&gt;&lt;/p&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td valign="top" class="td12"&gt;
        &lt;p class="p2"&gt;&lt;span class="s1"&gt;status&lt;/span&gt;&lt;/p&gt;
      &lt;/td&gt;
      &lt;td valign="top" class="td13"&gt;
        &lt;p class="p2"&gt;&lt;span class="s1"&gt;comment_approved&lt;/span&gt;&lt;/p&gt;
      &lt;/td&gt;
      &lt;td valign="top" class="td11"&gt;
        &lt;p class="p3"&gt;&lt;br&gt;&lt;/p&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;h2&gt;Comment authors&lt;/h2&gt;
A note about the different ways Drupal and WordPress store comment author information: Drupal stores comment authors in its &lt;em&gt;users&lt;/em&gt; table alongside site users like node authors. In WordPress, comment authors are stored in its &lt;em&gt;wp_comments&lt;/em&gt; together with the comment data. WordPress comment authors are not entered into the &lt;em&gt;wp_users&lt;/em&gt; table.


  &lt;style type="text/css" scoped&gt;
    p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; min-height: 14.0px}
    p.p2 {margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Helvetica; -webkit-text-stroke: #000000}
    p.p3 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; -webkit-text-stroke: #000000; min-height: 14.0px}
    span.s1 {font-kerning: none}
    table.t1 {border-collapse: collapse}
    td.td1 {width: 80.5px; height: 12.5px; padding: 4.0px 4.0px 4.0px 4.0px; border: none}
    td.td2 {width: 120.0px; height: 12.0px; border-style: solid; border-width: 0.0px 0.0px 1.0px 0.0px; border-color: transparent transparent #515151 transparent; padding: 4.0px 4.0px 4.0px 4.0px}
    td.td3 {width: 189.0px; height: 12.0px; padding: 4.0px 4.0px 4.0px 4.0px; border: none}
    td.td4 {width: 79.0px; height: 12.0px; background-color: #bfbfbf; border-style: solid; border-width: 1.0px 1.0px 1.0px 1.0px; border-color: #515151 #515151 #515151 #515151; padding: 4.0px 4.0px 4.0px 4.0px}
    td.td5 {width: 119.0px; height: 12.0px; background-color: #bfbfbf; border-style: solid; border-width: 1.0px 1.0px 1.0px 1.0px; border-color: #515151 #515151 #515151 #515151; padding: 4.0px 4.0px 4.0px 4.0px}
    td.td6 {width: 189.0px; height: 13.0px; border-style: solid; border-width: 0.0px 0.0px 0.0px 1.0px; border-color: transparent transparent transparent #515151; padding: 4.0px 4.0px 4.0px 4.0px}
    td.td7 {width: 79.0px; height: 12.0px; border-style: solid; border-width: 1.0px 1.0px 0.0px 1.0px; border-color: #515151 #515151 transparent #515151; padding: 4.0px 4.0px 4.0px 4.0px}
    td.td8 {width: 119.0px; height: 12.0px; border-style: solid; border-width: 1.0px 1.0px 0.0px 1.0px; border-color: #515151 #515151 transparent #515151; padding: 4.0px 4.0px 4.0px 4.0px}
    td.td9 {width: 79.0px; height: 12.0px; border-style: solid; border-width: 0.0px 1.0px 0.0px 1.0px; border-color: transparent #515151 transparent #515151; padding: 4.0px 4.0px 4.0px 4.0px}
    td.td10 {width: 119.0px; height: 12.0px; border-style: solid; border-width: 0.0px 1.0px 0.0px 1.0px; border-color: transparent #515151 transparent #515151; padding: 4.0px 4.0px 4.0px 4.0px}
    td.td11 {width: 189.0px; height: 12.0px; border-style: solid; border-width: 0.0px 0.0px 0.0px 1.0px; border-color: transparent transparent transparent #515151; padding: 4.0px 4.0px 4.0px 4.0px}
    td.td12 {width: 79.0px; height: 12.0px; border-style: solid; border-width: 0.0px 1.0px 1.0px 1.0px; border-color: transparent #515151 #515151 #515151; padding: 4.0px 4.0px 4.0px 4.0px}
    td.td13 {width: 119.0px; height: 12.0px; border-style: solid; border-width: 0.0px 1.0px 1.0px 1.0px; border-color: transparent #515151 #515151 #515151; padding: 4.0px 4.0px 4.0px 4.0px}
  &lt;/style&gt;</description><category>drupal</category><category>migration</category><category>scripts</category><category>sql</category><category>wordpress</category><guid>https://migratecontent.com/drupal-to-wordpress-migration-comments-table-mapping/</guid><pubDate>Wed, 29 Oct 2014 23:33:09 GMT</pubDate></item><item><title>Drupal to WordPress migration: terms table mapping</title><link>https://migratecontent.com/drupal-to-wordpress-migration-terms-table-mapping/</link><dc:creator>Anthony Lopez-Vito</dc:creator><description>This is part two of a series of posts documenting the table mappings for a &lt;a href="https://migratecontent.com" title="Drupal to WordPress migration service"&gt;site migration&lt;/a&gt; from Drupal 6 to WordPress 3. For more information, please see the &lt;a href="https://migratecontent.com/drupal-to-wordpress-migration-posts-table-mapping/"&gt;first article&lt;/a&gt; in the series.

&lt;h2&gt;Table mapping for WordPress terms&lt;/h2&gt;

This table mapping exports the Drupal terms into WordPress.

&lt;table cellspacing="0" cellpadding="0" class="t1"&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td valign="top" class="td1"&gt;
        &lt;p class="p2"&gt;&lt;span class="s1"&gt;&lt;b&gt;Drupal 6.x&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;
      &lt;/td&gt;
      &lt;td valign="top" class="td2"&gt;
        &lt;p class="p2"&gt;&lt;span class="s1"&gt;&lt;b&gt;WordPress 3.x&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;
      &lt;/td&gt;
      &lt;td valign="top" class="td3"&gt;
        &lt;p class="p2"&gt;&lt;span class="s1"&gt;&lt;b&gt;Notes&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td valign="top" class="td4"&gt;
        &lt;p class="p2"&gt;&lt;span class="s1"&gt;&lt;b&gt;term_data&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;
      &lt;/td&gt;
      &lt;td valign="top" class="td5"&gt;
        &lt;p class="p2"&gt;&lt;span class="s1"&gt;&lt;b&gt;wp_terms&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;
      &lt;/td&gt;
      &lt;td valign="top" class="td6"&gt;
        &lt;p class="p3"&gt;&lt;br&gt;&lt;/p&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td valign="top" class="td7"&gt;
        &lt;p class="p2"&gt;&lt;span class="s1"&gt;tid&lt;/span&gt;&lt;/p&gt;
      &lt;/td&gt;
      &lt;td valign="top" class="td8"&gt;
        &lt;p class="p2"&gt;&lt;span class="s1"&gt;term_id&lt;/span&gt;&lt;/p&gt;
      &lt;/td&gt;
      &lt;td valign="top" class="td9"&gt;
        &lt;p class="p3"&gt;&lt;br&gt;&lt;/p&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td valign="top" class="td7"&gt;
        &lt;p class="p2"&gt;&lt;span class="s1"&gt;name&lt;/span&gt;&lt;/p&gt;
      &lt;/td&gt;
      &lt;td valign="top" class="td8"&gt;
        &lt;p class="p2"&gt;&lt;span class="s1"&gt;name&lt;/span&gt;&lt;/p&gt;
      &lt;/td&gt;
      &lt;td valign="top" class="td9"&gt;
        &lt;p class="p3"&gt;&lt;br&gt;&lt;/p&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td valign="top" class="td10"&gt;
        &lt;p class="p4"&gt;&lt;span class="s1"&gt;name&lt;/span&gt;&lt;/p&gt;
      &lt;/td&gt;
      &lt;td valign="top" class="td11"&gt;
        &lt;p class="p2"&gt;&lt;span class="s1"&gt;slug&lt;/span&gt;&lt;/p&gt;
      &lt;/td&gt;
      &lt;td valign="top" class="td12"&gt;
        &lt;p class="p2"&gt;&lt;span class="s1"&gt;Make lower case and convert spaces to underscores&lt;/span&gt;&lt;/p&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td valign="top" class="td13"&gt;
        &lt;p class="p2"&gt;&lt;span class="s1"&gt;vid&lt;/span&gt;&lt;/p&gt;
      &lt;/td&gt;
      &lt;td valign="top" class="td14"&gt;
        &lt;p class="p2"&gt;&lt;span class="s1"&gt;term_group&lt;/span&gt;&lt;/p&gt;
      &lt;/td&gt;
      &lt;td valign="top" class="td9"&gt;
        &lt;p class="p2"&gt;&lt;span class="s1"&gt;Not used in a default WordPress installation&lt;/span&gt;&lt;/p&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td valign="top" class="td15"&gt;
        &lt;p class="p3"&gt;&lt;br&gt;&lt;/p&gt;
      &lt;/td&gt;
      &lt;td valign="top" class="td16"&gt;
        &lt;p class="p3"&gt;&lt;br&gt;&lt;/p&gt;
      &lt;/td&gt;
      &lt;td valign="top" class="td17"&gt;
        &lt;p class="p3"&gt;&lt;br&gt;&lt;/p&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td valign="top" class="td4"&gt;
        &lt;p class="p2"&gt;&lt;span class="s1"&gt;&lt;b&gt;term_data&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;
      &lt;/td&gt;
      &lt;td valign="top" class="td5"&gt;
        &lt;p class="p2"&gt;&lt;span class="s1"&gt;&lt;b&gt;wp_term_taxonomy&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;
      &lt;/td&gt;
      &lt;td valign="top" class="td6"&gt;
        &lt;p class="p3"&gt;&lt;br&gt;&lt;/p&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td valign="top" class="td7"&gt;
        &lt;p class="p2"&gt;&lt;span class="s1"&gt;tid&lt;/span&gt;&lt;/p&gt;
      &lt;/td&gt;
      &lt;td valign="top" class="td8"&gt;
        &lt;p class="p2"&gt;&lt;span class="s1"&gt;term_taxonomy_id&lt;/span&gt;&lt;/p&gt;
      &lt;/td&gt;
      &lt;td valign="top" class="td9"&gt;
        &lt;p class="p3"&gt;&lt;br&gt;&lt;/p&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td valign="top" class="td7"&gt;
        &lt;p class="p4"&gt;&lt;span class="s1"&gt;tid&lt;/span&gt;&lt;/p&gt;
      &lt;/td&gt;
      &lt;td valign="top" class="td8"&gt;
        &lt;p class="p2"&gt;&lt;span class="s1"&gt;term_id&lt;/span&gt;&lt;/p&gt;
      &lt;/td&gt;
      &lt;td valign="top" class="td9"&gt;
        &lt;p class="p3"&gt;&lt;br&gt;&lt;/p&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td valign="top" class="td7"&gt;
        &lt;p class="p3"&gt;&lt;br&gt;&lt;/p&gt;
      &lt;/td&gt;
      &lt;td valign="top" class="td8"&gt;
        &lt;p class="p2"&gt;&lt;span class="s1"&gt;taxonomy&lt;/span&gt;&lt;/p&gt;
      &lt;/td&gt;
      &lt;td valign="top" class="td9"&gt;
        &lt;p class="p2"&gt;&lt;span class="s1"&gt;String: ‘post_tag’ or ‘category’&lt;/span&gt;&lt;/p&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td valign="top" class="td13"&gt;
        &lt;p class="p2"&gt;&lt;span class="s1"&gt;description&lt;/span&gt;&lt;/p&gt;
      &lt;/td&gt;
      &lt;td valign="top" class="td8"&gt;
        &lt;p class="p2"&gt;&lt;span class="s1"&gt;description&lt;/span&gt;&lt;/p&gt;
      &lt;/td&gt;
      &lt;td valign="top" class="td9"&gt;
        &lt;p class="p3"&gt;&lt;br&gt;&lt;/p&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td valign="top" class="td18"&gt;
        &lt;p class="p3"&gt;&lt;br&gt;&lt;/p&gt;
      &lt;/td&gt;
      &lt;td valign="top" class="td19"&gt;
        &lt;p class="p2"&gt;&lt;span class="s1"&gt;parent&lt;/span&gt;&lt;/p&gt;
      &lt;/td&gt;
      &lt;td valign="top" class="td6"&gt;
        &lt;p class="p2"&gt;&lt;span class="s1"&gt;0 (No parent)&lt;/span&gt;&lt;/p&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

In the &lt;a href="https://codex.wordpress.org/WordPress_Taxonomy"&gt;WordPress Taxonomy documentation&lt;/a&gt;, &lt;em&gt;"term_group is a means of grouping together similar terms."&lt;/em&gt; During a standard migration, the WordPress term_group is set to the Drupal vocabulary ID, which seems to make sense. Nevertheless, a default WordPress installation does not actually use the value for anything. It may have been included by the developers for future expandability or use by plugins.

&lt;em&gt;term_group=0&lt;/em&gt; is the default value when creating a term using the Drupal user interface.

Below, we associate posts with the newly migrated terms.

&lt;table cellspacing="0" cellpadding="0" class="t1b"&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td valign="top" class="td1b"&gt;
        &lt;p class="p2b"&gt;&lt;span class="s1b"&gt;&lt;b&gt;Drupal 6.x&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;
      &lt;/td&gt;
      &lt;td valign="top" class="td2b"&gt;
        &lt;p class="p2b"&gt;&lt;span class="s1b"&gt;&lt;b&gt;WordPress 3.x&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td valign="top" class="td3b"&gt;
        &lt;p class="p2b"&gt;&lt;span class="s1b"&gt;&lt;b&gt;term_node&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;
      &lt;/td&gt;
      &lt;td valign="top" class="td4"&gt;
        &lt;p class="p2b"&gt;&lt;span class="s1b"&gt;&lt;b&gt;wp_term_relationships&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td valign="top" class="td5b"&gt;
        &lt;p class="p2b"&gt;&lt;span class="s1b"&gt;nid&lt;/span&gt;&lt;/p&gt;
      &lt;/td&gt;
      &lt;td valign="top" class="td6b"&gt;
        &lt;p class="p2b"&gt;&lt;span class="s1b"&gt;object_id&lt;/span&gt;&lt;/p&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td valign="top" class="td7b"&gt;
        &lt;p class="p2b"&gt;&lt;span class="s1b"&gt;tid&lt;/span&gt;&lt;/p&gt;
      &lt;/td&gt;
      &lt;td valign="top" class="td8b"&gt;
        &lt;p class="p2b"&gt;&lt;span class="s1b"&gt;term_taxonomy_id&lt;/span&gt;&lt;/p&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

  &lt;style type="text/css" scoped&gt;
    p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; min-height: 14.0px}
    p.p2 {margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Helvetica; -webkit-text-stroke: #000000}
    p.p3 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; -webkit-text-stroke: #000000; min-height: 14.0px}
    p.p4 {margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Helvetica; color: #7f7f7f; -webkit-text-stroke: #7f7f7f}
    span.s1 {font-kerning: none}
    table.t1 {border: none}
    td.td1 {width: 80.0px; height: 12.0px; border-style: solid; border-width: 0.0px 0.0px 1.0px 1.0px; border: none; padding: 4.0px 4.0px 4.0px 4.0px}
    td.td2 {width: 102.0px; height: 12.0px; border-style: solid; border-width: 0.0px 0.0px 1.0px 0.0px; border-color: transparent transparent #515151 transparent; padding: 4.0px 4.0px 4.0px 4.0px}
    td.td3 {width: 161.0px; height: 12.0px; padding: 4.0px 4.0px 4.0px 4.0px; border: none}
    td.td4 {width: 79.0px; height: 12.0px; background-color: #bfbfbf; border-style: solid; border-width: 1.0px 1.0px 0.0px 1.0px; border-color: #515151 #515151 transparent #515151; padding: 4.0px 4.0px 4.0px 4.0px}
    td.td5 {width: 101.0px; height: 12.0px; background-color: #bfbfbf; border-style: solid; border-width: 1.0px 1.0px 0.0px 1.0px; border-color: #515151 #515151 transparent #515151; padding: 4.0px 4.0px 4.0px 4.0px}
    td.td6 {width: 161.0px; height: 13.0px; border-style: solid; border-width: 0.0px 0.0px 0.0px 1.0px; border-color: transparent transparent transparent #515151; padding: 4.0px 4.0px 4.0px 4.0px}
    td.td7 {width: 79.0px; height: 12.0px; border-style: solid; border-width: 0.0px 1.0px 0.0px 1.0px; border-color: transparent #515151 transparent #515151; padding: 4.0px 4.0px 4.0px 4.0px}
    td.td8 {width: 101.0px; height: 12.0px; border-style: solid; border-width: 0.0px 1.0px 0.0px 1.0px; border-color: transparent #515151 transparent #515151; padding: 4.0px 4.0px 4.0px 4.0px}
    td.td9 {width: 161.0px; height: 12.0px; border-style: solid; border-width: 0.0px 0.0px 0.0px 1.0px; border-color: transparent transparent transparent #515151; padding: 4.0px 4.0px 4.0px 4.0px}
    td.td10 {width: 79.0px; height: 24.0px; border-style: solid; border-width: 0.0px 1.0px 0.0px 1.0px; border-color: transparent #515151 transparent #515151; padding: 4.0px 4.0px 4.0px 4.0px}
    td.td11 {width: 101.0px; height: 24.0px; border-style: solid; border-width: 0.0px 1.0px 0.0px 1.0px; border-color: transparent #515151 transparent #515151; padding: 4.0px 4.0px 4.0px 4.0px}
    td.td12 {width: 161.0px; height: 24.0px; border-style: solid; border-width: 0.0px 0.0px 0.0px 1.0px; border-color: transparent transparent transparent #515151; padding: 4.0px 4.0px 4.0px 4.0px}
    td.td13 {width: 79.0px; height: 12.0px; border-style: solid; border-width: 0.0px 1.0px 1.0px 1.0px; border-color: transparent #515151 #515151 #515151; padding: 4.0px 4.0px 4.0px 4.0px}
    td.td14 {width: 101.0px; height: 12.0px; border-style: solid; border-width: 0.0px 1.0px 1.0px 1.0px; border-color: transparent #515151 #515151 #515151; padding: 4.0px 4.0px 4.0px 4.0px}
    td.td15 {width: 80.0px; height: 12.0px; border-style: solid; border-width: 1.0px 0.0px 1.0px 0.0px; border-color: #515151 transparent #515151 transparent; padding: 4.0px 4.0px 4.0px 4.0px}
    td.td16 {width: 102.0px; height: 12.0px; border-style: solid; border-width: 1.0px 0.0px 1.0px 0.0px; border-color: #515151 transparent #515151 transparent; padding: 4.0px 4.0px 4.0px 4.0px}
    td.td17 {width: 161.0px; height: 13.0px; padding: 4.0px 4.0px 4.0px 4.0px; border: none}
    td.td18 {width: 79.0px; height: 12.0px; border-style: solid; border-width: 1.0px 1.0px 1.0px 0.0px; padding: 4.0px 4.0px 4.0px 4.0px; border: none}
    td.td19 {width: 101.0px; height: 13.0px; border-style: solid; border-width: 0.0px 1.0px 1.0px 1.0px; border-color: transparent #515151 #515151 #515151; padding: 4.0px 4.0px 4.0px 4.0px}


    p.p1b {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; min-height: 14.0px}
    p.p2b {margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Helvetica; -webkit-text-stroke: #000000}
    p.p3b {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; -webkit-text-stroke: #000000; min-height: 14.0px}
    span.s1b {font-kerning: none}
    table.t1b {border-collapse: collapse}
    td.td1b {width: 80.0px; height: 12.0px; border-style: solid; border-width: 0.0px 0.0px 1.0px 1.0px; border: none; padding: 4.0px 4.0px 4.0px 4.0px}
    td.td2b {width: 90.0px; height: 12.0px; border-style: solid; border-width: 0.0px 0.0px 1.0px 0.0px; border-color: transparent transparent #515151 transparent; padding: 4.0px 4.0px 4.0px 4.0px}
    td.td3b {width: 79.0px; height: 12.0px; background-color: #bfbfbf; border-style: solid; border-width: 1.0px 1.0px 0.0px 1.0px; border-color: #515151 #515151 transparent #515151; padding: 4.0px 4.0px 4.0px 4.0px}
    td.td4b {width: 90px; height: 12.0px; background-color: #bfbfbf; border-style: solid; border-width: 1.0px 1.0px 0.0px 1.0px; border-color: #515151 #515151 transparent #515151; padding: 4.0px 4.0px 4.0px 4.0px}
    td.td5b {width: 79.0px; height: 12.0px; border-style: solid; border-width: 0.0px 1.0px 0.0px 1.0px; border-color: transparent #515151 transparent #515151; padding: 4.0px 4.0px 4.0px 4.0px}
    td.td6b {width: 90px; height: 12.0px; border-style: solid; border-width: 0.0px 1.0px 0.0px 1.0px; border-color: transparent #515151 transparent #515151; padding: 4.0px 4.0px 4.0px 4.0px}
    td.td7b {width: 79.0px; height: 12.0px; border-style: solid; border-width: 0.0px 1.0px 1.0px 1.0px; border-color: transparent #515151 #515151 #515151; padding: 4.0px 4.0px 4.0px 4.0px}
    td.td8b {width: 90px; height: 12.0px; border-style: solid; border-width: 0.0px 1.0px 1.0px 1.0px; border-color: transparent #515151 #515151 #515151; padding: 4.0px 4.0px 4.0px 4.0px}
  &lt;/style&gt;</description><category>drupal</category><category>migration</category><category>scripts</category><category>sql</category><category>wordpress</category><guid>https://migratecontent.com/drupal-to-wordpress-migration-terms-table-mapping/</guid><pubDate>Sat, 30 Aug 2014 12:54:12 GMT</pubDate></item><item><title>Drupal to WordPress migration table mapping</title><link>https://migratecontent.com/drupal-to-wordpress-migration-table-mapping/</link><dc:creator>Anthony Lopez-Vito</dc:creator><description>&lt;p&gt;Following on from &lt;a href="https://migratecontent.com/drupal-to-wordpress-migration-sql-queries-explained/"&gt;Drupal to WordPress migration explained&lt;/a&gt;, this post documents the table mappings for a &lt;a href="https://migratecontent.com/drupal-to-wordpress-migration-service/" title="Drupal to WordPress migration service"&gt;site migration&lt;/a&gt; from Drupal 6.x to WordPress 3.x.&lt;/p&gt;
&lt;p&gt;To read the mapping, you look up the Drupal table on the left listing the fields we use for a migration. Directly to its right is the WordPress table with the corresponding field in the same row. So for example, the &lt;em&gt;nid&lt;/em&gt; in Drupal’s &lt;em&gt;node&lt;/em&gt; table is exported to the &lt;em&gt;id&lt;/em&gt; field in the WordPress &lt;em&gt;wp_posts&lt;/em&gt; table.&lt;/p&gt;
&lt;p&gt;I have listed all the fields used in the query. If a Drupal field shows no mapping in the WordPress table, it is being used to match entries in another table for a join. Here we use the &lt;em&gt;vid&lt;/em&gt; field in &lt;em&gt;node&lt;/em&gt; and &lt;em&gt;node_revisions&lt;/em&gt; for an INNER JOIN.&lt;/p&gt;

&lt;h2&gt;Table mapping for WordPress wp_posts&lt;/h2&gt;
&lt;table class="table table-bordered table-hover"&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;b&gt;Drupal 6.x&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;&lt;b&gt;WordPress 3.x&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;&lt;b&gt;Notes&lt;/b&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;b&gt;node&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;&lt;b&gt;wp_posts&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;nid&lt;/td&gt;
&lt;td&gt;id&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;id&lt;/td&gt;
&lt;td&gt;post_author&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;created&lt;/td&gt;
&lt;td&gt;post_date&lt;/td&gt;
&lt;td&gt;Create date from UNIX timestamp&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;title&lt;/td&gt;
&lt;td&gt;post_title&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;changed&lt;/td&gt;
&lt;td&gt;post_modified&lt;/td&gt;
&lt;td&gt;Create date from UNIX timestamp&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;type&lt;/td&gt;
&lt;td&gt;post_type&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;status&lt;/td&gt;
&lt;td&gt;post_status&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;vid&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;b&gt;node_revisions&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;body&lt;/td&gt;
&lt;td&gt;post_content&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;teaser&lt;/td&gt;
&lt;td&gt;post_excerpt&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;vid&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;b&gt;node&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;&lt;b&gt;url_alias&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;nid&lt;/td&gt;
&lt;td&gt;dst&lt;/td&gt;
&lt;td&gt;post_name&lt;/td&gt;
&lt;td&gt;If dst field is NULL, use nid&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;src&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;to_ping&lt;/td&gt;
&lt;td&gt;Whitespace string&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;pinged&lt;/td&gt;
&lt;td&gt;Whitespace string&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;post_content_filtered&lt;/td&gt;
&lt;td&gt;Whitespace string&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;

&lt;h3&gt;Query&lt;/h3&gt;
&lt;div class="code"&gt;&lt;pre class="code sql"&gt;
REPLACE INTO wordpress.wp_posts (&lt;br&gt;
		id,&lt;br&gt;
		post_author,&lt;br&gt;
		post_date,&lt;br&gt;
		post_content,&lt;br&gt;
		post_title,&lt;br&gt;
		post_excerpt,&lt;br&gt;
		post_name,&lt;br&gt;
		post_modified,&lt;br&gt;
		post_type,&lt;br&gt;
		post_status,&lt;br&gt;
		to_ping,&lt;br&gt;
		pinged,&lt;br&gt;
		post_content_filtered)&lt;br&gt;
	SELECT DISTINCT&lt;br&gt;
		n.nid ‘id’,&lt;br&gt;
		n.uid ‘post_author’,&lt;br&gt;
		DATE_ADD(FROM_UNIXTIME(0), interval n.created second) ‘post_date’,&lt;br&gt;
		r.body ‘post_content’,&lt;br&gt;
		n.title ‘post_title’,&lt;br&gt;
		r.teaser ‘post_excerpt’,&lt;br&gt;
		IF(a.dst IS NULL,n.nid, SUBSTRING_INDEX(a.dst, ‘/’, -1)) ‘post_name’,&lt;br&gt;
		DATE_ADD(FROM_UNIXTIME(0), interval n.changed second) ‘post_modified’,&lt;br&gt;
		n.type ‘post_type’,&lt;br&gt;
		IF(n.status = 1, ‘publish’, ‘private’) ‘post_status’,&lt;br&gt;
		‘ ‘,&lt;br&gt;
		‘ ‘,&lt;br&gt;
		‘ ‘&lt;br&gt;
	FROM drupal.node n&lt;br&gt;
	INNER JOIN drupal.node_revisions r USING(vid)&lt;br&gt;
	LEFT OUTER JOIN drupal.url_alias a&lt;br&gt;
		ON a.src = CONCAT(‘node/’, n.nid)&lt;br&gt;
		WHERE n.type IN (&lt;br&gt;
			/* List the content types you want to migrate */&lt;br&gt;
			‘page’,&lt;br&gt;
			‘story’,&lt;br&gt;
			‘blog’,&lt;br&gt;
			‘video’,&lt;br&gt;
			‘forum’,&lt;br&gt;
			‘comment’);
&lt;/pre&gt;&lt;/div&gt;

&lt;h2&gt;Table mapping for WordPress terms&lt;/h2&gt;
&lt;p&gt;This table mapping exports the Drupal terms into WordPress.&lt;/p&gt;
&lt;table class="table table-bordered table-hover"&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;b&gt;Drupal 6.x&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;&lt;b&gt;WordPress 3.x&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;&lt;b&gt;Notes&lt;/b&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;b&gt;term_data&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;&lt;b&gt;wp_terms&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;tid&lt;/td&gt;
&lt;td&gt;term_id&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;name&lt;/td&gt;
&lt;td&gt;name&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;name&lt;/td&gt;
&lt;td&gt;slug&lt;/td&gt;
&lt;td&gt;Make lower case and convert spaces to underscores&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;vid&lt;/td&gt;
&lt;td&gt;term_group&lt;/td&gt;
&lt;td&gt;Not used in a default WordPress installation&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;b&gt;term_data&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;&lt;b&gt;wp_term_taxonomy&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;tid&lt;/td&gt;
&lt;td&gt;term_taxonomy_id&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;tid&lt;/td&gt;
&lt;td&gt;term_id&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;taxonomy&lt;/td&gt;
&lt;td&gt;String: ‘post_tag’ or ‘category’&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;description&lt;/td&gt;
&lt;td&gt;description&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;parent&lt;/td&gt;
&lt;td&gt;0 (No parent)&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;In the &lt;a href="https://codex.wordpress.org/WordPress_Taxonomy"&gt;WordPress Taxonomy documentation&lt;/a&gt;, &lt;em&gt;“term_group is a means of grouping together similar terms.”&lt;/em&gt; During a standard migration, the WordPress term_group is set to the Drupal vocabulary ID, which seems to make sense. Nevertheless, a default WordPress installation does not actually use the value for anything. It may have been included by the developers for future expandability or use by plugins.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;term_group=0&lt;/em&gt; is the default value when creating a term using the Drupal user interface.&lt;/p&gt;
&lt;p&gt;Below, we associate posts with the newly migrated terms.&lt;/p&gt;
&lt;table class="table table-bordered table-hover"&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;b&gt;Drupal 6.x&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;&lt;b&gt;WordPress 3.x&lt;/b&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;b&gt;term_node&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;&lt;b&gt;wp_term_relationships&lt;/b&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;nid&lt;/td&gt;
&lt;td&gt;object_id&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;tid&lt;/td&gt;
&lt;td&gt;term_taxonomy_id&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;

&lt;h2&gt;Table mapping for WordPress users&lt;/h2&gt;
&lt;p&gt;This maps Drupal user export to WordPress.&lt;/p&gt;
&lt;table class="table table-bordered table-hover"&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;b&gt;Drupal 6.x&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;&lt;b&gt;WordPress 3.x&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;&lt;b&gt;Notes&lt;/b&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;b&gt;users&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;&lt;b&gt;wp_posts&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;uid&lt;/td&gt;
&lt;td&gt;ID&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;name&lt;/td&gt;
&lt;td&gt;user_login&lt;/td&gt;
&lt;td&gt;Format to lowercase, replace spaces with underscores&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;pass&lt;/td&gt;
&lt;td&gt;user_pass&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;name&lt;/td&gt;
&lt;td&gt;user_nicename&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;mail&lt;/td&gt;
&lt;td&gt;user_email&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;created&lt;/td&gt;
&lt;td&gt;user_registered&lt;/td&gt;
&lt;td&gt;Formatted from UNIX time&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;name&lt;/td&gt;
&lt;td&gt;display_name&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;user_status&lt;/td&gt;
&lt;td&gt;Whitespace string&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;user_activation_key&lt;/td&gt;
&lt;td&gt;Set to 0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
 &lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;

&lt;h2&gt;Table mapping for WordPress user meta values&lt;/h2&gt;
&lt;p&gt;User information like capabilities and roles in the &lt;em&gt;wp_usermeta&lt;/em&gt; table.&lt;/p&gt;
&lt;table class="table table-bordered table-hover"&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;b&gt;users&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;&lt;b&gt;wp_usermeta&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;uid&lt;/td&gt;
&lt;td&gt;user_id&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;meta_key&lt;/td&gt;
&lt;td&gt;Set to string e.g. ‘wp_capabilities’&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;meta_value&lt;/td&gt;
&lt;td&gt;Set to string e.g. ‘a:1:{s:6:”author”;s:1:”1″;}’&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;More information about the settings for appropriate &lt;em&gt;meta_key&lt;/em&gt; and &lt;em&gt;meta_value&lt;/em&gt; can be found in the WordPress Codex:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://codex.wordpress.org/Roles_and_Capabilities"&gt;Roles and Capabilities&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://codex.wordpress.org/User_Levels"&gt;User Levels&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Node authors and comment authors&lt;/h2&gt;
&lt;p&gt;Drupal stores both node authors and comment authors in the &lt;em&gt;users&lt;/em&gt; table. WordPress handles things differently. Page and post authors are stored in the &lt;em&gt;wp_users&lt;/em&gt; table but comment authors are stored in &lt;em&gt;wp_comments&lt;/em&gt; together with the comment data.&lt;/p&gt;

&lt;h2&gt;Table mapping for WordPress comments&lt;/h2&gt;
&lt;table class="table table-bordered table-hover"&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;b&gt;Drupal 6.x&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;&lt;b&gt;WordPress 3.x&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;&lt;b&gt;Notes&lt;/b&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;b&gt;comments&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;&lt;b&gt;wp_posts&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;cid&lt;/td&gt;
&lt;td&gt;comment_ID&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;nid&lt;/td&gt;
&lt;td&gt;comment_post_ID&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;timestamp&lt;/td&gt;
&lt;td&gt;comment_date&lt;/td&gt;
&lt;td&gt;Converted from UNIX timestamp&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;comment&lt;/td&gt;
&lt;td&gt;comment_content&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;pid&lt;/td&gt;
&lt;td&gt;comment_parent&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;name&lt;/td&gt;
&lt;td&gt;comment_author&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;mail&lt;/td&gt;
&lt;td&gt;comment_author_email&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;homepage&lt;/td&gt;
&lt;td&gt;comment_author_url&lt;/td&gt;
&lt;td&gt;Truncated to WordPress limit of 200 chars&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;status&lt;/td&gt;
&lt;td&gt;comment_approved&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h2&gt;Comment authors&lt;/h2&gt;
&lt;p&gt;A note about the different ways Drupal and WordPress store comment author information: Drupal stores comment authors in its &lt;em&gt;users&lt;/em&gt; table alongside site users like node authors. In WordPress, comment authors are stored in its &lt;em&gt;wp_comments&lt;/em&gt; together with the comment data. WordPress comment authors are not entered into the &lt;em&gt;wp_users&lt;/em&gt; table.&lt;/p&gt;</description><category>blog</category><category>drupal</category><category>migration</category><category>scripts</category><category>sql</category><category>wordpress</category><guid>https://migratecontent.com/drupal-to-wordpress-migration-table-mapping/</guid><pubDate>Sat, 05 Jul 2014 02:07:29 GMT</pubDate></item><item><title>Drupal to WordPress migration: posts table mapping</title><link>https://migratecontent.com/drupal-to-wordpress-migration-posts-table-mapping/</link><dc:creator>Anthony Lopez-Vito</dc:creator><description>Following on from &lt;a href="https://migratecontent.com/drupal-to-wordpress-migration-explained/"&gt;Drupal to WordPress migration explained&lt;/a&gt;, I will create a series of posts documenting the table mappings for a &lt;a href="https://migratecontent.com" title="Drupal to WordPress migration service"&gt;site migration&lt;/a&gt; from Drupal 6.x to WordPress 3.x.

To read the mapping, you look up the Drupal table on the left listing the fields we use for a migration. Directly to its right is the WordPress table with the corresponding field in the same row. So for example, the &lt;em&gt;nid&lt;/em&gt; in Drupal's &lt;em&gt;node&lt;/em&gt; table is exported to the &lt;em&gt;id&lt;/em&gt; field in the WordPress &lt;em&gt;wp_posts&lt;/em&gt; table.

I have listed all the fields used in the query. If a Drupal field shows no mapping in the WordPress table, it is being used to match entries in another table for a join. Here we use the &lt;em&gt;vid&lt;/em&gt; field in &lt;em&gt;node&lt;/em&gt; and &lt;em&gt;node_revisions&lt;/em&gt; for an INNER JOIN.


&lt;h2&gt;Table mapping for WordPress wp_posts&lt;/h2&gt;
&lt;table class="t1" cellspacing="0" cellpadding="0"&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td class="td1" valign="top"&gt;
&lt;/td&gt;
&lt;td class="td2" valign="top"&gt;
&lt;p class="p2"&gt;&lt;span class="s1"&gt;&lt;b&gt;Drupal 6.x&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;td class="td3" valign="top"&gt;
&lt;p class="p2"&gt;&lt;span class="s1"&gt;&lt;b&gt;WordPress 3.x&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;td class="td4" valign="top"&gt;
&lt;p class="p2"&gt;&lt;span class="s1"&gt;&lt;b&gt;Notes&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="td5" valign="top"&gt;
&lt;p class="p3"&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;td class="td6" valign="top"&gt;
&lt;p class="p2"&gt;&lt;span class="s1"&gt;&lt;b&gt;node&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;td class="td7" valign="top"&gt;
&lt;p class="p2"&gt;&lt;span class="s1"&gt;&lt;b&gt;wp_posts&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;td class="td8" valign="top"&gt;
&lt;p class="p3"&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="td9" valign="top"&gt;
&lt;p class="p3"&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;td class="td10" valign="top"&gt;
&lt;p class="p2"&gt;&lt;span class="s1"&gt;nid&lt;/span&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;td class="td11" valign="top"&gt;
&lt;p class="p2"&gt;&lt;span class="s1"&gt;id&lt;/span&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;td class="td12" valign="top"&gt;
&lt;p class="p3"&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="td9" valign="top"&gt;
&lt;p class="p3"&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;td class="td10" valign="top"&gt;
&lt;p class="p2"&gt;&lt;span class="s1"&gt;id&lt;/span&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;td class="td11" valign="top"&gt;
&lt;p class="p2"&gt;&lt;span class="s1"&gt;post_author&lt;/span&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;td class="td12" valign="top"&gt;
&lt;p class="p3"&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="td9" valign="top"&gt;
&lt;p class="p3"&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;td class="td10" valign="top"&gt;
&lt;p class="p2"&gt;&lt;span class="s1"&gt;created&lt;/span&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;td class="td11" valign="top"&gt;
&lt;p class="p2"&gt;&lt;span class="s1"&gt;post_date&lt;/span&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;td class="td12" valign="top"&gt;
&lt;p class="p2"&gt;&lt;span class="s1"&gt;Create date from UNIX timestamp&lt;/span&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="td9" valign="top"&gt;
&lt;p class="p3"&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;td class="td10" valign="top"&gt;
&lt;p class="p2"&gt;&lt;span class="s1"&gt;title&lt;/span&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;td class="td11" valign="top"&gt;
&lt;p class="p2"&gt;&lt;span class="s1"&gt;post_title&lt;/span&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;td class="td12" valign="top"&gt;
&lt;p class="p3"&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="td9" valign="top"&gt;
&lt;p class="p3"&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;td class="td10" valign="top"&gt;
&lt;p class="p2"&gt;&lt;span class="s1"&gt;changed&lt;/span&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;td class="td11" valign="top"&gt;
&lt;p class="p2"&gt;&lt;span class="s1"&gt;post_modified&lt;/span&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;td class="td12" valign="top"&gt;
&lt;p class="p2"&gt;&lt;span class="s1"&gt;Create date from UNIX timestamp&lt;/span&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="td9" valign="top"&gt;
&lt;p class="p3"&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;td class="td10" valign="top"&gt;
&lt;p class="p2"&gt;&lt;span class="s1"&gt;type&lt;/span&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;td class="td11" valign="top"&gt;
&lt;p class="p2"&gt;&lt;span class="s1"&gt;post_type&lt;/span&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;td class="td12" valign="top"&gt;
&lt;p class="p3"&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="td9" valign="top"&gt;
&lt;p class="p3"&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;td class="td10" valign="top"&gt;
&lt;p class="p2"&gt;&lt;span class="s1"&gt;status&lt;/span&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;td class="td11" valign="top"&gt;
&lt;p class="p2"&gt;&lt;span class="s1"&gt;post_status&lt;/span&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;td class="td12" valign="top"&gt;
&lt;p class="p3"&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="td9" valign="top"&gt;
&lt;p class="p3"&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;td class="td13" valign="top"&gt;
&lt;p class="p2"&gt;&lt;span class="s1"&gt;vid&lt;/span&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;td class="td11" valign="top"&gt;
&lt;p class="p3"&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;td class="td12" valign="top"&gt;
&lt;p class="p3"&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="td14" valign="top"&gt;
&lt;p class="p3"&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;td class="td15" valign="top"&gt;
&lt;p class="p3"&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;td class="td16" valign="top"&gt;
&lt;p class="p3"&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;td class="td8" valign="top"&gt;
&lt;p class="p3"&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="td5" valign="top"&gt;
&lt;p class="p3"&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;td class="td6" valign="top"&gt;
&lt;p class="p2"&gt;&lt;span class="s1"&gt;&lt;b&gt;node_revisions&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;td class="td16" valign="top"&gt;
&lt;p class="p3"&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;td class="td8" valign="top"&gt;
&lt;p class="p3"&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="td9" valign="top"&gt;
&lt;p class="p3"&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;td class="td10" valign="top"&gt;
&lt;p class="p2"&gt;&lt;span class="s1"&gt;body&lt;/span&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;td class="td11" valign="top"&gt;
&lt;p class="p2"&gt;&lt;span class="s1"&gt;post_content&lt;/span&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;td class="td12" valign="top"&gt;
&lt;p class="p3"&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="td9" valign="top"&gt;
&lt;p class="p3"&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;td class="td10" valign="top"&gt;
&lt;p class="p2"&gt;&lt;span class="s1"&gt;teaser&lt;/span&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;td class="td11" valign="top"&gt;
&lt;p class="p2"&gt;&lt;span class="s1"&gt;post_excerpt&lt;/span&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;td class="td12" valign="top"&gt;
&lt;p class="p3"&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="td9" valign="top"&gt;
&lt;p class="p3"&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;td class="td13" valign="top"&gt;
&lt;p class="p2"&gt;&lt;span class="s1"&gt;vid&lt;/span&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;td class="td11" valign="top"&gt;
&lt;p class="p3"&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;td class="td12" valign="top"&gt;
&lt;p class="p3"&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="td17" valign="top"&gt;
&lt;p class="p3"&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;td class="td15" valign="top"&gt;
&lt;p class="p3"&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;td class="td16" valign="top"&gt;
&lt;p class="p3"&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;td class="td8" valign="top"&gt;
&lt;p class="p3"&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="td18" valign="top"&gt;
&lt;p class="p2"&gt;&lt;span class="s1"&gt;&lt;b&gt;node&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;td class="td6" valign="top"&gt;
&lt;p class="p2"&gt;&lt;span class="s1"&gt;&lt;b&gt;url_alias&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;td class="td16" valign="top"&gt;
&lt;p class="p3"&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;td class="td8" valign="top"&gt;
&lt;p class="p3"&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="td19" valign="top"&gt;
&lt;p class="p2"&gt;&lt;span class="s1"&gt;nid&lt;/span&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;td class="td10" valign="top"&gt;
&lt;p class="p2"&gt;&lt;span class="s1"&gt;dst&lt;/span&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;td class="td11" valign="top"&gt;
&lt;p class="p2"&gt;&lt;span class="s1"&gt;post_name&lt;/span&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;td class="td12" valign="top"&gt;
&lt;p class="p2"&gt;&lt;span class="s1"&gt;If dst field is NULL, use nid&lt;/span&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="td20" valign="top"&gt;
&lt;p class="p3"&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;td class="td21" valign="top"&gt;
&lt;p class="p2"&gt;&lt;span class="s1"&gt;src&lt;/span&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;td class="td16" valign="top"&gt;
&lt;p class="p3"&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;td class="td8" valign="top"&gt;
&lt;p class="p3"&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="td14" valign="top"&gt;
&lt;p class="p3"&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;td class="td22" valign="top"&gt;
&lt;p class="p3"&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;td class="td16" valign="top"&gt;
&lt;p class="p3"&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;td class="td8" valign="top"&gt;
&lt;p class="p3"&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="td1" valign="top"&gt;
&lt;p class="p3"&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;td class="td23" valign="top"&gt;
&lt;p class="p3"&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;td class="td11" valign="top"&gt;
&lt;p class="p3"&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;td class="td12" valign="top"&gt;
&lt;p class="p3"&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="td1" valign="top"&gt;
&lt;p class="p3"&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;td class="td23" valign="top"&gt;
&lt;p class="p3"&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;td class="td11" valign="top"&gt;
&lt;p class="p2"&gt;&lt;span class="s1"&gt;to_ping&lt;/span&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;td class="td12" valign="top"&gt;
&lt;p class="p2"&gt;&lt;span class="s1"&gt;Whitespace string&lt;/span&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="td1" valign="top"&gt;
&lt;p class="p3"&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;td class="td23" valign="top"&gt;
&lt;p class="p3"&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;td class="td11" valign="top"&gt;
&lt;p class="p2"&gt;&lt;span class="s1"&gt;pinged&lt;/span&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;td class="td12" valign="top"&gt;
&lt;p class="p2"&gt;&lt;span class="s1"&gt;Whitespace string&lt;/span&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="td1" valign="top"&gt;
&lt;p class="p3"&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;td class="td23" valign="top"&gt;
&lt;p class="p3"&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;td class="td24" valign="top"&gt;
&lt;p class="p2"&gt;&lt;span class="s1"&gt;post_content_filtered&lt;/span&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;td class="td12" valign="top"&gt;
&lt;p class="p2"&gt;&lt;span class="s1"&gt;Whitespace string&lt;/span&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;

&lt;h2&gt;Query&lt;/h2&gt;
&lt;div class="codelisting"&gt;
REPLACE INTO wordpress.wp_posts (
		id,
		post_author,
		post_date,
		post_content,
		post_title,
		post_excerpt,
		post_name,
		post_modified,
		post_type,
		post_status,
		to_ping,
		pinged,
		post_content_filtered) 
	SELECT DISTINCT
		n.nid 'id',
		n.uid 'post_author',
		DATE_ADD(FROM_UNIXTIME(0), interval n.created second) 'post_date',
		r.body 'post_content',
		n.title 'post_title',
		r.teaser 'post_excerpt',
		IF(a.dst IS NULL,n.nid, SUBSTRING_INDEX(a.dst, '/', -1)) 'post_name',
		DATE_ADD(FROM_UNIXTIME(0), interval n.changed second) '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 (
			/* List the content types you want to migrate */
			'page',
			'story',
			'blog',
			'video',
			'forum',
			'comment');
&lt;/div&gt;


  &lt;style type="text/css" scoped&gt;
    p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; min-height: 14.0px}
    p.p2 {margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Helvetica; -webkit-text-stroke: #000000}
    p.p3 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; -webkit-text-stroke: #000000; min-height: 14.0px}
    span.s1 {font-kerning: none}
    table.t1 {}
    td.td1 {width: 41.0px; height: 12.0px; padding: 4.0px 4.0px 4.0px 4.0px; border: none}
    td.td2 {width: 80.0px; height: 12.0px; border-style: solid; border-width: 0.0px 0.0px 1.0px 0.0px; border-color: transparent transparent #515151 transparent; padding: 4.0px 4.0px 4.0px 4.0px}
    td.td3 {width: 120.0px; height: 12.0px; border-style: solid; border-width: 0.0px 0.0px 1.0px 0.0px; border-color: transparent transparent #515151 transparent; padding: 4.0px 4.0px 4.0px 4.0px}
    td.td4 {width: 162.0px; height: 12.0px; padding: 4.0px 4.0px 4.0px 4.0px; border: none}
    td.td5 {width: 41.0px; height: 13.0px; border-style: solid; border-width: 0.0px 1.0px 0.0px 0.0px; border-color: transparent #515151 transparent transparent; padding: 4.0px 4.0px 4.0px 4.0px}
    td.td6 {width: 79.0px; height: 12.0px; background-color: #bfbfbf; border-style: solid; border-width: 1.0px 1.0px 0.0px 1.0px; border-color: #515151 #515151 transparent #515151; padding: 4.0px 4.0px 4.0px 4.0px}
    td.td7 {width: 119.0px; height: 12.0px; background-color: #bfbfbf; border-style: solid; border-width: 1.0px 1.0px 0.0px 1.0px; border-color: #515151 #515151 transparent #515151; padding: 4.0px 4.0px 4.0px 4.0px}
    td.td8 {width: 161.0px; height: 13.0px; border-style: solid; border-width: 0.0px 0.0px 0.0px 1.0px; border-color: transparent transparent transparent #515151; padding: 4.0px 4.0px 4.0px 4.0px}
    td.td9 {width: 41.0px; height: 12.0px; border-style: solid; border-width: 0.0px 1.0px 0.0px 0.0px; border-color: transparent #515151 transparent transparent; padding: 4.0px 4.0px 4.0px 4.0px}
    td.td10 {width: 79.0px; height: 12.0px; border-style: solid; border-width: 0.0px 1.0px 0.0px 1.0px; border-color: transparent #515151 transparent #515151; padding: 4.0px 4.0px 4.0px 4.0px}
    td.td11 {width: 119.0px; height: 12.0px; border-style: solid; border-width: 0.0px 1.0px 0.0px 1.0px; border-color: transparent #515151 transparent #515151; padding: 4.0px 4.0px 4.0px 4.0px}
    td.td12 {width: 161.0px; height: 12.0px; border-style: solid; border-width: 0.0px 0.0px 0.0px 1.0px; border-color: transparent transparent transparent #515151; padding: 4.0px 4.0px 4.0px 4.0px}
    td.td13 {width: 79.0px; height: 12.0px; border-style: solid; border-width: 0.0px 1.0px 1.0px 1.0px; border-color: transparent #515151 #515151 #515151; padding: 4.0px 4.0px 4.0px 4.0px}
    td.td14 {width: 41.0px; height: 13.0px; padding: 4.0px 4.0px 4.0px 4.0px; border: none;}
    td.td15 {width: 80.0px; height: 12.0px; border-style: solid; border-width: 1.0px 1.0px 1.0px 0.0px; border-color: #515151 #515151 #515151 transparent; padding: 4.0px 4.0px 4.0px 4.0px}
    td.td16 {width: 119.0px; height: 13.0px; border-style: solid; border-width: 0.0px 1.0px 0.0px 1.0px; border-color: transparent #515151 transparent #515151; padding: 4.0px 4.0px 4.0px 4.0px}
    td.td17 {width: 41.0px; height: 13.0px; border-style: solid; border-width: 0.0px 0.0px 1.0px 0.0px; border-color: transparent transparent #515151 transparent; padding: 4.0px 4.0px 4.0px 4.0px}
    td.td18 {width: 41.0px; height: 12.0px; background-color: #bfbfbf; border-style: solid; border-width: 1.0px 1.0px 0.0px 1.0px; border-color: #515151 #515151 transparent #515151; padding: 4.0px 4.0px 4.0px 4.0px}
    td.td19 {width: 41.0px; height: 12.0px; border-style: solid; border-width: 0.0px 1.0px 1.0px 1.0px; border-color: transparent #515151 #515151 #515151; padding: 4.0px 4.0px 4.0px 4.0px}
    td.td20 {width: 41.0px; height: 12.0px; border-style: solid; border-width: 1.0px 1.0px 0.0px 0.0px; border-color: #515151 #515151 transparent transparent; padding: 4.0px 4.0px 4.0px 4.0px}
    td.td21 {width: 79.0px; height: 13.0px; border-style: solid; border-width: 0.0px 1.0px 1.0px 1.0px; border-color: transparent #515151 #515151 #515151; padding: 4.0px 4.0px 4.0px 4.0px}
    td.td22 {width: 80.0px; height: 12.0px; border-style: solid; border-width: 1.0px 1.0px 0.0px 0.0px; border-color: #515151 #515151 transparent transparent; padding: 4.0px 4.0px 4.0px 4.0px}
    td.td23 {width: 80.0px; height: 12.0px; border-style: solid; border-width: 0.0px 1.0px 0.0px 0.0px; border-color: transparent #515151 transparent transparent; padding: 4.0px 4.0px 4.0px 4.0px}
    td.td24 {width: 119.0px; height: 12.0px; border-style: solid; border-width: 0.0px 1.0px 1.0px 1.0px; border-color: transparent #515151 #515151 #515151; padding: 4.0px 4.0px 4.0px 4.0px}
  &lt;/style&gt;</description><category>drupal</category><category>migration</category><category>scripts</category><category>sql</category><category>wordpress</category><guid>https://migratecontent.com/drupal-to-wordpress-migration-posts-table-mapping/</guid><pubDate>Sat, 05 Jul 2014 02:07:29 GMT</pubDate></item><item><title>Drupal to WordPress migration SQL queries explained</title><link>https://migratecontent.com/drupal-to-wordpress-migration-sql-queries-explained/</link><dc:creator>Anthony Lopez-Vito</dc:creator><description>&lt;figure&gt;&lt;img src="https://migratecontent.com/images/drupal-to-wordpress-migration-queries-featured.jpg"&gt;&lt;/figure&gt; &lt;p&gt;In this post I will give a step-by-step explanation of my Drupal to WordPress migration SQL queries. For general information about migrating from Drupal to WordPress, please see instead my &lt;strong&gt;&lt;em&gt;&lt;a href="https://migratecontent.com/how-we-migrate-technical-process/"&gt;Drupal to WordPress Migration Guide&lt;/a&gt;&lt;/em&gt;&lt;/strong&gt;. &lt;/p&gt;

&lt;figure class="figure d-flex flex-column align-items-center"&gt;
    &lt;img class="figure-img img-fluid rounded" src="https://migratecontent.com/images/drupal-to-wordpress-migration-queries-screenshot.png" title="Drupal to Wordpress migration SQL queries" alt="Drupal to Wordpress migration queries screenshot" width="800" height="493"&gt;
&lt;/figure&gt;

&lt;p&gt;Since I &lt;a href="https://migratecontent.com/contact/"&gt;offer site migration&lt;/a&gt; as a &lt;a href="https://migratecontent.com/drupal-to-wordpress-migration-service/" title="Drupal to WordPress migration service"&gt;paid service&lt;/a&gt;, readers might be wondering why I'm giving away some of my secret sauce. The simple answer is that the ingredients of the sauce are anything but secret. A web search brings up blog posts and tutorials detailing how to go about it. In fact, the first version of my own Drupal to WordPress migration tool was based on a blog post by another &lt;a href="http://blog.room34.com/archives/4530"&gt;web company&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;However, while the knowledge is freely available, the whole process can be a real pain, especially when you're dealing with a Drupal installation with lots of content and customisations. In my experience, migrating an established site from Drupal to WordPress requires &lt;em&gt;all&lt;/em&gt; of the following:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;An intermediate to advanced level of technical skill;&lt;/li&gt;
&lt;li&gt;Time to plan, run the migration and do post-migration clean-up;&lt;/li&gt;
&lt;li&gt;A great deal of patience.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;If you are a developer with the right skills, you still need to consider the time investment and effort needed to understand both Drupal and WordPress database schemas. Often, the man-hours required will make a client think twice about proceeding with the project. Fortunately (or unfortunately) for me, I've needed to put in the time because my maintenance agreements for some clients covered exactly this sort of work. I've therefore built up enough experience to offer competitive quotes for migration of even complex sites. In my very biased opinion, you'll make better use of your time and budget by getting me to do the task!&lt;/p&gt;
&lt;p&gt;Of course, there are still cases where, for whatever reason, it's not viable to offload the work to someone else. If this sounds like your situation, you'll probably figure things out eventually so I might as well help you along.&lt;/p&gt;
&lt;h2&gt;Prerequisites for the Drupal to WordPress migration script&lt;/h2&gt;
&lt;p&gt;To run this migration you will need:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;A working installation of Drupal 6;&lt;/li&gt;
&lt;li&gt;A clean installation of WordPress 3.5 or above;&lt;/li&gt;
&lt;li&gt;Access to the Drupal and WordPress MySQL databases;&lt;/li&gt;
&lt;li&gt;The ability to run SQL queries on both databases;&lt;/li&gt;
&lt;li&gt;Both databases on the same MySQL server;&lt;/li&gt;
&lt;li&gt;Access to the Drupal and WordPress installations.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Ideally, you should:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Run the migration from a development server (it's best not to risk running this on your live server);&lt;/li&gt;
&lt;li&gt;Backup your live Drupal database before beginning the migration;&lt;/li&gt;
&lt;li&gt;Be comfortable with running database operations;&lt;/li&gt;
&lt;li&gt;Have planned the migration beforehand (e.g. which content types and taxonomies should be migrated).&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;If you have an older version of Drupal, simply upgrade to Drupal 6 first, then run the migration. I mention WordPress 3.5 as a prerequisite because that's where I've done most testing. You can probably get away with migrating straight into a more recent version but to avoid any problems, I suggest you start off with WordPress 3.5. It's easy to upgrade to the latest WordPress version &lt;em&gt;after&lt;/em&gt; converting the Drupal content.&lt;/p&gt;
&lt;h2&gt;The Drupal to WordPress migration SQL queries&lt;/h2&gt;
&lt;p&gt;Keep in mind that this article is based on my Drupal to WordPress migration tool but with some additional queries written for the specific needs of a client. It therefore includes some values which will not apply to your site. I've stripped out any identifying information but left generic data to provide an example. &lt;em&gt;You will need to manually look up the correct values in the Drupal database for your installation.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Another thing to keep in mind is that I've favoured readability over efficiency. For example, it's possible to write more complex queries to avoid creating working tables but that would make debugging more difficult. Having a trail of data changes can help with content analysis if the end results aren't what you expected.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;strong&gt;CAUTION:&lt;/strong&gt; Make a backup of both your Drupal and WordPress databases before running these queries. USE IS ENTIRELY AT YOUR OWN RISK. I'm offering this information with no warranty or support implied.&lt;/div&gt;
&lt;h3&gt;Example data in this scenario&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;em&gt;wordpress:&lt;/em&gt; the WordPress database name.&lt;/li&gt;
&lt;li&gt;&lt;em&gt;drupal:&lt;/em&gt; the Drupal database name.&lt;/li&gt;
&lt;li&gt;&lt;em&gt;acc_ table prefixes:&lt;/em&gt; these are working tables I create to help with migrating data.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;Clear out some Drupal and WordPress tables&lt;/h3&gt;
&lt;p&gt;For most migration projects to date, I've needed to run through several passes of the queries as I make incremental adjustments based on the client's feedback. I define a &lt;em&gt;'pass'&lt;/em&gt; as one iteration of the entire migration process and inspecting the results in a WordPress installation. Depending on your project requirements, you may need to do this several times, making little tweaks to the MySQL queries as you go along.&lt;/p&gt;
&lt;p&gt;These Drupal and WordPress tables may be empty or non-existent if you're running the queries for the first time but it makes sense to clear them out at the start.&lt;/p&gt;

&lt;div class="code"&gt;&lt;pre class="code sql"&gt;
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;
TRUNCATE TABLE wordpress.wp_users;

DROP TABLE IF EXISTS drupal.acc_duplicates;
DROP TABLE IF EXISTS drupal.acc_news_terms;
DROP TABLE IF EXISTS drupal.acc_tags_terms;
DROP TABLE IF EXISTS drupal.acc_wp_tags;
DROP TABLE IF EXISTS drupal.acc_users_post_count;
DROP TABLE IF EXISTS drupal.acc_users_comment_count;
DROP TABLE IF EXISTS drupal.acc_users_with_content;
DROP TABLE IF EXISTS drupal.acc_users_post_count;
&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;For some installations, I make changes to the wp_usermeta table so that needs to be cleared too.&lt;/p&gt;

&lt;div class="code"&gt;&lt;pre class="code sql"&gt;
TRUNCATE TABLE wordpress.wp_usermeta;
&lt;/pre&gt;&lt;/div&gt;

&lt;h3&gt;Vocabularies and taxonomies&lt;/h3&gt;
&lt;p&gt;Delete unwanted vocabularies. You'll need to look in your Drupal &lt;em&gt;vocabulary&lt;/em&gt; table for the appropriate &lt;em&gt;vid&lt;/em&gt;s. In this case, I'm deleting vocabularies &lt;em&gt;5, 7, 8, 38&lt;/em&gt; and &lt;em&gt;40&lt;/em&gt;.&lt;/p&gt;

&lt;div class="code"&gt;&lt;pre class="code sql"&gt;
DELETE FROM drupal.vocabulary WHERE vid IN (5, 7, 8, 38, 40);
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Delete terms associated with unwanted vocabularies. Here I'm keeping the terms for &lt;em&gt;vid 38&lt;/em&gt;. Sometimes you might want to keep some terms of unwanted vocabularies for later conversion into into WordPress tags. (Please see the next query.)&lt;/p&gt;

&lt;div class="code"&gt;&lt;pre class="code sql"&gt;
DELETE FROM drupal.term_data WHERE vid IN (5, 7, 8, 40);
&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;You may want to merge terms. In this example, I am merging the previously saved terms for &lt;em&gt;News&lt;/em&gt; which has &lt;em&gt;vid 38&lt;/em&gt; to the &lt;em&gt;Tags&lt;/em&gt; vocabulary terms which has &lt;em&gt;vid 2&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;We will need to deal with duplicates. For example, in the Drupal installation, &lt;em&gt;'science'&lt;/em&gt; could appear in both &lt;em&gt;News (vid 38)&lt;/em&gt; and &lt;em&gt;Tags (vid 2)&lt;/em&gt;. This will cause a problem when exporting to WordPress since we can't have duplicate terms. Here I create working tables for both term groups.&lt;/p&gt;

&lt;div class="code"&gt;&lt;pre class="code sql"&gt;
CREATE TABLE drupal.acc_news_terms AS SELECT tid, vid, name FROM drupal.term_data WHERE vid=38;
CREATE TABLE drupal.acc_tags_terms AS SELECT tid, vid, name FROM drupal.term_data WHERE vid=2;
&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Create a working table from duplicates.&lt;/p&gt;

&lt;div class="code"&gt;&lt;pre class="code sql"&gt;
CREATE TABLE drupal.acc_duplicates AS
	SELECT t.tid tag_tid,
		n.tid news_tid,
		t.vid tag_vid,
		n.vid news_vid,
		t.name
FROM drupal.acc_tags_terms AS t
INNER JOIN (drupal.acc_news_terms AS n)
ON n.name=t.name;
&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Append a string to &lt;em&gt;News&lt;/em&gt; terms duplicates so they won't clash during migration. Here I used a fixed string but this won't work if you have more than two terms with the same name. If you expect many terms with the same name, it would be better to generate a unique number. For example, using the &lt;em&gt;tid&lt;/em&gt; would make it unique since these are unique primary keys. Use whatever string makes sense for your project.&lt;/p&gt;
&lt;p&gt;Note that we're overwriting the source data in the Drupal &lt;em&gt;term_data&lt;/em&gt; table so proceed with care. Make sure you have a backup of your pre-migration Drupal tables in case you need to run the conversion again.&lt;/p&gt;

&lt;div class="code"&gt;&lt;pre class="code sql"&gt;
UPDATE drupal.term_data
	SET name=CONCAT(name, '_01')
	WHERE tid IN (SELECT news_tid FROM drupal.acc_duplicates);
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Convert Drupal &lt;em&gt;News&lt;/em&gt; terms to Drupal &lt;em&gt;Tags&lt;/em&gt;. We'll migrate the whole lot into WordPress tags later.&lt;/p&gt;
&lt;div class="codelisting"&gt;
UPDATE drupal.term_data SET vid=2 WHERE vid=38;
&lt;/div&gt;

&lt;p&gt;Create a table of WordPress tags. Exclude any terms from Drupal vocabularies that you might later migrate into WordPress categories. See the MySQL queries below where I create WordPress categories and sub-categories.&lt;/p&gt;
&lt;p&gt;Here, all Drupal vocabularies except &lt;em&gt;37, 36&lt;/em&gt; and &lt;em&gt;35&lt;/em&gt; will be converted WordPress tags.&lt;/p&gt;

&lt;div class="code"&gt;&lt;pre class="code sql"&gt;
CREATE TABLE drupal.acc_wp_tags AS
	SELECT
		tid,
		vid,
		name
	FROM drupal.term_data
	WHERE vid NOT IN (37, 36, 35);
&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Now create the tags in the WordPress database. A clean WordPress database will have &lt;em&gt;term_id=1&lt;/em&gt; for &lt;em&gt;'Uncategorized'&lt;/em&gt;. Use REPLACE as this may conflict with a Drupal tid.&lt;/p&gt;
&lt;p&gt;We are assuming that this point the Drupal &lt;em&gt;term_data&lt;/em&gt; table has been cleaned of any duplicate names. Any duplicate terms will be lost when running this MySQL query.&lt;/p&gt;

&lt;div class="code"&gt;&lt;pre class="code sql"&gt;
REPLACE INTO wordpress.wp_terms (term_id, name, slug, term_group)
	SELECT
		d.tid,
		d.name,
		REPLACE(LOWER(d.name), ' ', '_'),
		d.vid
	FROM drupal.term_data d WHERE d.tid IN (
		SELECT t.tid FROM drupal.acc_wp_tags t
		);
&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;In WordPress, tags and categories are all stored in the &lt;em&gt;wp_term_taxonomy&lt;/em&gt; table. The &lt;em&gt;taxonomy&lt;/em&gt; field specifies whether it's a tag or category by setting the field string to either &lt;em&gt;'post_tag'&lt;/em&gt; or &lt;em&gt;'category'&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;Here I convert these Drupal terms into WordPress tags.&lt;/p&gt;

&lt;div class="code"&gt;&lt;pre class="code sql"&gt;
REPLACE INTO wordpress.wp_term_taxonomy (
		term_taxonomy_id,
		term_id,
		taxonomy,
		description,
		parent)
	SELECT DISTINCT
		d.tid,
		d.tid 'term_id',
		'post_tag', /* This string makes them WordPress tags */
		d.description 'description',
		0 /* In this case, I don't give tags a parent */
	FROM drupal.term_data d
	WHERE d.tid IN (SELECT t.tid FROM drupal.acc_wp_tags t);
&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Create the categories and sub-categories in the WordPress database. This may be unnecessary depending on your setup.&lt;/p&gt;
&lt;p&gt;Add terms associated with a Drupal vocabulary into WordPress. Note that in this case, these are the same vids that I excluded from the tag table above.&lt;/p&gt;

&lt;div class="code"&gt;&lt;pre class="code sql"&gt;
REPLACE INTO wordpress.wp_terms (term_id, name, slug, term_group)
	SELECT DISTINCT
		d.tid,
		d.name,
		REPLACE(LOWER(d.name), ' ', '_'),
		d.vid
	FROM drupal.term_data d
	WHERE d.vid IN (37, 36, 35);
&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Convert these Drupal terms into WordPress sub-categories by setting the &lt;em&gt;parent&lt;/em&gt; field in the &lt;em&gt;wp_term_taxonomy&lt;/em&gt; table.&lt;/p&gt;

&lt;div class="code"&gt;&lt;pre class="code sql"&gt;
REPLACE INTO wordpress.wp_term_taxonomy (
		term_taxonomy_id,
		term_id,
		taxonomy,
		description,
		parent)
	SELECT DISTINCT
		d.tid,
		d.tid 'term_id',
		'category',
		d.description 'description',
		d.vid
	FROM drupal.term_data d
	WHERE d.vid IN (37, 36, 35);
&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Now add the vocabularies to the WordPress &lt;em&gt;terms&lt;/em&gt; table. There's no need to set &lt;em&gt;term_id&lt;/em&gt; as vocabularies are not directly associated with posts.&lt;/p&gt;
&lt;div class="codelisting"&gt;
INSERT INTO wordpress.wp_terms (name, slug, term_group)
	SELECT DISTINCT
		v.name,
		REPLACE(LOWER(v.name), ' ', '_'),
		v.vid
	FROM drupal.vocabulary v
	WHERE vid IN (37, 36, 35);
&lt;/div&gt;
&lt;p&gt;Insert Drupal vocabularies as WordPress categories.&lt;/p&gt;

&lt;div class="code"&gt;&lt;pre class="code sql"&gt;
INSERT INTO wordpress.wp_term_taxonomy (
		term_id,
		taxonomy,
		description,
		parent,
		count)
	SELECT DISTINCT
		v.vid,
		'category', /* This string makes them WordPress categories */
		v.description,
		v.vid,
		0
	FROM drupal.vocabulary v
	WHERE vid IN (37, 36, 35);
&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Update the WordPress term groups and parents.&lt;/p&gt;
&lt;p&gt;Before continuing with this step, we need to manually inspect the table to get the &lt;em&gt;term_id&lt;/em&gt; for the parents inserted above. In this case, vids &lt;em&gt;37, 36&lt;/em&gt; and &lt;em&gt;35&lt;/em&gt; were inserted as into the &lt;em&gt;wp_term_taxonomy&lt;/em&gt; table as &lt;em&gt;term_ids 7517, 7518&lt;/em&gt; and &lt;em&gt;7519&lt;/em&gt;. I will use them as the parents for their respective terms. In other words, terms that formerly belonged to the Drupal vocabulary ID &lt;em&gt;37&lt;/em&gt; would now belong to the WordPress parent category &lt;em&gt;7519&lt;/em&gt;.&lt;/p&gt;

&lt;div class="code"&gt;&lt;pre class="code sql"&gt;
&lt;p&gt;UPDATE wordpress.wp_terms SET term_group=7519 WHERE term_group=37;
UPDATE wordpress.wp_terms SET term_group=7518 WHERE term_group=36;
UPDATE wordpress.wp_terms SET term_group=7517 WHERE term_group=35;&lt;/p&gt;
&lt;p&gt;UPDATE wordpress.wp_term_taxonomy SET parent=7519 WHERE parent=37;
UPDATE wordpress.wp_term_taxonomy SET parent=7518 WHERE parent=36;
UPDATE wordpress.wp_term_taxonomy SET parent=7517 WHERE parent=35;&lt;/p&gt;
&lt;p&gt;UPDATE wordpress.wp_term_taxonomy SET term_id=7519 WHERE term_taxonomy_id=7519;
UPDATE wordpress.wp_term_taxonomy SET term_id=7518 WHERE term_taxonomy_id=7518;
UPDATE wordpress.wp_term_taxonomy SET term_id=7517 WHERE term_taxonomy_id=7517;
&lt;/p&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Re-insert the &lt;em&gt;Uncategorized&lt;/em&gt; term replaced earlier in the conversion process. We may have replaced or deleted the Uncategorized category during a previous MySQL query. Re-insert it if you want an Uncategorized category.&lt;/p&gt;

&lt;div class="code"&gt;&lt;pre class="code sql"&gt;
INSERT INTO wordpress.wp_terms (name, slug, term_group)
	VALUES ('Uncategorized', 'uncategorized', 0);
INSERT INTO wordpress.wp_term_taxonomy (
		term_taxonomy_id,
		term_id,
		taxonomy,
		description,
		parent,
		count)
	SELECT DISTINCT
		t.term_id,
		t.term_id,
		'category',
		t.name,
		0,
		0
	FROM wordpress.wp_terms t
	WHERE t.slug='uncategorized';
&lt;/pre&gt;&lt;/div&gt;

&lt;h3&gt;Converting Drupal nodes to WordPress posts&lt;/h3&gt;
&lt;p&gt;Now create WordPress posts from Drupal nodes. This may take a while if you have many Drupal nodes. Wait until the query completes before continuing. It could take several minutes.&lt;/p&gt;

&lt;div class="code"&gt;&lt;pre class="code sql"&gt;
REPLACE INTO wordpress.wp_posts (
		id,
		post_author,
		post_date,
		post_content,
		post_title,
		post_excerpt,
		post_name,
		post_modified,
		post_type,
		post_status,
		to_ping,
		pinged,
		post_content_filtered)
	SELECT DISTINCT
		n.nid 'id',
		n.uid 'post_author',
		DATE_ADD(FROM_UNIXTIME(0), interval n.created second) 'post_date',
		r.body 'post_content',
		n.title 'post_title',
		r.teaser 'post_excerpt',
		IF(a.dst IS NULL,n.nid, SUBSTRING_INDEX(a.dst, '/', -1)) 'post_name',
		DATE_ADD(FROM_UNIXTIME(0), interval n.changed second) '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 (
			/* List the content types you want to migrate */
			'page',
			'story',
			'blog',
			'video',
			'forum',
			'comment');
&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Set the Drupal content types that should be migrated as WordPress 'posts'. In this case, I want &lt;em&gt;'page', 'story', 'blog', 'video', 'forum'&lt;/em&gt; and &lt;em&gt;'comment'&lt;/em&gt; in Drupal to be converted to posts in WordPress.&lt;/p&gt;

&lt;div class="code"&gt;&lt;pre class="code sql"&gt;
UPDATE wordpress.wp_posts SET post_type = 'post'
	WHERE post_type IN (
		'page',
		'story',
		'blog',
		'video',
		'forum',
		'comment');
&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Now convert the remaining content types into WordPress pages.&lt;/p&gt;

&lt;div class="code"&gt;&lt;pre class="code sql"&gt;
UPDATE wordpress.wp_posts SET post_type = 'page' WHERE post_type NOT IN ('post');
&lt;/pre&gt;&lt;/div&gt;

&lt;h3&gt;Housekeeping queries for terms&lt;/h3&gt;
&lt;p&gt;Here I associate the content with WordPress terms using the &lt;em&gt;wp_term_relationships&lt;/em&gt; table.&lt;/p&gt;

&lt;div class="code"&gt;&lt;pre class="code sql"&gt;
INSERT INTO wordpress.wp_term_relationships (
	object_id,
	term_taxonomy_id)
	SELECT DISTINCT nid, tid FROM drupal.term_node;
&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;We need to update tag counts.&lt;/p&gt;

&lt;div class="code"&gt;&lt;pre class="code sql"&gt;
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);
&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Now set the default WordPress category. You'll need to manually look in the database for the &lt;em&gt;term_id&lt;/em&gt; of the category you want to set as the default WordPress category.&lt;/p&gt;

&lt;div class="code"&gt;&lt;pre class="code sql"&gt;
UPDATE wordpress.wp_options SET option_value='7520' WHERE option_name='default_category';
UPDATE wordpress.wp_term_taxonomy SET taxonomy='category' WHERE term_id=7520;
&lt;/pre&gt;&lt;/div&gt;

&lt;h3&gt;Migrate comments&lt;/h3&gt;

&lt;div class="code"&gt;&lt;pre class="code sql"&gt;
REPLACE INTO wordpress.wp_comments (
	comment_ID,
	comment_post_ID,
	comment_date,
	comment_content,
	comment_parent,
	comment_author,
	comment_author_email,
	comment_author_url,
	comment_approved)
	SELECT DISTINCT
		cid,
		nid,
		FROM_UNIXTIME(timestamp),
		comment,
		pid,
		name,
		mail,
		SUBSTRING(homepage,1,200),
		((status + 1) % 2) FROM drupal.comments;
&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Update comment counts.&lt;/p&gt;

&lt;div class="code"&gt;&lt;pre class="code sql"&gt;
UPDATE wordpress.wp_posts
	SET comment_count = ( SELECT COUNT(comment_post_id)
	FROM wordpress.wp_comments
	WHERE wordpress.wp_posts.id = wordpress.wp_comments.comment_post_id);
&lt;/pre&gt;&lt;/div&gt;

&lt;h3&gt;Migrate Drupal Authors into WordPress&lt;/h3&gt;
&lt;p&gt;In this case I am migrating only users who have created a post. This was a requirement for my project but may be unnecessary for you.&lt;/p&gt;
&lt;p&gt;First delete all existing WordPress authors except for &lt;em&gt;admin&lt;/em&gt;.&lt;/p&gt;

&lt;div class="code"&gt;&lt;pre class="code sql"&gt;
DELETE FROM wordpress.wp_users WHERE ID &amp;gt; 1;
DELETE FROM wordpress.wp_usermeta WHERE user_id &amp;gt; 1;
&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Now set Drupal's admin password to a known value. This avoids hassles with trying to reset the password on the new WordPress installation. Resetting a user password in WordPress is more convoluted and cannot be done using a simple MySQL query as in Drupal.&lt;/p&gt;
&lt;div class="code"&gt;&lt;pre class="code sql"&gt;
UPDATE drupal.users set pass=md5('password') where uid = 1;
&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Create a working table of users and the number of posts they've authored. I am only considering authors who have created posts of the content types I want to migrate.&lt;/p&gt;

&lt;div class="code"&gt;&lt;pre class="code sql"&gt;
CREATE TABLE drupal.acc_users_post_count AS
SELECT
	u.uid,
	u.name,
	u.mail,
	count(n.uid) node_count
FROM drupal.node n
INNER JOIN drupal.users u on n.uid = u.uid
WHERE n.type IN (
	/* List the post types I migrated earlier */
	'page',
	'story',
	'blog',
	'video',
	'forum',
	'comment')
GROUP BY u.uid
ORDER BY node_count;
&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Now add these authors into the WordPress &lt;em&gt;wp_users&lt;/em&gt; table.&lt;/p&gt;

&lt;div class="code"&gt;&lt;pre class="code sql"&gt;
&lt;p&gt;INSERT IGNORE INTO wordpress.wp_users (
	ID,
	user_login,
	user_pass,
	user_nicename,
	user_email,
	user_registered,
	user_activation_key,
	user_status,
	display_name)
	SELECT DISTINCT
		u.uid,
		REPLACE(LOWER(u.name), ' ', '_'),
		u.pass,
		u.name,
		u.mail,
		FROM_UNIXTIME(created),
		",
		0,
		u.name
	FROM drupal.users u
	WHERE u.uid IN (SELECT uid FROM drupal.acc_users_post_count);
&lt;/p&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;First set all these authors to WordPress "author" by default. In the next MySQL query, we can selectively promote individual authors to other WordPress roles.&lt;/p&gt;

&lt;div class="code"&gt;&lt;pre class="code sql"&gt;
&lt;p&gt;INSERT IGNORE INTO wordpress.wp_usermeta (
	user_id,
	meta_key,
	meta_value)
	SELECT DISTINCT
		u.uid,
		'wp_capabilities',
		'a:1:{s:6:"author";s:1:"1";}'
	FROM drupal.users u
	WHERE u.uid IN (SELECT uid FROM drupal.acc_users_post_count);	&lt;/p&gt;
&lt;p&gt;INSERT IGNORE INTO wordpress.wp_usermeta (
	user_id,
	meta_key,
	meta_value)
	SELECT DISTINCT
		u.uid,
		'wp_user_level',
		'2'
	FROM drupal.users u
	WHERE u.uid IN (SELECT uid FROM drupal.acc_users_post_count);
&lt;/p&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;During the course of the migration, some posts may end up not having an assigned author. Here I reassign authorship for these posts to the WordPress &lt;em&gt;admin&lt;/em&gt; user.&lt;/p&gt;

&lt;div class="code"&gt;&lt;pre class="code sql"&gt;
UPDATE wordpress.wp_posts
	SET post_author = 1
	WHERE post_author NOT IN (SELECT DISTINCT ID FROM wordpress.wp_users);
&lt;/pre&gt;&lt;/div&gt;

&lt;h3&gt;Comment authors&lt;/h3&gt;
&lt;p&gt;In Drupal, comments are treated as nodes and comment authors are stored along with other node authors in the Drupal &lt;em&gt;users&lt;/em&gt; table. WordPress treats comments and comment authors differently. Comment authors in WordPress are not stored in the &lt;em&gt;wp_users&lt;/em&gt; table. Instead, they're stored along with the comment content itself in the &lt;em&gt;wp_comments&lt;/em&gt; table.&lt;/p&gt;
&lt;p&gt;We may need to run additional query to import users who have commented but haven't created any of the selected content types. To do this, I create some working tables required for some later MySQL queries:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;em&gt;acc_users_with_comments:&lt;/em&gt; empty copy of wp_users&lt;/li&gt;
&lt;li&gt;&lt;em&gt;acc_users_add_commenters:&lt;/em&gt; empty copy of wp_users&lt;/li&gt;
&lt;li&gt;&lt;em&gt;acc_wp_users:&lt;/em&gt; copy of wp_users from wordpress database containing users&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Running the following MySQL queries will throw errors if you haven't created the required tables above.&lt;/p&gt;
&lt;p&gt;First create a working table of Drupal users who have created a Drupal comment.&lt;/p&gt;

&lt;div class="code"&gt;&lt;pre class="code sql"&gt;
CREATE TABLE drupal.acc_users_comment_count AS
SELECT
	u.uid,
	u.name,
	count(c.uid) comment_count
FROM drupal.comments c
INNER JOIN drupal.users u on c.uid = u.uid
GROUP BY u.uid;
&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Now add the author information for these users into another working table.&lt;/p&gt;

&lt;div class="code"&gt;&lt;pre class="code sql"&gt;
INSERT IGNORE INTO drupal.acc_users_with_comments (
	ID,
	user_login,
	user_pass,
	user_nicename,
	user_email,
	user_registered,
	user_activation_key,
	user_status,
	display_name)
	SELECT DISTINCT
		u.uid,
		REPLACE(LOWER(u.name), ' ', '_'),
		u.pass,
		u.name,
		u.mail,
		FROM_UNIXTIME(created),
		",
		0,
		u.name
	FROM drupal.users u
	WHERE u.uid IN (SELECT uid FROM drupal.acc_users_comment_count);
&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Using the above table, next build a working table of Drupal users who have commented but have not already been added to the WordPress &lt;em&gt;wp_users&lt;/em&gt; table.&lt;/p&gt;

&lt;div class="code"&gt;&lt;pre class="code sql"&gt;
INSERT IGNORE INTO drupal.acc_users_add_commenters (
	ID,
	user_login,
	user_pass,
	user_nicename,
	user_email,
	user_registered,
	user_activation_key,
	user_status,
	display_name)
	SELECT DISTINCT
		u.ID,
		u.user_login,
		u.user_pass,
		u.user_nicename,
		u.user_email,
		u.user_registered,
		",
		0,
		u.display_name
	FROM drupal.acc_users_with_comments u
	WHERE u.ID NOT IN (SELECT ID FROM drupal.wp_users);
&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Combine the tables into another working table &lt;em&gt;acc_wp_users&lt;/em&gt;.&lt;/p&gt;

&lt;div class="code"&gt;&lt;pre class="code sql"&gt;
INSERT IGNORE
  INTO drupal.acc_wp_users
SELECT *
  FROM drupal.acc_users_add_commenters;
&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;The &lt;em&gt;acc_wp_users&lt;/em&gt; working table helps when inspecting the user list. For example, you might want to clear out inactive users or spam posters. Once finished, remember to replace your WordPress &lt;em&gt;wp_users&lt;/em&gt; with the cleaned &lt;em&gt;acc_wp_users&lt;/em&gt; table. You may prefer to amend the above query to insert directly into the WordPress &lt;em&gt;wp_users&lt;/em&gt; table.&lt;/p&gt;
&lt;p&gt;I realise this is a rather round-about way of migrating comment authors from Drupal into WordPress but find that having working tables helps with debugging.&lt;/p&gt;

&lt;h3&gt;Housekeeping for WordPress options&lt;/h3&gt;
&lt;p&gt;Update file path for the WordPress installation.&lt;/p&gt;

&lt;div class="code"&gt;&lt;pre class="code sql"&gt;
UPDATE wordpress.wp_posts SET post_content = REPLACE(post_content, '"/files/', '"/wp-content/uploads/');
&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Set your WordPress site name using the Drupal &lt;em&gt;'site_name'&lt;/em&gt; variable.&lt;/p&gt;

&lt;div class="code"&gt;&lt;pre class="code sql"&gt;
UPDATE wordpress.wp_options SET option_value = ( SELECT value FROM drupal.variable WHERE name='site_name') WHERE option_name = 'blogname';
&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Set your WordPress site description using the Drupal &lt;em&gt;'site_slogan'&lt;/em&gt; variable.&lt;/p&gt;

&lt;div class="code"&gt;&lt;pre class="code sql"&gt;
UPDATE wordpress.wp_options SET option_value = ( SELECT value FROM drupal.variable WHERE name='site_slogan') WHERE option_name = 'blogdescription';
&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Set the WordPress site email address.&lt;/p&gt;

&lt;div class="code"&gt;&lt;pre class="code sql"&gt;
UPDATE wordpress.wp_options SET option_value = ( SELECT value FROM drupal.variable WHERE name='site_mail') WHERE option_name = 'admin_email';
&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Set the WordPress permalink structure. Here we're using &lt;em&gt;/%postname%/&lt;/em&gt; but you may set it according your own needs.&lt;/p&gt;

&lt;div class="code"&gt;&lt;pre class="code sql"&gt;
UPDATE wordpress.wp_options SET option_value = '/%postname%/' WHERE option_name = 'permalink_structure';
&lt;/pre&gt;&lt;/div&gt;

&lt;h3&gt;Create URL redirects table&lt;/h3&gt;
&lt;p&gt;This table will not be used for the migration but may be useful if you need to manually create redirects from Drupal aliases. You will need the entries here for search engine optimisation (SEO) of your new WordPress site.&lt;/p&gt;

&lt;div class="code"&gt;&lt;pre class="code sql"&gt;
DROP TABLE IF EXISTS drupal.acc_redirects;
CREATE TABLE drupal.acc_redirects AS
	SELECT
		CONCAT('drupal/',
			IF(a.dst IS NULL,
				CONCAT('node/', n.nid),
				a.dst
			)
		) 'old_url',
		IF(a.dst IS NULL,n.nid, SUBSTRING_INDEX(a.dst, '/', -1)) 'new_url',
		'301' redirect_code
	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 (
		/* List the post types I migrated earlier */
			'page',
			'story',
			'blog',
			'video',
			'forum',
			'comment');
&lt;/pre&gt;&lt;/div&gt;

&lt;h2&gt;Finalising the conversion&lt;/h2&gt;
&lt;p&gt;Now that we've finished converting the content over from Drupal to WordPress, we have the rather (not very) fun job of checking the content, setting up any WordPress plugins and widgets, then finally going live. Depending on the complexity of your Drupal installation, this process can be extremely time-consuming and perhaps form a separate project in its own right.&lt;/p&gt;

&lt;h2&gt;Accepting limitations&lt;/h2&gt;
&lt;p&gt;Before finishing this article, one point I'd like to convey is the importance of accepting the limitations of any migration process. You, or your client, may be insistent on turning your new WordPress site into an exact copy of your former Drupal installation. While this may be technically possible, there comes a point of diminishing returns where the work you'd need to put in just isn't worth the value of the data.&lt;/p&gt;
&lt;p&gt;It may also be more productive in some instances to make manual adjustments via the WordPress control panel than to try anything clever using the backend database. Sometimes the time needed to write, test and debug MySQL queries far exceeds the boring but more reliable editing using the web-front end.&lt;/p&gt;
&lt;p&gt;Expect to kill your SEO if you're not careful with the migration. A site that relies heavily on revenue from search engine rankings will need extra steps to preserve SEO. This is a huge topic so I will not cover it here but you should carefully plan the conversion steps before starting with the migration. Pay particular attention to preserving Drupal path aliases, taxonomy listing pages and internal links.&lt;/p&gt;


&lt;h2&gt;Drupal to WordPress migration activity diagram&lt;/h2&gt;

This UML activity diagram illustrates the steps during the migration.

&lt;figure class="figure d-flex flex-column align-items-center"&gt;
    &lt;img src="https://migratecontent.com/images/Drupal-to-WordPress-migration-activity-diagram.png" alt="Drupal to WordPress migration process activity diagram" width="569" height="1081" class="figure-img img-fluid rounded"&gt;
    &lt;figcaption&gt;Drupal to WordPress migration process activity diagram created with &lt;a href="https://www.draw.io"&gt;draw.io&lt;/a&gt;.&lt;/figcaption&gt;
&lt;/figure&gt;

&lt;h2&gt;Migration steps listing&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;Prepare tables: This is where we reset the development database tables to a known state, ready for another migration pass.&lt;/li&gt;
&lt;li&gt;Delete unwanted vocabularies&lt;/li&gt;
&lt;li&gt;Delete unwanted terms&lt;/li&gt;
&lt;li&gt;Merge terms? Yes: go to step &lt;em&gt;a&lt;/em&gt;; No: go to step &lt;em&gt;5&lt;/em&gt;
&lt;ol style="list-style-type: lower-latin;"&gt;
&lt;li&gt;Create tables for each vocabulary to merge&lt;/li&gt;
&lt;li&gt;Create duplicate table for each vocabulary&lt;/li&gt;
&lt;li&gt;Make duplicate terms unique&lt;/li&gt;
&lt;li&gt;Merge terms&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;li&gt;Create tags&lt;/li&gt;
&lt;li&gt;Create categories and sub-categories&lt;/li&gt;
&lt;li&gt;Set uncategorized term&lt;/li&gt;
&lt;li&gt;Create posts from nodes&lt;/li&gt;
&lt;li&gt;Set posts and page types&lt;/li&gt;
&lt;li&gt;Associate posts with terms&lt;/li&gt;
&lt;li&gt;Update tag counts&lt;/li&gt;
&lt;li&gt;Set default category&lt;/li&gt;
&lt;li&gt;Migrate comments&lt;/li&gt;
&lt;li&gt;Migrate authors&lt;/li&gt;
&lt;li&gt;Site-specific settings and customisation: this would include WordPress site information settings and URL redirects&lt;/li&gt;
&lt;/ol&gt;



&lt;h2&gt;Good luck!&lt;/h2&gt;
&lt;p&gt;So that's it. A Drupal to WordPress migration can be a great deal of effort. I've had one project that initially looked like only couple of hours work balloon to over 50 billable hours in total. Previously installed modules caused problems requiring custom MySQL queries and PHP scripting to resolve. On the other hand, I've had a number of sites that completed in 15 minutes after running my Drupal to WordPress migration tool.&lt;/p&gt;
&lt;p&gt;Overall, the majority of my clients prefer WordPress over their previous Drupal site. I personally find WordPress quicker to update and manage. Any short-term hassles with migrating have been outweighed by the long-term advantages of easier maintenance.&lt;/p&gt;
&lt;h3&gt;Getting the code and submitting improvements&lt;/h3&gt;
&lt;p&gt;You can find the code on my &lt;a href="https://github.com/anothercoffee/drupal-to-wordpress"&gt;GitHub repository&lt;/a&gt;. The queries in this article can be found in the file &lt;a href="https://github.com/anothercoffee/drupal-to-wordpress/blob/master/drupaltowordpress-custom.sql"&gt;drupaltowordpress-custom.sql&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;I'd love to receive corrections, bug fixes and suggestions for improvements. Please &lt;a href="https://migratecontent.com/contact/"&gt;contact me&lt;/a&gt; or &lt;a href="https://github.com/anothercoffee/drupal-to-wordpress/issues"&gt;submit an issue&lt;/a&gt; on GitHub.&lt;/p&gt;

&lt;div class="alert alert-danger"&gt;
&lt;strong&gt;CAUTION:&lt;/strong&gt; Make a backup of both your Drupal and WordPress databases before running these queries. USE IS ENTIRELY AT YOUR OWN RISK. I'm offering this information with no warranty or support implied.
&lt;/div&gt;


&lt;section class="breakout-white"&gt;
&lt;div class="breakout-inner text-center"&gt;

&lt;h2&gt;Need Help With Your Drupal to WordPress Migration?&lt;/h2&gt;

&lt;p&gt;I specialise in complex Drupal to WordPress migrations using custom SQL scripts tailored to your site's specific data model. Get a free, no-obligation consultation to discuss your project.&lt;/p&gt;

&lt;div class="button-container" style="margin:2em 0;"&gt;
&lt;a class="cta-button" href="https://migratecontent.com/contact/" title="Get a quote for your Drupal to WordPress migration"&gt;Get a Free Quote&lt;/a&gt;
&lt;/div&gt;

&lt;/div&gt;
&lt;/section&gt;</description><category>database</category><category>drupal</category><category>migration</category><category>sql</category><category>wordpress</category><guid>https://migratecontent.com/drupal-to-wordpress-migration-sql-queries-explained/</guid><pubDate>Mon, 23 Jun 2014 15:43:18 GMT</pubDate></item><item><title>Drupal to WordPress migration notes</title><link>https://migratecontent.com/drupal-to-wordpress-migration-notes/</link><dc:creator>Anthony Lopez-Vito</dc:creator><description>These Drupal to WordPress migration notes are intended for clients who are handling some aspects of the migration themselves. Users of the &lt;a href="https://migratecontent.com/the-drupal-to-wordpress-migration-tool/"&gt;Drupal to WordPress Migration Tool&lt;/a&gt; or &lt;a href="https://migratecontent.com/drupal-to-wordpress-migration-sql-queries-explained/"&gt;MySQL queries&lt;/a&gt; might also find information here to resolve some problems.
&lt;h2&gt;Admin account password and email address&lt;/h2&gt;
Your content management system (CMS) administrator password and email address may have changed during the migration to help with debugging. Please update them as soon as possible.

Drupal and WordPress user passwords are encrypted and I do not have access to them in plaintext. However, for your peace of mind, I recommend that you also ask all your users to reset their passwords.
&lt;h2&gt;Server credentials&lt;/h2&gt;
Please remember to change any database, (S)FTP, SSH server and control panel credentials you may have given me.
&lt;h2&gt;Working tables&lt;/h2&gt;
During the migration process, I may create some working tables to hold temporary data. My naming convention for the working tables are as follows:
&lt;ul&gt;
 	&lt;li&gt;&lt;strong&gt;acc_ prefix:&lt;/strong&gt; these are working tables created to help with migrating data.&lt;/li&gt;
 	&lt;li&gt;&lt;strong&gt;backup_ prefix:&lt;/strong&gt; these are backups of existing tables prior to migration, for example from a previous installation of your CMS. These will not be altered during the migration process.&lt;/li&gt;
 	&lt;li&gt;&lt;strong&gt;_copy postfix:&lt;/strong&gt; duplicates of WordPress tables copied for debugging will have a _copy postfix. These are different from the backup_ tables in that they may have been manually altered.&lt;/li&gt;
&lt;/ul&gt;
These working tables are not used by WordPress so you may safely delete them. However, it's advisable to keep them for a short while as they may be useful in case we need to debug any issues that crop up.
&lt;h2&gt;Migrating to a live server&lt;/h2&gt;
Most Drupal to WordPress migrations are performed on a test or development server. For help on how to move WordPress to your live server, please see: &lt;a href="http://codex.wordpress.org/Moving_WordPress"&gt;WordPress Codex: Moving WordPress&lt;/a&gt;.
&lt;h2 id="troubleshooting"&gt;Troubleshooting common errors after a site migration&lt;/h2&gt;
Please see below for some common problems you may experience after migrating your Drupal content to a new WordPress site.
&lt;h3&gt;Incorrect domain in URLs&lt;/h3&gt;
WordPress stores domains in the database. If you performed the migration on a local or development server, there's a good chance that the links will be incorrect after migrating to your live server. Use the Interconnect IT utility to run a search and replace on your database. This will also correct changed database prefixes.

More information can be found on the interconnect/it &lt;a href="https://interconnectit.com/products/search-and-replace-for-wordpress-databases/"&gt;Search Replace DB page&lt;/a&gt;.
&lt;h3&gt;"Sorry, you are not allowed to access this page"&lt;/h3&gt;
If you try to log in via &lt;em&gt;wp-admin&lt;/em&gt; and receive this error, you may have overwritten the administrator user's &lt;em&gt;wp_capabilities&lt;/em&gt; or &lt;em&gt;wp_user_level&lt;/em&gt;.

Set the correct meta_value using the following SQL:
&lt;pre&gt;&lt;code&gt;UPDATE wp_usermeta 
    SET meta_value = 'a:1:{s:13:"administrator";s:1:"1";}'
    WHERE user_id = 1 AND meta_key = 'wp_capabilities';

UPDATE wp_usermeta 
    SET meta_value = '10'
    WHERE user_id  = 1 AND meta_key = 'wp_user_level';&lt;/code&gt;&lt;/pre&gt;
Remember to use the appropriate the &lt;em&gt;user_id&lt;/em&gt;.
&lt;h3&gt;"You do not have sufficient permissions to access this page"&lt;/h3&gt;
If you receive this error after logging in to your new WordPress installation, it's possible that the database prefix on your new WordPress site is not set correctly. This may happen if you move your WordPress installation to a host that uses a different database prefix.

Try running one of the queries below. Replace wp_new_usermeta, oldprefix_ and newprefix_ as appropriate.

Option 1:
&lt;div class="codelisting"&gt;
UPDATE wp_new_usermeta SET meta_key = REPLACE(meta_key,'oldprefix_','newprefix_');

UPDATE wp_new_options SET option_name = REPLACE(option_name,'oldprefix_','newprefix_');

&lt;/div&gt;
Option 2:
&lt;div class="codelisting"&gt;
update wp_new_usermeta set meta_key = 'newprefix_usermeta' where meta_key = 'wp_capabilities';

update wp_new_usermeta set meta_key = 'newprefix_user_level' where meta_key = 'wp_user_level';

update wp_new_usermeta set meta_key = 'newprefix_autosave_draft_ids' where meta_key = 'wp_autosave_draft_ids';

update wp_new_options set option_name = 'newprefix_user_roles' where option_name = 'wp_user_roles';

&lt;/div&gt;
Please note that these queries may not work for you. Success depends on your specific setup.

For more information, please see the following pages:
&lt;ul&gt;
 	&lt;li&gt;&lt;a href="http://wordpress.org/support/topic/you-do-not-have-sufficient-permissions-to-access-this-page-98"&gt;WordPress forums: You do not have sufficient permissions to access this page&lt;/a&gt;&lt;/li&gt;
 	&lt;li&gt;&lt;a href="http://stackoverflow.com/questions/13815461/you-do-not-have-sufficient-permissions-to-access-this-page-without-any-change"&gt;stackoverflow: You do not have sufficient permissions to access this page without any change&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;"Unable to establish database connection"&lt;/h3&gt;
The database credentials are correct but you see an "Unable to establish database connection" error. Check that wp_options table is not empty.
&lt;h3&gt;Allowed memory size exhausted&lt;/h3&gt;
&lt;ol&gt;
 	&lt;li&gt;Increase php.ini memory size&lt;/li&gt;
 	&lt;li&gt;Increase WP settings memory limit with:
&lt;div class="codelisting"&gt;
define('WP_MEMORY_LIMIT', '128M');&lt;/div&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;h3&gt;Post migrated but navigating to post shows blank page&lt;/h3&gt;
The post is visible in the dashboard but viewing it displays a blank (but themed) page. Manually saving it on the dashboard makes it appear.

It's possible that the problem posts need to be assigned to a category.
&lt;h3&gt;Post migrated but navigating to post shows 'Not found' error&lt;/h3&gt;
The post is visible in the dashboard but viewing it displays a 'not found' error. Manually saving it on the dashboard makes it appear.
&lt;ol&gt;
 	&lt;li&gt;Check that the url contains &lt;a href="https://migratecontent.com/drupal-wordpress-migration-seo#wordpress_permalink_constraints" title="WordPress permalink constraints"&gt;valid characters&lt;/a&gt; for a WordPress slug.&lt;/li&gt;
 	&lt;li&gt;Check that .htaccess is enabled in your Apache configuration&lt;/li&gt;
&lt;/ol&gt;
&lt;h3&gt;Link to author 404&lt;/h3&gt;
Posts exist but link to the author's post listing page is broken.

Check user_nicename in wp_users WordPress table. Make sure the nicename doesn't contain invalid characters such as spaces, periods.
&lt;h3&gt;Dashboard controls not visible after logging in&lt;/h3&gt;
If you are able to log in as an administrator user but do not see the Dashboard controls, check your table prefixes. If the table prefixes changed during the migration, you may have forgotten to update the &lt;em&gt;options&lt;/em&gt; and &lt;em&gt;usermeta&lt;/em&gt; tables.

Check where the old prefixes have been set:
&lt;pre&gt;&lt;code&gt;SELECT * FROM `wpnew_options` WHERE `option_name` LIKE '%wp_%';
SELECT * FROM `wpnew_usermeta` WHERE `meta_key` LIKE '%wp_%';&lt;/code&gt;&lt;/pre&gt;
Updated the prefixes. For example:
&lt;pre&gt;&lt;code&gt;UPDATE `wpnew_options` SET `option_name` = 'wpnew_user_roles' WHERE `option_name` = 'wp_user_roles';
UPDATE `wpnew_usermeta` SET `meta_key` = 'wpnew_capabilities' WHERE `meta_key` = 'wp_capabilities';
UPDATE `wpnew_usermeta` SET `meta_key` = 'wpnew_user_level' WHERE `meta_key` = 'wp_user_level';

UPDATE `wpnew_usermeta` SET `meta_key` = 'wpnew_user-settings-time' WHERE `meta_key` = 'wp_user-settings-time';
UPDATE `wpnew_usermeta` SET `meta_key` = 'wpnew_user-settings' WHERE `meta_key` = 'wp_user-settings';&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;Further help&lt;/h2&gt;
We'll be very happy to provide support you if have difficulties after migration. For a quotation, please &lt;a href="https://migratecontent.com/#contact"&gt;contact us&lt;/a&gt;. We also offer customised hosting and maintenance packages. Please ask for details.</description><category>database</category><category>drupal</category><category>migration</category><category>sql</category><category>troubleshooting</category><category>wordpress</category><guid>https://migratecontent.com/drupal-to-wordpress-migration-notes/</guid><pubDate>Wed, 22 Jan 2014 11:25:42 GMT</pubDate></item></channel></rss>