Jump to content

Drupal import of Wordpress posts going badly...


Recommended Posts

Hi everyone, I have a rather interesting problem that I am currently at a loss for a solution to. Several months ago the company I work for put me on a project to move a site from Wordpress to Drupal (despite my objections). I was charged with the entire build out and with copying data from Wordpress to Drupal. I found a nice little module for Drupal that was supposed to take care of this for me and I set out to do the import.


At first I thought that the import had worked. All of the categories were copied, a bunch of stories were populated, everything looked good. Then we started to notice that it had imported only a little over 200 posts whereas the output xml file from Wordpress contained 1523 posts. So I set out to work on my own version of this tool. This time not making a module for Drupal, but simply using a few built in functions from Drupal to make this easier for me.


I wrote an script to take the parsed XML and put it into a specially organize array that attaches the comments to the posts and keeps all the attributes tracked and correct. That parsed out everything just fine and I see 1523 posts in the resulting array. Then I took pieces of that old Drupal module and made it work with my script. I pretty much rewrote the entire thing. The only thing I stuck with was the array formatting.


So I tried my data import and I wait... and I wait... and still waiting... finally it offers to let me download the script as if it was a downloadable file. I decided to save the file to my desktop. It has the same file name as my script and is completely empty despite output that should have started prior to the loop that inserts the posts into the database. If I leave the parser going, but disable the import I don't have this problem, it just outputs to the browser for me. When I check the database it indeed creates the new category list and vocabulary. It even imported 230 posts. But that is all it does. And I can't find any errors in the server log file.


I have attached my script to this, let me know if you have any ideas as to what is causing any of these strange behaviors please. I could really use some external insight.


[attachment deleted by admin]

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.