Hello friends!

Finally, working and well-tested migration utility that allows you to move Wordpress blog under Drupal CMS is here. This module supports Drupal 4.7 (4.6 version is not supported) and both Wordpress 1.5 and 2.0.

Some interesting features:

  • Posts, comments, categories, pages and users are migrated. wp2drupal respects unpublished and private settings so no non-public information will be revealed to unauthorized eyes after migration.
  • Module is highly configurable. You can, for example, specify node types of imported posts and pages, each imported string can be run through custom string handling function etc. To not harm usability, wp2module comes with well-thoughtout default values so you will typically only need to adjust a very few settings.
  • wp2drupal tries to make its best to handle strings and their character encoding right. For example, string are automatically „iconved“ if needed. You will appreciate this when your blog doesn't speak English.
  • wp2drupal module provides a very flexible URL redirection mechanism. It is not Apache-dependent and works very well on an arbitrary server platform (tested under IIS + isapi_rewrite). Redirection rules are stored in a database table so if you wish, you can build your own redirection script although the default one that simply works is provided out of the box.

There are also things that you should pay attention to:

  • This script is resource intensive. With hundreds of posts and comments, the script can easily exceed 30 second time limit that is usually assigned to PHP scripts. In these cases, you will need to enable set_time_limit() function to let migration process run longer than 30 seconds.
  • wp2module is ready for usual one-man-show blogs and can't handle multi-user mega-blogs.
  • Wordpress's custom meta-information (inserted in post creation form) are not migrated.

Currently, the project is hosted on my website ( http://www.borber.com/en/projects/wp2drupal ) where you can obtain the whole package. If you think that it would be useful to move it to contributed modules directory, I am not against.

Please leave a comment if you have problems, complaints or compliments :) Hope this will help you,

Borek

Comments

sillygwailo’s picture

I get the following error when at admin/wp2drupal/settings (which is the first step of the module).

Fatal error: Call to undefined function: stripos() in /home/richard/wp2drupal/wp2drupal.module on line 393

Looking at http://ca3.php.net/function.stripos it appears this is a PHP 5 function: any way to make this module compatible with PHP 4?

(Username formerly my full name, Richard Eriksson.)

Borek-1’s picture

I forgot to mention that wp2drupal was tested only on PHP 5. I published new version that includes little trick that adds stripos() function even to PHP 4 so now it could run. But even after stripos fix, you may encounter problems with iconv functions which are included by default only in PHP 5. So even though this module doesn't use advanced OOP features from PHP 5, I highly recommend you to use only this version. I know that you can't always influence installed version but I publicly state that I don't want to bother with multiple PHP versions. The ideal solution would be to add this module to contributed ones and allow collaborative development but I don't have any experience how this works on Drupal.org. Some volunteers to help me?

Borek, http://borber.com/

llawnroc’s picture

I'm trying to download this module and I keep getting an Error 500. Have you taken the file offline or am I doing something wrong??

Cheers

Borek-1’s picture

Sorry, that was a Drupal bug that emits .htaccess file even on Windows+IIS and this file interferred with IISPassword software installed on my host. Now I emptied .htaccess and the wp2drupal module is downloadable again with no problems.

Borek, http://borber.com/

llawnroc’s picture

Downloaded and works like a dream.
Thanks!

JhunyTheBoy’s picture

Used it just then without much fuss. Thanks!

mrpattoo’s picture

I keep getting this error when I hit the "Start Migration" button on the Settings tab.

Fatal error: Call to undefined function: file_put_contents() in /homepages/13/d100138871/htdocs/modules/wp2drupal/migrate.php on line 97

Am I doing something wrong?

Borek-1’s picture

I added some files from PHP_Compat PEAR package so the PHP 4 compatibility should increase. Please when you have a problem, download PHP_Compat package, add a corresponding file to 'php_compat' directory and add a require_once line at the top of wp2drupal.module.

I really want to make this module PHP4-compatible but I currently don't have enough time to test it (all my hostings are PHP 5). It would be great if someone could try the newest version and report if everything works fine.

Borek, http://borber.com/

mrpattoo’s picture

Got it working! Great Module! Thanks!

.carey’s picture

I have a WP site on Mydomain.org and would like to convert it to Drupal in the root on the same domain? (WP 1.5 (php 4) to Drupal 4.7)

