I've been trying with no success at importing a Wordpress (2.7.1) 14mb xml file I've uploaded to /sites/default/files/wordpress to my drupal 6.12. I keep getting this error:

Fatal error: Out of memory (allocated 51642368) (tried to allocate 809 bytes) in /home/solid1/public_html/ke2/sites/all/modules/wordpress_import/wordpress_import.module on line 809

I've tried increasing memory via my settings.php and also tried adding the 'ini_set('memory_limit', -1);' at the bottom line on my wordpress.import.module, same result. I've not tried tweaking my .htaccess and php.ini though, thought I'd ask around here first. Have no idea why it stops at line 809 either.

please help? Many thanks.

Comments

ghmercado’s picture

Managed to fix it by setting up xampp and hosting it locally on my PC. I only needed to edit php.ini, changing timeout to 0, and the process went smoothly. After a great deal of editing a bunch of posts (as to be expected after migrating any content from one site to another), I then exported the sql dump to my live server, and voila.

A few things:

  • When migrating wordpress authors (necessitating the creation of new users), why does it ask the author's email address? Why doesn't it just import the author's email addresses that are already there?
  • IMO the above process I mentioned (hosting it locally before taking it live) should be the de facto method of using this module, especially for xml files at least 5mb or more in size - indicating a relatively large number of posts to migrate. Like I said you're gonna have to do a bit of re-editing to fit the new theme etc., and may need to add a module or two to enhance / improve stuff, so might as well do it on localhost to save time and speed up the whole process. After which all you need to is migrate the db and you get everything done one time quick and clean. Just my 2 cents.
  • wonderful module. Without it I'd be trapped in Wordpress - which is excellent mind you, except that I've come to a point where it's not enough.

    finex’s picture

    Probably the whole process shouldn't import all nodes togheter. For example, I'm trying to import an XML (about 15Mb) with 8700 posts and 2000 comments, php memory limit is 256M and is not enough.

    Probably this module should manage memory better (not everyone can set php memory limit).

    I suggest to paginate the import process: the module could import 1000 records, for example, and after other 1000 records and so on...

    yrocq’s picture

    I started to work on a version 2 of the module which uses batch_api to segment the importation. Unfortunately, I currently haven't much time to work on this module.

    finex’s picture

    Good news :)

    lavamind’s picture

    Assigned: Unassigned » lavamind
    Status: Active » Fixed

    Branch API is implemented in branch 6.x-2.x-dev, it should fix these kinds of issues.

    finex’s picture

    Thanks. I will try in the next future.

    Status: Fixed » Closed (fixed)

    Automatically closed -- issue fixed for 2 weeks with no activity.