<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
  <title>Adding Understanding</title>
  <subtitle>A place for those who add understanding to the world.</subtitle>
  <link rel="alternate" type="text/html" href="http://addingunderstanding.com/2008/02/migrate-a-wordpress-site-drupal"/>
  <link rel="self" type="application/atom+xml" href="http://addingunderstanding.com/node/1504/atom/feed"/>
  <id>http://addingunderstanding.com/node/1504/atom/feed</id>
  <updated>2008-05-18T10:35:48-06:00</updated>
  <entry>
    <title>Migrate a WordPress site to Drupal</title>
    <link rel="alternate" type="text/html" href="http://addingunderstanding.com/2008/02/migrate-a-wordpress-site-drupal" />
    <id>http://addingunderstanding.com/2008/02/migrate-a-wordpress-site-drupal</id>
    <published>2008-02-17T11:47:20-07:00</published>
    <updated>2008-05-18T10:35:48-06:00</updated>
    <author>
      <name>joshb</name>
    </author>
    <category term="Drupal" />
    <category term="WordPress" />
    <summary type="html"><![CDATA[<p>Recently I've been helping a few folks convert websites from <a href="http://wordpress.org/">WordPress</a> to <a href="http://drupal.org/">Drupal</a>. Presently this works for migrating to Drupal 5 so if you want a Drupal 6 site first migrate to Drupal 5 and then upgrade the site to Drupal 6.</p>
<p>There are a couple of different ways of approaching this task. In the distant past I've worked with <a href="http://www.borber.com/en/projects/wp2drupal">wp2drupal</a>. Those experiences are a distant enough memory that I can't speak to it one way or another. It does seem that it has been a while since that module was upgraded. On the other hand <a href="http://drupal.org/project/wordpress_import">Wordpress Import</a> is undergoing active development. One user I worked with in IRC was struggling with wp2drupal and found Wordpress Import to be very simple. Also a note that the Wordpress Import module has been updated since I've used it so some of the steps may not be necessary.</p>
<p>The process really couldn't be simpler. Start with an WordPress export of an extendedRSS file. With this in hand you'll need a Drupal site setup. The site can either be new or an existing site but these hints apply to using a new site. The import process is very simple you select the extendedRSS file and tell Drupal which WordPress users map to which Drupal users. With that done the data now resides in the Drupal database. Things are pretty good but there are a few tweaks that make things better. The creation time for the items has been set to the creation time from WordPress. However, the updated time is set to the time of the import. This really matters most if you have search enabled on your site. Search results show the time changed in the display.</p>
    ]]></summary>
    <content type="html"><![CDATA[<p>Recently I've been helping a few folks convert websites from <a href="http://wordpress.org/">WordPress</a> to <a href="http://drupal.org/">Drupal</a>. Presently this works for migrating to Drupal 5 so if you want a Drupal 6 site first migrate to Drupal 5 and then upgrade the site to Drupal 6.</p>
<p>There are a couple of different ways of approaching this task. In the distant past I've worked with <a href="http://www.borber.com/en/projects/wp2drupal">wp2drupal</a>. Those experiences are a distant enough memory that I can't speak to it one way or another. It does seem that it has been a while since that module was upgraded. On the other hand <a href="http://drupal.org/project/wordpress_import">Wordpress Import</a> is undergoing active development. One user I worked with in IRC was struggling with wp2drupal and found Wordpress Import to be very simple. Also a note that the Wordpress Import module has been updated since I've used it so some of the steps may not be necessary.</p>
<p>The process really couldn't be simpler. Start with an WordPress export of an extendedRSS file. With this in hand you'll need a Drupal site setup. The site can either be new or an existing site but these hints apply to using a new site. The import process is very simple you select the extendedRSS file and tell Drupal which WordPress users map to which Drupal users. With that done the data now resides in the Drupal database. Things are pretty good but there are a few tweaks that make things better. The creation time for the items has been set to the creation time from WordPress. However, the updated time is set to the time of the import. This really matters most if you have search enabled on your site. Search results show the time changed in the display.</p>
<p>Setting the updated time to the created time is a simple SQL query. Note that these examples are for MySQL.</p>
<p>UPDATE node n set n.changed=n.created;</p>
<p>This sets the changed time to the created time.</p>
<p>If as in one installation the blog module wasn't on at the time of import. So all of the WordPress blog stories came in as stories. This too is easy to change:</p>
<p>UPDATE node set type=&quot;blog&quot; WHERE type=&quot;story&quot;;</p>
<p>One other little change cleans things up considerably. When Wordpress Import does its magic it imports tags that contain hyphens instead of spaces. This too can be easily remedied with a SQL query. Note, however, that doing this will also remove hyphens from any tags that are supposed to have hyphens.</p>
<p>UPDATE term_data set name = replace(term_data, &quot;-&quot;, &quot; &quot;);</p>
<p>Note that if this is an existing database with some small amount of work it is possible to add WHERE clauses to these statements in order to limit the effects to the newly imported WordPress data.</p>
<p>For a before and after, as well as a look at some nice variations on a Drupal theme you can look at <a href="http://blog.notruebill.com/">No True Bill</a>(WordPress) and its migration to <a href="http://tomboone.com">TomBoone.com</a>(Drupal 6).</p>
    ]]></content>
  </entry>
</feed>