Would it be best to intall Drupal on Test.Mydomain.org and do the migration and then somehow transfer the site and DB to Mydomain.org? (It's for a live site with about 400 posts.)

Any suggestion would be very appreciated.

(PS. I'm in the Blogger >> WP >> Drupal category also. Although I love WP, I'm at the point where I need more than a blog CMS; and with WP2Drupal, Drupal is more attractive than other CMSs.)

Borek-1’s picture

Hi, it's great that you are considering a move from WP to Drupal :)

My suggestion would be to install Drupal to some special folder (hmm, maybe 'drupal' ? :), migrate your blog using wp2drupal module and then create a .htaccess file (or httpd.ini for isapi_rewrite) that will do this: all requests to old WP paths (e.g. ?p=123) should be passed through untouched and all requests to Drupal resources should be redirected to 'drupal' directory.

Although it will be not trivial to migrate a blog under your conditions, I think that it can be done.

I hope this helped you,
Borek, http://borber.com/

.carey’s picture

Thanks for responding.

I went ahead and installed drupal on new.mydomain.org - like SavannahNOW did. (I did it shortly after I wrote the above post... I couldn't wait to play with drupal. :) )

I figure when I get the look and setup finished I'll use wp2drupal and then try to work it out so at least the old urls redirect to the newly migrated posts. I read somewhere pathauto is helpful.

I'll just put up an auto redirect for the main domain (mydomain.org) or something.

I'm more of a designer, so the need for .htaccess changes make my eyes glass over; so I'll be back.

Thanks for an invaluable plugin.

Marc Bijl’s picture

khanvanna’s picture

I've tried to import entries written using unicode(utf-8), and always get unreadable results(the posts become unreadable). How to solve this?

Borek-1’s picture

Hello, character encoding is always problematic part of the migration process. I tried hard to make everything work fine but if you encounter problems, my only advice is to try different settings again and again until you reach expected results.

The module *can* migrate non-English blogs - I've successfully migrated my Czech blog. You must only elaborate the right settings.

Borek, http://borber.com/

binodc’s picture

Is it possible to import 2 blogs one after another???

Borek-1’s picture

Hi, wp2drupal can import posts even into non-clean Drupal installation so it should be possible migrate two blogs consecutively. But this scenario was not tested and I advise you to test it first in some safe environment (i.e., not in your production server).

Borek, http://www.borber.com/

dz-1’s picture

I just wanted to say thank you for writing this updated module. Without this module a lot of people might not be willing to make the drupal switch, and I'm sure many people will appreciate your contribution!

This tool was the last step in a major conversion for me (which I am still hammering out).. I have now successfully brought over 1600+ posts and 50,000+ comments from Blogger+Haloscan to Drupal via a tool I wrote (and will share when I'm done) and your WordPress tool!

The only snag I see right now (other than fixing up some formatting in a couple posts) is that apparently all my posts were put in an 'uncategorized' category in WordPress, so now all my posts have this label next to it.. If anyone has any suggestions on how to quickly remove this category across all of my imported stories it would be appreciated!

Thanks again, I'll be sure to reference this topic when I writeup my final success story on converting from Blogger+Haloscan->Drupal!

Borek-1’s picture

Hi, I'm glad you liked my module. It should migrate categories as well so I'm not sure what is the source of your problems. From my experience, the easiest way to bulk update *something* is to use phpMyAdmin and a raw database access.

Borek, http://www.borber.com/

viniciusxp’s picture

Borek, your module works like a charm!

I'm setting up a test drupal install. I like a lot WordPress but I' d like to try something more powerfull. And Drupal seems to be the perfetct choice. I installed drupal, migrated the WP blog, and everything worked great... But all the images on the posts got lost. I do not know if the module was suposed to link the images or not. But it would be great to have such a possibility.

Thank you and keep doing the good work!

Borek-1’s picture

Thanks, I'm glad that you liked the module. I did not consider images a problem because I used absolute paths and they simply work. My suggestion is that you

1) either copy the whole folder with images to the corresponding relative path of your Drupal installation so they will work again

2) or use custom string transformation function during the migration process - you could then search for img tags and do whatever you want with the paths with regular expressions (although this would require some work)

I hope this will help you, Borek

mactoph’s picture

I wanted to clarify why the blog module is required before the posts can be imported-
I would like to have all of my posts imported into story nodes as it will be a single blog- my understanding is that the blog module is primarily for user blogs... is it required to bring the posts into the multi-user blog module?
Thanks for your work on this module-

Borek-1’s picture

I have to double-check once I have a time but it seems to me that this prerequisite is pointless. If you are in hurry, open the wp2drupal.module file and comment lines 550 to 552 out.

Thanks for this comment.

mactoph’s picture

... but in the version that I have (I think it is the latest) you need to comment out lines 548-550. Thanks.

Borek-1’s picture

Sorry, I looked into an old version. You're right.

felipebm’s picture

Great module,

altough I'm having some trouble with encoding it's a great work you have done here!!!

thanks again.

felipebm’s picture

I've found that if you check the "Empty database before migration" checkboxes it seems the routine will not recognices the $db_prefix in the settings.php file.
Lots of errors appear about not being able to find drupal sql tables that lack of prefixes.
Hope it helps and thanks for the great great job!

xainoo’s picture

I get an empty page!
when I finish with the settings I get that empty page!

Borek-1’s picture

Sorry for not answering for a long time. Currently, my life conditions are changing almost every day (I recenlty moved to another country) and I have no time maintaining wp2drupal module at the time. If you are experiencing any problems with "value added features" like database empying, the workaround is simple - don't use these features. For example, you can empty database simply by restoring the database state right after the installation and creation of the first user (use phpMyAdmin or similar tool). Considering the core features of wp2drupal module, I believe they work as intended.

Sorry for any inconveniences,
Borek

boytaichi’s picture

hi, i tried to use the module. but when i was trying to enable the module, it gave me the error message:

Fatal error: main() [function.require]: Failed opening required 'php_compat/file_get_contents.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/temp/public_html/modules/wp2drupal/wp2drupal.module on line 18

can you tell me why?

thanks

alpritt’s picture

Did you copy the entire folder into the modules directory or just the 'wp2drupal.module' file? You need to copy the entire folder.

boytaichi’s picture

hi, borek,
i have a 2 year run wp blog. your package is exactly what i need to transfer it to drupal. but i have some installation issues. i downloaded your module, and copied to mysite module directory. but when i open admin/module, it gives me the following error message,

Fatal error: main() [function.require]: Failed opening required 'php_compat/file_get_contents.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/mysite/public_html/modules/wp2drupal/wp2drupal.module on line 18

i'd really appreciate it very much if you can tell me how to fix this.

thanks,
erick

Borek-1’s picture

Hi Erick, I am convinced that the module should work correctly if you copy the entire wp2drupal directory under your 'modules' folder. Maybe you ran into some permission issues specific for your hosting environment so please make sure that the PHP interpretter can read the php_compat/file_get_contents.php file. If your problems persist, please make a local copy of your WP installation, run the migration process locally and then simply upload your Drupal database to the production environment.

Hope this will work for you,
Borek

boytaichi’s picture

sorry it is a little beyond my capability. i did copy the entire directory. i'm running drupal 4.7 hosted by bluehost.com. the site generally works, but whenever i install wp2drupal, i cannot open my admin/module without the above error messages.

joeshirley@drupal.org’s picture

I'm testing the beta for 5.x, loving it, and wanting to migrate my WP blog to it. Is there a direct way to do this, or would it be easier to migrate it to a separate 4.7 installation, then move it to 5? I'm no programmer but can follow basic instructions.

Borek-1’s picture

Hi Joe, I have not tested the module under 5.x and currently have no plans to do so. So the only safe way is to migrate to Drupal 4.7 and then upgrade to 5.0.

joeshirley@drupal.org’s picture

Thanks!

bennybobw’s picture

I recently modified the wp_migrate script (written for 4.6) to work with 4.7 and b2evolution. I didn't want anything, so I only imported posts and comments. I modified four tables: node, node_revisions, comments, and node_comment_status. Everything shows up okay, but now when I try to add a new node from the Drupal backend, I get a MySQL error. It seems as though Drupal is not generating a unique 'vip' in node_revisions.

Has anyone else come accross this problem? I looked through the Wp2Drupal code and didn't notice anything substantially different. You can read my full post here.

-bennybobw

p.s. Borek, good luck with the move. I moved from the US to Argentina about a year ago.

superjacent’s picture

Hi bennyboww, I'm in the same boat, need to convert wp and b2evolution to drupal. Do you have a working script that I could play with. It would be very greatly appreciated.

Steven Taylor
Melbourne Australia.

gordyhulten’s picture

I've got a WP 2.0.5 site that I'm trying to migrate to Drupal.

I'm using this wp2drupal module, but after Step 1, after clicking "Start Migration," my browser tries to load:

http://www.illinipundit.com/?q=admin/wp2drupal/results

I get a "Page not found."

I'm a noob, so please be gentle.

parajeff’s picture

You state:

"wp2drupal tries to make its best to handle strings and their character encoding right. For example, string are automatically „iconved“ if needed. You will appreciate this when your blog doesn't speak English. "

Perhaps that is true, but for a large number of people whose blogs mainly speak *only* English, having the module fail under PHP 4 and being unable to upgrade to PHP 5 because our hosting companies won't upgrade makes this a royal pain in the posterior. Making iconv an option would eliminate this problem, allow use by people who are using non-English characters, and open up the process to a lot more people.

Borek-1’s picture

Hi Jeff,

although iconv is needed only when WP encoding differs from UTF-8, I agree with you. You have 2 options of how to solve this problem right now:

1) Find _wp2d_iconv_if_needed() funcion in the migrate.php file and change it so it only contains "return $string;"

