Pligg importer for drupal 6.x broken
npdrigg - June 8, 2009 - 00:18
Description
Pligg importer for drupal 5.x used to work like a charm. But when I upgraded my drupal to 6.0 and wanted to reimport the pligg site to test out the features, I saw lot of errors while importing data into the database. Seems like the schema of some tables have changed and pligg importer hasn't been modified to take care of it. Is there fix for this already ?

#1
Changing to (hopefully) correct project.
#2
Hi,
I need the errors you get, or I won't be able to even look at the issue... please let me know.
Merc
#3
Hi,
I will need a _lot_ of help with this. Otherwise, I will have to mark it as won't fix. I can't chase Pligg's db structure really...
Merc
#4
These are the problems I am seeing:
1. user warning: Column count doesn't match value count at row 1 query: INSERT INTO node VALUES (24, 1287, 'drigg', 'Farming Solutions', 2, 1, 1187937151, 1209948954, 2, 1, 0, 0) in /home/arur/np-drigg/modules/drigg/drigg_pligg_import/drigg_pligg_import.module on line 388.
-- Seems like the node table in drupal has changed. node table had 12 columns in 5.x and in 6.x it has 15 columns
2. user warning: Column count doesn't match value count at row 1 query: INSERT INTO term_data VALUES (2, 'bangaladesh', '', 0) in /home/arur/np-drigg/modules/drigg/drigg_pligg_import/drigg_pligg_import.module on line 432.
-- some this broken here while populating term_data
3. After importing the pligg, none of the users can login with their old passwords. Seems like the authentication logic used in pligg and drigg are different. Is there a work around for it.
4. The import seems to put all the stories in "Published" section eventhough the stories were in "New Stories" section in Pligg.
#5
Hi,
Woops... so it IS broken!
Are you able to email me a small but functonal Db dump of a Pligg site please?
As for (3), I don't think there is a way around it -- what you need to do is send an email to each user giving the instructions to reset their password (it's easy in Drupal) so that they can come back in. It's actually impossible to fix this.
Number (4) seems nasty, but it should be fixed once I've fixed those queries.
Please email me privately the DB, and I will fix the importer!
Merc.
#6
Thanks a lot for the reply. Can you privately send me your email-id so that I can send you the mysql dump as an attachment.
#7
Hi,
Note to self: see email "from:raghu" to get db dump.
Merc.
#8
Hey again, Merc! Let's name today Patch Friday, shall we?
Originally, http://myhosting.com/ideas used Pligg. However, we decided to convert to Drigg. When I used the Drigg Pligg Import module, all sorts of errors occured, and the import was partially successfully. Thus, I took the time to fix up a lot of it.
I tested my changes quite thoroughly, but only against the original MyHosting Pligg site. Thus, I can't guarantee that others will have the same experience.
However, even if my changes aren't 100% successful for others, they should be quite helpful. I spent a lot of time examining the Pligg and Drigg database table structures, and correcting many SQL queries in the module.
I've attached two patches. The only difference between them is that drigg_pligg_import.with_log_messages.patch contains the log_msg() function, as well as a ton of log messages. This is useful if you want to know what the module's doing, and it makes debugging the module a whole lot easier.
Enjoy!
#9
Hi,
THANK YOU NICK!!
Really, THANK YOU!!
I changed the code a little so that it fits Drupal's standards, and added a bit to the error message. I don't have a way of testing this, can you please check this out of CVS and make sure that it works?
If you don't have CVS, please test the changed .module file in attach, which is the only things I committed!
Thanks a gain,
Merc.
#10
Hi Merc. I downloaded the new 2009-Jun-22 release of Drigg 6.x-1.x-dev, and had a look at your changes to my patch. They're all very straightforward, so I can't imagine anything going wrong.
Cheers,
Nick
SoftCom Inc
http://softcom.com
#11
Automatically closed -- issue fixed for 2 weeks with no activity.