Closed (fixed)
Project:
phpBB2Drupal
Version:
master
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
7 Feb 2008 at 17:34 UTC
Updated:
22 Oct 2012 at 14:59 UTC
I have decided to separate this issue out from the port to Drupal 6 issue.
Currently the module uses a default ini_set of 1200 seconds to avoid timing out when importing data. There are still time outs. The answer should be to use the new batch api introduces in Drupal 6. "Should be" because I am finding it trickier to do than I probably should.
Attached is a patch to batch import the users. I have tried a few different ways, but nothing seems to work. Worse, I do not know what I am doing wrong.
The only place I can think of which may be wrong is the query to get the user id's:
$user_ids = db_query_range('SELECT user_id FROM %susers WHERE user_id > 2 ORDER BY user_id', $pre, $context['sandbox']['user_row'], $limit);
Any input will be helpful.
| Comment | File | Size | Author |
|---|---|---|---|
| phpbb2drupal_batch.patch | 3.3 KB | naheemsays |
Comments
Comment #1
naheemsays commentedI think I should qualify "nothing seems to work".
What happens, the batch operation starts, says "2 users processed", finishes a few seconds later and says 1 user imported.
It seems the batch (or the "while" loop) loops just twice instead of how ever many users there are. (the final tally is not from the score kept, but by reading the phpbb2drupal_temp_users table.)
I have also previously tried a different approach where the while loop,is outside the batch operation similar to:
But this caused an OOM as (I think) there were too many operations (one for each user). Additionally, I do not expect that code to work... I would expect it to load the same user over and over again.
Comment #2
andypostI'm going to test this
Comment #3
naheemsays commentedThe patch on this issue is probably useless. I never had much understanding of batch API.
Comment #4
andypostPatch does not working, I start to rework it.
My current project has 6k topics and 120k comments so without batch it's not possible to convert it.
Also I'm trying to add some kind of incremental updates if I could :)
Comment #5
meustrus commentedI see that you define a variable $user_count but add to $batch['progress']['max'] = $usercount
Comment #6
shadcn commentedAny progress on this?
Comment #7
JeremyFrench commentedThe module now uses migrate API which in turn uses batch api.