2) Do a migration locally and then upload the resulting database to the production server.

In many cases, iconv will make end users happier so I won't the code right now but I see your comment as relevant.

Regards,
Borek

parajeff’s picture

...and the advice.

I'll use the first approach. *gr*

parajeff’s picture

It worked fine once the wp2d_iconv_if_needed() function was edited...but you also have to comment out the error check for the iconv function in the wp2drupal.module itself or the module won't load the settings page. (Anyone doing this themselves, simply look for the line that begins:

// Condition 2: iconv function must be available

It should be line 557 in the module. Simply comment out the following error-check section (lines 558 through 561 in my copy of the module) and it will load fine and works a charm.

The only issue remaining is that it did not import any users from Wordpress to Drupal, and I thought it was supposed to do so. I explicitly mapped WP user one (the author of the blog posts in the WP setup, to Drupal user 2 (the new ID of the main blog posts). I did not map Drupal user #1 to anything in the settings, since that is a reserved superuser and should not be posting. I also did not do any other mappings, since only users 1 and 2 existed in the fresh Drupal install.

However, the WP blog had about 40 registered users, most of whom had made comments. They were not transferred over and the comments from all of them have "(not verified)" after them now. Did I miss something in the setup or simply misunderstand that users would be transferred too?

I can always give it a second try -- I'm too cautious to empty the WP database (and I have backups anyway), and wiping the Drupal install, reinstalling it and running the migration tool again correctly (if I botched something) isn't really a problem.

Thanks again.

Borek-1’s picture

I don't recall exactly how the user conversion works but maybe the problem is that WP and Drupal users are not in 1 to 1 relation (in WP, you have users 1 to 20 while in Drupal, you have users 1 to 21 because of the extra super user). Maybe it's a bug in wp2drupal but as I wrote, I have absolutely no time to do any bug fixes at a time (I'm really sorry for that).

My suggestion: create Drupal users manually and then define an explicit mappings. It will involve some work but if you are not a coder, it could be the only way to achieve what you want (if you are a coder, I would be happy if you could find a problem and send me a bugfix).

parajeff’s picture

...as soon as I have a chance. The conversion of the site from WP over into Drupal, with quite a few additions included (including some custom modules, module updates and adaptations) is keeping me busy at the moment.

Frankly, if the worst thing that happens is that 20 to 30 users have to re-register, then I'm personally going to be thrilled. *gr*

However, I'm curious as to whether the module can transfer multiple users without "pre-loading" them into Drupal and setting up a 1 to 1 mapping --- so I'll take a closer look at it as soon as I have this conversion done.

Thanks. The module as-is saved a lot of time just in transferring the posts, comments, and taxonomy structure over.

tcblack’s picture

Since the script doesn't work for drupal5.beta yet I'm planning a migration from Wordpress 2.x to a virgin drupal 4.7 board (with Path and Blog modules) and then an immediate upgrade to Drupal 5 when it goes gold.
In Drupal 5 will I need to enable the legacy module?
--
tcblack
- Truth Is Still Truth, Even If You Don't Believe It

valley-1’s picture

A great deal for business.
http://affiliatesexcel.com

I am not sure I am on the right thread but this seems to be the
most recent posting about Migrating from Wordpress to Drupal
using the WP2Drupal module.

I have installed everything and get this error when I try to Migrate

PHP Fatal error: Call to undefined function: _wp2d_custom_process_text() in /home/paratlan/paratlan-www/modules/wp2drupal-4.7.x-2006.06.23/migrate.php on line 913

Where is function _wp2d_custom_process_text() defined ?

function _wp2d_process_text($string) {
include_once(drupal_get_path('module', 'wp2drupal') . '/user-function.php');
$string = _wp2d_custom_process_text($string);
return _wp2d_iconv_if_needed($string);

}

Many thanks for pointing to a right thread if this is not the place

ktiedt’s picture

I just finished importing a wordpress database into Drupal 5.0 with very little modifications to the wp2drupal.module file and the addition of the wp2drupal.info file.

tarball of the entire wp2drupal directory is located here: http://dojotoolkit.org/~ktiedt/wp2drupal5.tar.gz just untar in your modules directory and enjoy!

note: there appears to be a bug in migrate.php that doesnt associate the vocabulary terms with the vocabulary id, however you can easily go in with phpMyAdmin and do an UPDATE `table_name` set vid=X where vid=0 to fix this

-Karl

Borek-1’s picture

I'm delighted to see this module converted to Drupal 5.0 (I wouldn't have time and energy to do it myself). Thank you VERY much!

Aren Cambre’s picture

This 5.0 version does not work with 5.0 RC1, even after disabling all nonessential modules.

After enabling it on the modules page, or after performing any operation with this module, the next page returned by Drupal is blank. This is what I get on the next successful page load (after changing my URL path to a page that previously loaded fine):
warning: Cannot modify header information - headers already sent by (output started at /[path info redacted]/modules/wp2drupal/wp2drupal.module:661) in /[path info redacted]/includes/common.inc on line 311.

([path info redacted] is my own statement. It really returned the entire path.)

I will see one of these statements for each time I tried to refresh the blank page.

The only non-Core-required modules loaded are Blog, Path, Taxonomy, and wp2drupal 5.x-1.0-beta. I previously had several non-Core modules enabled.

Yes, the wp2drupal directory has writes allowed.

Aren Cambre’s picture

I just reconfirmed that this module is broken in RC1. I cleared all my Drupal tables from my DB, created a fresh new install, and only enabled the wp2drupal module and the three it depends on. (Taxonomy was already enabled.) As soon as I hit submit on the modules page, I got the blank screen again.

Attempting to run the import also got me a blank screen.

silverwing’s picture

There are blank lines after the closing php tag in wp2drupal.module. Delete that last tag ? > and it should work.

silverwing
www.misguidedthoughts.com

Aren Cambre’s picture

Thanks, but it looks like this uncovered other bugs.

Looking at the code, line 504 of wp2drupal.module defines the tables to truncate. Then lines 859-862 of migrate.php creates individual array variables with the values as the names of the tables to be truncated. Then line 865 does the truncation on each table. Only problem is no drupal table prefix is used, so you get tons of table doesn't exist errors.

I also get errors in the INSERT INTO statements, where the module is trying to add permalink URLs to the redirection table. I think these are coming from line 580 of migrate.php. The INSERT INTO statements are using some table named wp2drupal, which of course would not exist nor make sense as a Drupal redirection table.

Other than those two issues, a cursory check suggests the blog content was successfully transferred over. But I can see it will take a couple of attempts to get it right because there are other conversions I need to do.

Aren Cambre’s picture

I think I've solved a lot of the bugs. I am not sure, but some of them could have been because of an incomplete conversion from 4.7. Once I am confident it's good, I will post a diff. So far I have edited migrate.php and wp2drupal.module.

Aren Cambre’s picture

I put a patch file for migrate.php at http://people.smu.edu/acambre/migrate.php.zip.

David Latapie’s picture

I wrote a tutorial for moving from Dotclear 2 to Drupal 5, via WordPress and extensibely used this discussion for it.

Feedback greatly appreciated. Thank you all for your contributions.

rdhender’s picture

Has anyone had luck using this on 5.5? I drop it in my module directory but it doesn't show up on the list. I've checked permissions and all the other usual suspects, but don't know enough about Drupal to troubleshoot from there.

- Editor's note - I found the error, it was an ftp issue.

webfusion’s picture

I get a fatal error:

Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 40865 bytes) in /home/webfusion/www/drupal/includes/database.mysql.inc on line 345

Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 1830 bytes) in /home/webfusion/www/drupal/includes/database.inc on line 152

