First of all, I am very glad as I was able to migrate a 600.000 posts forum running PostgreSQL. There are still a few Problems. Please find attached a patch.

diff -u phpbb2drupal-old/phpbb2drupal.module phpbb2drupal/phpbb2drupal.module
--- phpbb2drupal-old/phpbb2drupal.module	2009-03-07 15:41:22.000000000 +0100
+++ phpbb2drupal/phpbb2drupal.module	2009-03-09 17:59:05.000000000 +0100
@@ -324,7 +324,7 @@
   db_set_active('phpbb');
   $user_ids = db_query('SELECT user_id FROM %susers WHERE ( user_id > 2 AND user_type <> 2) ORDER BY user_id', $pre);
 
-  $user_count = db_result(db_query('SELECT COUNT(user_id) FROM %susers WHERE user_id > 2 ORDER BY user_id', $pre));
+  $user_count = db_result(db_query('SELECT COUNT(*) FROM %susers WHERE user_id > 2', $pre));
 
   if (!$user_count) {
       drupal_set_message(t('There were no users found: Aborting script'), 'error');
@@ -517,7 +517,7 @@
   db_set_active('phpbb');
   // topic_status == 2, Moved topics are duplicates don't import
   $topic_ids = db_query('SELECT topic_id FROM %stopics ORDER BY topic_id', $pre);
-  $topic_count = db_result(db_query('SELECT COUNT(topic_id) FROM %stopics ORDER BY topic_id', $pre));
+  $topic_count = db_result(db_query('SELECT COUNT(*) FROM %stopics', $pre));
   drupal_set_message(t('Found %topic_count topics: Beginning Import', array('%topic_count' => $topic_count)));
 
   // Import the topics into drupal
@@ -1103,4 +1103,4 @@
   }
 
   variable_set('phpbb2drupal_replace_url_successful', '1');
-}
\ No newline at end of file
+}

Kind regards,
Jean-Michel

Comments

naheemsays’s picture

Thanks.

A question - was the column name the problem or the "ORDER BY" (or both)? I would like to keep the order by if I can...

grub3’s picture

The ORDER BY was the problem. You can write SELECT COUNT(topic_id) FROM phpbb_topics or SELECT COUNT(*) FROM phpbb_topics
returns 42166

What do you mean by "I would like to keep the order". You are counting rows.

Maybe I miss something?

naheemsays’s picture

oops, my mistake. I confused myself over what queries these were and thought they were the SELECT ones where it would (not really) matter what order the users, topics etc were imported in.

grub3’s picture

Right, thanks. Go for select (*) which is the default parser method.

grub3’s picture

Status: Needs review » Reviewed & tested by the community

This patch is quite straigthforward. Was it commited to CVS? There are a couple of patches for PostgreSQL pending on my account and I would like to make sure that they are applied. So thanks for committing this patch. Bye.

naheemsays’s picture

Status: Reviewed & tested by the community » Fixed
grub3’s picture

Cool, thanks a lot.

Status: Fixed » Closed (fixed)

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