views:

158

answers:

1

I have a wordpress site with 5k post and each post has average 25 comments. so 125k total nodes have to be added.

I need import those posts and comments into drupal 6 .

I have written a script to import those post/comments into drupal by drupal's cron service.

but the cron service keeps time out. because import 125k nodes one by one is very slow. what can i do to imporve drupal importing speed?

i am use drupal built in node_save(), comment_save() method to do it.

I have not find out a way to use customized SQL query to increase importing speed yet.

I am execute my script through drupals's cron.php, that mean even i have set 'max_execute_time' to unlimited, but that only affects PHP , apache server has it own time out setting.

PS:

comment is not node in drupal, but that mean, there are still a lot of comment_save() be called, that make this importing process very slow.

+5  A: 

Have you looked at the Wordpress Import Module?

http://drupal.org/project/wordpress_import

Usually in Drupal, someone has already done whatever you're looking for, wrote a tutorial, and 5 people have created a module to do the same exact thing. :D

xkingpin
that module does not mapping word press user into drupal , that why i have a customized solution, also, my problem is not about how to import wordpress post into drupal but speed of importing. checked that module's source code, it use node_save(), comment_save(), so use that module will not increase speed.
anru
is your cron hook running a query to select a limited number of articles / comments? 1. You could try to select a limited number each time cron runs or 2. you could install a fresh drupal install on your local pc, removing the apache/php timeout and running it as a one-time script (then importing your database on your live server)
xkingpin

related questions