I would greatly appreciate any ideas to overcome this error. Any ideas?

Borek-1’s picture

Hi, on big sites, memory is likely to be an issue. If your hoster doesn't allow you to allocate more memory, please run the migration process locally and then upload the resulting database.

Borek

webfusion’s picture

Thanks Borek for your reply and for putting out an AWESOME module. This module is absolutely strategic for Drupal, because in order to grow in needs to recruit from Wordpress users like me who have outgrown the competent but limited functionality that Wordpress offers. Actually, it would be a very good idea to include this module with every Drupal distribution -- virtually all the popular blogging platforms offer tools to import from competing solutions. Wordpress got big sucking users from Movable Type (especially when MT when commercial) and it could do it because it has always included an importing tool. Wordpress' user database is huge, and it will likely be the single source for new Drupal users, that's why this module is strategic for Drupal's growth (do you guys want Drupal to recruit new users? because some people here answer newbie questions with an attitude that is closer to a "go away" than a "welcome friend!").

Ok, hopefully other non-technical Wordpress users like me will see this thread and benefit from my experience converting from Wordpress to Drupal. Here's what I found:

1. Forget about Drupal 5 for now, this module works flawlessly with 4.7, so install that one.
2. Regardless of how "healthy" and clean you think your Wordpress database is, you would do well to convert it to UTF-8 (yes, even if it is already UTF-8) using a very simple tool called Unifier (you can download it from Download.com). The program is drag and drop simple, and it will repair the classic character encoding / collation salad that you end up with Wordpress after a while. Using the Unifier is key especially if you run a non-English blog with accents and the like, but it's also necessary if you have an English Wordpress database that you have migrated from different hosts and MySQL versions, because some hosts force a particular character set on the connection and that's when the mess begins, which is an insidious mess because you won't notice this in your Wordpress blogs (everything displays correctly) but you will see how messy it was when you convert to Drupal. Trust me, use the Unifier and save yourself time and frustration.
3. If you have a big database, or for whatever reason your host does not allocate enough memory for WP2Drupal module to complete the conversion correctly (as in the error I posted above), then you need to run the whole thing in your local machine like Borek suggested. Since this is totally out of the technical level of average Joe Wordpress users like me, I give you the solution: download (it's free) and install XAMPP for Windows from Apache friends. Then proceed to install Drupal on your local machine (it's a lot of fun), upload your unified Wordpress database, and run the conversion.
4. You will run into a hurdle when running WP2Drupal in your local machine because you don't need (and don't have) a password for your WP database name (your MySQL username will be 'root'). And yet WP2Drupal will require you to enter a password for the Wordpress database... the solution? Go into the php file of the module and look for that line requiring the wordpress database password, and change 'true' to 'false'. That way you will be able to run the conversion.
5. If the conversion timed out in your server, it will likely time out also in your local machine. So you need to look in the php file inside the WP2Drupal module for the number 500, which is the maximum number of seconds that the program can run. Make that a suitable bigger number, like 5000 or whatever. This way the conversion will not time out if you have a lot of posts and / or comments.

