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
Comment #1
naheemsays commentedThanks.
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...
Comment #2
grub3 commentedThe 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?
Comment #3
naheemsays commentedoops, 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.
Comment #4
grub3 commentedRight, thanks. Go for select (*) which is the default parser method.
Comment #5
grub3 commentedThis 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.
Comment #6
naheemsays commentedFixed in 1.x branch: http://drupal.org/cvs?commit=182284
and in HEAD: http://drupal.org/cvs?commit=182288
Thanks!
Comment #7
grub3 commentedCool, thanks a lot.