After careful consideration I decided to migrate my small website from Drupal to WordPress. The main reason why I selected Drupal some Years ago was it’s modules and programmability. Actually I did not program it at all. But I did use some modules. Now, when Drupal 6.2 was superseded by Drupal 7 I just considered upgrading. Unfortunately almost all modules I did use were not Drupal 7 compatible.
Then I had this long irritation with my picture gallery. I have a Gallery2 installation, but it was not really nice experience. Too much hassle and I did not find a theme that I liked. Did not feel like making one too. I tried Gallery3 also, but it is not really ready. So I thought about getting gallery and website as one package. Unfortunately I did not find anything I liked for Drupal.
WordPress has a Gallery plugin that seems nice – NextGEN Gallery so WordPress migration was in order.
Installing WordPress and migrating DB was the easy part. As my site is small and does not have any customisations, I had to copy over posts, and some comments. No categories. I did find some tutorials and used one How to migrate from Drupal 5 to WordPress 2. As it is for older versions of Drupal and WordPress some database tables have changed. I use MySQL for database storage.
For a less manual option, take look at: http://modeling-languages.com/migrating-drupal-6-to-wordpress-3/
Steps I used:
- Prepare two databases in one server – drupal and wordpress.
- Log in as administrative user.
- Empty wordpress database tables from data:
use wordpress;
delete from wp_posts;
delete from wp_comments;
- I had no categories and its DB structure has changed, so I skipped this step.
- Copy over posts:
INSERT INTO wp_posts (id, post_date, post_content, post_title,post_excerpt, post_name, post_modified) SELECT DISTINCT n.nid, FROM_UNIXTIME(created), body, n.title,teaser, REPLACE(REPLACE(REPLACE(REPLACE(LOWER(n.title),' ', '_'),'.', '_'),',', '_'),'+', '_'), FROM_UNIXTIME(changed) FROM drupal.node n, drupal.node_revisions r WHERE n.vid = r.vid;
- Copy over Comments:
INSERT INTO wp_comments (comment_post_ID, comment_date, comment_content, comment_parent, comment_author, comment_author_email, comment_author_url) SELECT nid, FROM_UNIXTIME(timestamp), comment, thread, name, mail, homepage FROM drupal.comments;
- Finish up, those repeated steps are there just to make sure, post names get updated correctly:
UPDATE wp_posts set post_name = REPLACE(post_name, '__', '_');
UPDATE wp_posts set post_name = REPLACE(post_name, '__', '_');
UPDATE wp_posts set post_name = REPLACE(post_name, '__', '_');
UPDATE wp_posts set post_name = REPLACE(post_name, '__', '_');
UPDATE wp_posts set post_name = REPLACE(post_name, '_', '_');
Configuring WordPress to work almost the way I liked is another story. Some helpful plugins I use are:
Custom sidebars – to have a different sidebar on every category. Right now I just use different custom menu for every category and one if no post is selected.
NextGEN Gallery – for a simple photo gallery
Easy Theme and Plugin Upgrades – I have not seen it do any useful work actually, but lets wait and see.
The good thing is that I had to use a lot less plugins than on my old Drupal site. Good for future upgrades, I hope.
One last thing was redirecting old URL-s to new ones. This can be done in .htaccess file as shown in the following example:
<IfModule alias_module>
Redirect permanent /node/31 http://www.ogalik.ee/rpm-uninstall-packages-listed-more-than-once
</IfModule>
Hi, for a free and updated script to migrate from Drupal 6 to WordPress 3 you can check : http://modeling-languages.com/migrating-drupal-6-to-wordpress-3/
For a professional Drupal to WordPress Migration service (covering all your possible needs) check: http://wordpressdrupal.com/
I actually did find this page a couple of days after migrating the hard way. For whatever reason I did miss http://codex.wordpress.org/Importing_Content also.
For my case, using a couple of sql queries was not the problem. Setting up WordPress takes a lot more time.
I found this post is very useful. I had a Drupal site myself and I wanted to do conversion to WordPress.
I realized that the imported posts don’t retain proper category/taxonomy. How can I fix this? Thanks in advance
I did not and still do not use taxonomy. Maybe links posted in previous comments help?
Categories I did not import either – had to make them up anyway.
Both of them should be doable with a little bit of database structure investigation.
I am not a big fan of WordPress, as once I made the transition from basic CMS to Drupal, I had started liking Drupal, especially for the reason that it involves lot of coding.
Its been more than a decade since I had been developing websites and till now I had developed 1000’s of websites and most of them are using Drupal.