If you follow the recommendations above, WP2Drupal will then work flawlessly, it's marvelous to see how beautifully it opens the Drupal doors so that you can supercharge your blog with community-oriented functionality.

UNSOLVED MYSTERIES of the Wordpress to Drupal Migration:
1) retaining permalinks under Drupal and 2) implementing a cache as efficient as WP-Cache.

I still haven't figured out how to retain the exact Wordpress permalinks under Drupal, so perhaps some charitable soul can tell me (and the other WP users that will hopefully come to this thread for guidance in the future) how to do it, since it is very important to keep incoming links functional for links and search engines. Wordpress users will feel confident moving to Drupal if the permalinks remain exactly the same under Drupal. If you have an established blog, you don't want to lose years of SEO work or precious incoming links, so this is a must to get WP users to convert.

The other issue is really efficient cacheing, because the Wordpress user interested in migrating to Drupal is likely to have a very successful blog that has outgrown WP and is ready for the power of Drupal. Successful WP blogs invariably use the super efficient WP-Cache plugin (how efficient it is you ask? How about running an Alexa 3,000 site that burns 25GB of bandwidth a day on shared hosting like Dreamhost?), and it would be useful for WP users to know what is the Drupal equivalent. I've read about "throttle" in Drupal and cacheing, but something tells me those solutions are not as efficient as WP-Cache. I think the equivalent solution is the Boost module (actually looks like a port of WP-Cache, both write html to a file in disk for later retrieval) but I don't think that module is ready for primetime yet. So any clues on how to cache and prepare Drupal for high traffic after migrating from Wordpress would be appreciated.

superjacent’s picture

Forget about Drupal 5 for now, this module works flawlessly with 4.7, so install that one.

For Drupal 5 this works : http://drupal.org/node/108797

I agree with the use of XAMP (or similar), it's the only way to quickly test things.

A gotcha that got me. I uploaded the Drupal 5 database without indexing it first on my local machine. I had 460 blog posts (not many - others would have heaps more) and then attempted to index it using the default settings. The indexing on my host kept returning errors such as 'max_updates 20,000' reached and for the following hour no access possible to my site. After numerous support tickets with my host it was suggested to index on my local machine, then upload. I did this and everything is in sync and the index module only has to index new and/or modified entries (I believe).

___________________________

Steven Taylor
Melbourne, Australia.

http://superjacent.net/cms

Aren Cambre’s picture

The wp2drupal is trying to put the permalinks into a bogus table. See my posts above for a discussion of this and a patch.

Vyoma’s picture

This one:

Some interesting features:

Posts, comments, categories, pages and users are migrated. wp2drupal respects unpublished and private settings so no non-public information will be revealed to unauthorized eyes after migration.
Module is highly configurable. You can, for example, specify node types of imported posts and pages, each imported string can be run through custom string handling function etc. To not harm usability, wp2module comes with well-thoughtout default values so you will typically only need to adjust a very few settings.

And this one:

There are also things that you should pay attention to:
...
wp2module is ready for usual one-man-show blogs and can't handle multi-user mega-blogs.

Are sort of confusing to me. Could someone please clear it up? I mean, are the posts imported with inclusion of all user details or not?

And I have another senario:
I mean, I have a blog (a small one), but four of us are posting to it. I also have a Drupal site (4.7) up and running.
I have the Drupal running in the root:
http://mysiteurl.com/
And I have the Wordpress blog running at:
http://mysiteurl.com/blog/

