I used wp2drupal a while

I used wp2drupal a while back and have had terribe results trying to get the old WP urls to map to Drupal.

The main idea was to use .htaccess with a RedirectMatch directive that sent anything that looks like an old WP url to a script.

I kept the old WP table with slugs and dates, so the script tries to match the date from the old slug with a blog post in Drupal with the same date.

The MySQL query goes:

SELECT node.nid from wp_posts
JOIN node on wp_posts.post_date_gmt=from_unixtime(node.created)
WHERE wp_posts.guid like '%oregonlibraries.net/staff/?$uri'
OR wp_posts.guid like '%oregonlibraries.net/staff/index.php/$uri;

I set $uri from %ENV{'REQUEST_URI'} (er, in Perl).

I never really got it working, I think because I couldn't set up the .htaccess rules to allow for all of the various formats of wordpress urls I used over those few years.

staff/?.*
staff/p=[0-9]*
staff/.*

Part of my problem is that staff/.* matches a lot of non-blog posts on the site.

I ended up making the drupal 404 page include a search box and, nowadays, if I remember to look, I check the error logs and add aliases for old posts in the URL alias module.

I would love for someone to improve on this idea and/or show me how to do it right!

Reply

The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <blockquote>
  • Lines and paragraphs break automatically.
  • Web page addresses and e-mail addresses turn into links automatically.
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.