Can I perform the import? Also, will I be able to redirect any requests for http://mysiteurl.com/blog/some-perma-link to http://mysiteurl.com/some-perma-link?

I would like to work on this before I move to Drupal 5.

d3p0’s picture

Thanks for contributing this module!

I was wondering if the author or anyone else was planning on developing it some more?

webfusion’s picture

Can anybody please explain how to migrate the permalinks?

Without them, the migration is a SEO disaster.

PS for Aren Cambre: it's not clear from your post how / if your patched file would help migrate the permalinks, and it looks like your thing only works for Drupal 5, not 4,7 which is what I'm using.

pejrm’s picture

This whole process is driving me nuts. I am not a developer and I am basically learning as I go. I have uploaded this module and tried it out and it doesn't work. Granted I tried with Drupal 5 and that is probably the reason it bombed out. My question is why the community can't get it together to release a straightforward module that can do the job without commenting some stuff from line something to line something or downloading some other package or doing a rain dance in Mandarin.

One of the reasons I have only one Drupal blog and 5 WP blogs is because it is such a mission to migrate. I would have thought that moving people across to Drupal would be a worthwhile effort (at least for those people who would like to make the move). I have a site I want to migrate across so I can build a better site on Drupal and it is beginning to look like this is an impossible task! It is all very well that the module works with 4.7 after some code somewhere is changed in some cryptic (for me) way but version 5 is better and that is what I would like to run my blogs in. One of my blogs has over 1 000 posts, this process has to work properly. Of course my frustration is based on the assumption that this sort of migration is technically possible. If we are at the technical limits of the platform and/or the developer community then just tell me and I'll stick with WordPress.

If not, please would someone post a working module for Drupal 5 so us idiots can upload the sucker, fill in some database details and click the magic button (and then see the magic happen)?

Please?

superjacent’s picture

I understand your frustration with importing and converting. Maybe this will help http://drupal.org/node/108797. It's not a module that resides within the Drupal framework. It's an .exe file (Windows) though the source can be compiled to Linux and/or Mac. I can't test the Linux or Mac compiled programs.

For my purposes I didn't bother copying categories across or users, as I was the only user. I'm sure I could tinker a little and account for multiple users and categories.

Whether this is of interest to you or not I think I'll tinker and account for users/categories anyway.

___________________________

Steven Taylor
Melbourne, Australia.

webfusion’s picture

Hello Steven, thanks for this contribution.

I have three authors though, and would like the categories converted to tags. Will you be modifying this program to enable that?

Also, what does your program do with WP permalinks? are those retained under Drupal at all?

Thanks again Steven for your contribution and help (especially since the Drupal community doesn't seem to think it's important to grow by helping WP users to convert to Drupal).

superjacent’s picture

I've posted a reply over at http://drupal.org/node/108797#comment-193629

___________________________

Steven Taylor
Melbourne, Australia.

webfusion’s picture

pejrm -- what you can do is to migrate to Drupal 4.7 (other than permalinks it works OK) and then upgrade to Drupal 5, which has an automated install. It's not ideal, but definitely beats trying to overcome all hurdles going straight to Drupal 5. Upgrading from 4,7 should be a seemless process on a new Drupal install.

pejrm’s picture

Thanks webfusion. My next question is where I can find a module that is complete and works. I have read a lot about deleting spaces and bits from various lines. I'd like to download a complete and working version of the module.

Aren Cambre’s picture

Is there any way this module could be entered into the Drupal system so that we can use the bug report and feature request system and use CVS and track different versions of the product? I think this product has grown too much for this kind of forum to be very effective.

Borek-1’s picture

Hi Aren,

I can feel your pain but to be honest, I have neither time nor energy to continue developing or maintaining this module. It served me a lot when I needed to convert my WP blog to the Drupal platform so I thought it would be good idea to let other people take advantage of my work. The source is GPL so you can take it, contribute it as an official Drupal module and continue developing it (I think it's a good basis for upcoming work) but I will not do it myself. Sorry for that.

Borek

Aren Cambre’s picture

I understand. I may start up a project then, even though I have no idea what I am doing. :-)

dahamsta’s picture

Has anyone tried this module with vbDrupal?

davidbessler’s picture

All I want to do is import the users from wordpress. I keep getting this error that the table watchdog does not exist. It is looking for it in the wrong database. It says wpdatabase.watchdog does not exist. My drupal databse is drupaldatabase ... shouldn't it be looking for watchdog there?

newswatch’s picture

I have the same problem too.

It is looking for the watchdog table in the WP database rather than Drupal.

Is there a way out?

-----------------------------
Subir Ghosh
www.subirghosh.in

twelliott’s picture

I just ran this on my old Wordpress blog and it went without a hitch!

Many Thanks.

Borek-1’s picture

Thanks for kind words.
Borek

raena’s picture

But I have the following problem:

Stats
There are currently 4,499 posts and 26,514 comments, contained within 29 categories.

This is on a shared hosting environment where I am not permitted to increase the script execution timeout. I crossed my fingers and tried, but it failed to complete.

I did a test on a much smaller Wordpress blog with fantastic results.

Do you have any suggestions about what to do here? I can back up the big fat database and make the conversion on my own machine, where I can screw about with the script timeout, and then export the converted database out to my hosted environment. But if you have any better ideas about what to do here I'd love to know about them.

Kind regards,
Raena

superjacent’s picture

You could try this http://drupal.org/node/108797#comment-203692 which leads to my information page http://superjacent.net/cms/?q=node/502

___________________________

Steven Taylor
Melbourne, Australia.
http://superjacent.net/cms

raena’s picture

I did see that! Unfortunately, I won't be able to get to a Windows box till Monday, when I'm onsite with a client. I don't think the client or my boss would be too impressed with me using their time to make my dorky site ;) Asides from that my options are to wait till I get my Windows box back or ask someone else -- haven't had the opportunity to ask someone

I know your program's there, though, and I'll be sure to let you know if it was helpful. :)

Kayla’s picture

Hi Raena- While I haven't done any conversions from WP to Drupal (I ended up on this thread because someone I know might convert a WP blog to Drupal, and I wanted to look into the possible methods), I might have some useful knowledge for this thread:

If you are on a Mac, you could install Drupal locally using MAMP. There are some earlier comments on this thread that address how you might use this conversion module locally on a Drupal 4.7 install. I do use MAMP and it's very useful for testing things out and learning. I do all my development locally now, which makes my newbie errors less stressful because I know my site is still up and running to the rest of the world. :)

Drupal 4.7 is not as slick as Drupal 5 for the install, but the only big differences are you need to edit the settings.php file yourself and you need to import a file in phpMyAdmin to set up the database instead of the installer doing it for you. This is all in the installation instructions that come in the download. Having to do more on your own is not all bad, as the skills are "transferable", so they will likely come in handy at a later date, especially if you are going to convert locally first and upload to shared hosting later.

Knowing this may help any feeling of dejection of not being able to go straight to Drupal 5 from what it sounds like. Drupal does evolve quickly in my experience, so upgrading as part of the introduction to Drupal means you can feel more confident and familiar with the process when you indeed need or desire to upgrade to the latest release in the future.

There's a great video tutorial on upgrading from Drupal 4.7 to 5 at Lullabot. The video also covers how to back-up and restore databases, which is very important. The video uses the Terminal for some of the tasks but as they explain what it is they are doing, I simply did these tasks the 'visual' way using the Finder without any problems.

.carey’s picture

I read somewhere on here -- although I can't remember where -- that it was recommended that large conversions be done on their local machine where the timeout can be increased. I read where one person did this and was successful - then they just imported their database to the database server.

Hope this info can be of use.

Carey

Yura Filimonov’s picture

How do I redirect all the blog requests to the moved-temporarily.php file, if
- the URLs had permalinks enabled
- URL were titles only
- the drupal is installed in the root

Thanks.

ktiedt’s picture

if you enabled the option when you did the migration yous imply need to put moved-permanently.php in your WP root (I renamed my old index.php to wp_index.php and renamed moved-permanently to index.php...) Occasionally you may find a URL from WP that doesnt map back to Drupal... you can edit the WP table in your database to add this by looking at the examples already inserted from the import script.

-Karl

Yura Filimonov’s picture

Thanks.

I did move WP, but didn't use the .php's.

I had (and have to) clean up the URL aliases that I created to match WP title creations.

Ah well. Sometimes I wish I knew PHP/SQL some =)

If you are the WP module creator, or if he's reading this, I'd suggest:
- keep it simple (no extra files in the root, etc)
- create aliases, based on WP urls (don't listen to pathauto URL creating rules or change them for the move)

I'd suggest keeping it as close to one button move as possible. That'd get way more people to Drupal than you can imagine. I have already converted a couple in last month =)

ktiedt’s picture

But I patched this module to work with 5.x when I moved from WP to Drupal... This mod works by creating a reference table say...

oldPath = path/to/my/latest/blog/entry newPath= node/123 and the moved-permanently.php file queries that WP->Drupal migration table that contains old/newPath and redirects the browser to that page of the Drupal install. It doesnt care so much for pathAuto *unless* you are trying to enforce the same paths on the new site as the old (although w/o pathauto you can still forward from WP install to Drupal) The aliases stored in the WP->DRupal migration table ARE based on your WP install (thats why it asks that you make your wp config file file available in the module directory) to help reduce the # of steps/inputs required from the admin.

From my experience, this module is as simple as it possibly can be... if you arent looking to redirect your old blog paths to Drupal, it practically is a 1 step procedure...

You shouldnt have to manually remap URL's... unless you missed some migration settings...

(I figured all this out (and made it work with 5.x) w/o ever touching Drupal prior to that weekend)

-Karl

Yura Filimonov’s picture

Hi, Karl

That's what I was talking about. You think creating a table is simple for someone who doesn't know MySQL and PHP? It needs to be implemented in the module.

It is kind of ironic that I've spent two days on moving my site to Drupal 4.7 and you say it is compatible with Drupal 5 (the updated Drupal was insisting on installing from scratch, though I pointed it to an existing database).

I had to rebuild the site from scratch lately, so it doesn't matter much now, anyway.

Also, are all requests redirected to WP2Drupal module or only requests coming from the old WP links? The latter should be more reasonable for Drupal, as they tend to grow quickly in size and visitors.

Why not create an option to create a .htaccess file with rewrite rules for smaller blogs? It'd reduce the overhead a bit (for smaller WP blogs).

Thanks for the module and keep up the work.

sodani’s picture

Karl - I'd love to see the patch that you used.

ktiedt’s picture

Its somewhere up there, its a link from dojotoolkit.org/~ktiedt/ IIRC.

-Karl

Borek-1’s picture

Hi Taron,

I am the author of wp2drupal but as stated above, I don't have any plans to maintain this module in the future. Karl did a fantastic job with migrating this module under Drupal 5 and I'm glad he shares my opinion that this module is well-designed and as simple as possible. (Although one can view the module as quite complex, it's mainly because the migrating from one CMS to another is difficult task by nature).

Regards,
Borek

Ron Williams’s picture

I have given 777 permissions to the /modules/wp2drupal directory of my drupal install, however I am unable to check the url redirection box. What else could cause this issue?

Ron Williams
http://ronwilliams.io/

dahamsta’s picture

Same here.

Brainwrap’s picture

...the actual import/conversion seems to work properly, but I can't check off the "enable redirection" box (it's still grayed out) even with 777 permission enabled on the wp2drupal directory.

Does the module have to be placed in the standard module directory instead of the sites/all directory, perhaps?

jelyon’s picture

[Issue resolved by author. (Specifically by migrating to WordPress MU. But for smaller blogs, this module worked great!)]

thumb’s picture

The module was easy to install, configure, and run. I was able to convert a WP 2.05 install directly to Drupal 5.1 multisite install. By the way, I installed the wp2drupal module in /sites/mysite.com/modules and it worked fine.

Ron Collins’s picture

i just tried wp2drupal with D4.7.7 and had problems. i can turn the module on but it doesn't appear in the admin menus and i can't get to /admin/wp2drupal as i read somewhere.

i am working with a new site so i can use a previous version of 4.7.x if necessary but i'd like to know which version people have had success with before trying others.

thanks,
ron

http://mostlywater.org

Ron Collins’s picture

i just tried with 4.7.6 which i assumed would have been tested given how long it has been the standard but i had the same result. no options on the admin menu and no page at /admin/wp2drupal.

suggestions? i'm using apache 1.3.33, php 5.2.2 and mysql 4.1.22-standard.

http://mostlywater.org

Borek-1’s picture

Hi ron

This module worked on Drupal 4.7 for many people and every "point release" should be security/bug fix only so this module should certainly work on 4.7.x. Maybe the problem is in your installation / configuration, it's really hard to say without any details.

Regards,
Borek

Ron Collins’s picture

it worked. seems that the directory needs to be writable which it doesn't mention in the help docs.

thanks for a great module that just saved me tonnes of time. i've done migrations of custom db oriented sites to drupal and it can take a while.

http://mostlywater.org

rhlowe’s picture

I transferred probably 30 or so posts in less than a second and it went off without a hitch.

findthejake’s picture

I can't get this to work at all. I keep getting a blank screen when I try to import it and then i go back and nothing has happened. I might be an idiot but would it be too much to ask for a walk-through for this... A very detailed walk-through

newswatch’s picture

I have a site in WP where there are thousands of custom fields. Now these need to be imported into Drupal as CCK fields.

Is there any way this module can do that?

-----------------------------
Subir Ghosh
www.subirghosh.in

Borek-1’s picture

The module was not programmed with this in mind, sorry. Some custom programming would be needed in this case.

Borek

deadlyminds’s picture

I tested it locally with Drupal 4.7 and migrated all my posts from Wordpress (2.2). Problem is I have several images in my wordpress blog that is not being migrated. Could you please tell me how to migrate the images as well. (the images in the WP blog are uploads). Thank you for this nifty little module

Borek-1’s picture

Hi, in my case, I've just left images on their original locations. Didn't have any problems at all.

Regards,
Borek

deadlyminds’s picture

Since I had tested the migration on my localhost I couldn't see the images. As you said, the image paths are pointing to my online server. I moved my drupal installation online (in place of my wordpress installation), preserved the image paths (which is usually www.yourdomainname.com/wp-content/uploads) and the images show up.

But the problem I see is that there is no release for Drupal 5.x. Hence I had to install a fresh copy of 4.7, use the module and then upgrade to 5.x.

Thanks for creating a very useful module.

Borek-1’s picture

Drupal 5-compatible version is available here: http://wp2drupal.teodorani.com/. Note that although it is based on my work, I've never tried it and can't really comment on whether it works fine or not but you can at least try it. And thanks for the kind words :)

Borek

deadlyminds’s picture

I'll try that one in my local installation and post the results..Thanks Borek

deadlyminds’s picture

Does the script work with the 2.3 version of wordpress? I had earlier tried this with wordpress 2.x and it works like a charm!. But recently I tried this on one other of my blogs running about 200 posts (Wordpress 2.3) and it throws up a lot of errors.

Also does this have a problem with nested categories in wordpress?

Jamie Holly’s picture

I never used this module, but I doubt it would work with WP 2.3. There were database changes that went in with how WP handled categories, plus 2.3 is when tags were introduced (and they combined both into a common terms table).

---------------------

HollyIT - Grab the Netbeans Drupal Development Tool at GitHub.

Hetta’s picture

This nifty import module works with wordpress 2.3.2:
http://drupal.org/project/wordpress_import
It has some limitations (it's possible I'd have used the wp2drupal script set if I used 2.0), but it's much much better than doing things by hand.

deadlyminds’s picture

It (Wordpress_import) works with WP 2.3 but it doesn't have the capabilities like this module(wp2drupal) - mapping content to categories and automatic URL redirection. But I found the wordpress_import much more easier and faster - it worked in the first click. But I haven't been able to import the content under a different URL say (localhost/blog or yourdomain.com/blog). Have put a support request, will have to wait..

For older versions of Wordpress, 2.2.x and prior, this module(wp2drupal) works like a charm - useful for multiuser blogs - as it correctly creates users and assigns the imported posts to them.

Cory Goodwin’s picture

I recently gave the module a test run, however, it didn't transfer over the tags into drupal category I created called tags. I'm sure it was my error and I will try it again to see if the tags transfer over the second time.

Question regarding redirects:

I looked up my site in Google and noticed that Google has indexed all of tags. Will the WP2Drupal also redirect the tag pages? Or should I create a vocab called tag and use pathauto to match the way my WP displayed the tags pages?

Question regarding redirect:
I currently use the Global Redirect module in conjunction to with pathauto. Does anyone know of a conflict with this module and the redirection of WP2Drupal?