Posted by mikhailian on February 7, 2005 at 12:39am
Hope this is the right forum to post.
I recently make a phpbb2drupal conversion script for versions 2.0.11 and 4.5.2 of phpbb and drupal respectively. The script is based on an excellent hack by Fedor with a few modifications. It does not integrate BBcode modifications proposed by jasper but works on a fresh install (you should probably tweak the Admin user to be uid=1 manually) of drupal.
Here comes the link to the script and its htmlized version.
Comments
Oh, BTW
I will come to the FOSDEM and will drop by at the Drupal room.
Great script you've
Great script you've provided. I'm running mySQL version 3.23.54, which doesn't support sql variables (@) nor UPDATE statements that use mutiple tables, so I've written a php script which will do these things in php instead of sql.
I've got everything running, all users converted and all posts and comments. But there is still something wrong. It seems that drupal still think that the last node posted has nid=1, so it says that there are -11 new posts, and only the first forum post is available, untill I try posting a new post. I then get an error message, and the first and second post becomes available.
Same thing happen with comments.
the error looks like:
user error: Duplicate entry '8' for key 1
query: INSERT INTO drupal_node (status, moderate, promote, sticky, comment, title, body, format, uid, created, type, teaser, changed, nid) VALUES('1', '0', '1', '0', '2', 'test', 'test', '1', '1', '1109767512', 'forum', 'test', '1109767512', '8') in /hostroot/bredymer.dk/web/drupal/includes/database.mysql.inc on line 125.
user error: Duplicate entry '8' for key 1
query: INSERT INTO drupal_forum (nid, tid) VALUES (8, 2) in /hostroot/bredymer.dk/web/drupal/includes/database.mysql.inc on line 125.
warning: Cannot modify header information - headers already sent by (output started at /hostroot/bredymer.dk/web/drupal/includes/common.inc:344) in /hostroot/bredymer.dk/web/drupal/includes/common.inc on line 155.
When I check the tables with phpMyAdmin, everything looks fine.
I'm a drupal newbee, but I'm guessing that somewhere deepdown, drupal has stored which nid and cid that has been reached, and my script has failed to update this number to corrospond with the imported forum posts.
So I'm asking where this is stored, or if you (or anybody else) experienced something similar when developing phpbb2drupal.sql script.
Many thanks in advance
Mads
PS
See www.bredymer.dk/drupal if you want to see what i mean. If any one wants to see the php script just ask, but the code is very cluttered (I'll clean it up and post it when it's working okay)
How to fix
>Great script you've provided.
I just slightly modified an existing one.
As for the error, here is the fix:
Replace
UPDATE drupal_sequences SET id=@drupal_term_data_tid WHERE name='drupal_term_data_tid';UPDATE drupal_sequences SET id=@drupal_comments_cid WHERE name = 'drupal_comments_cid';
UPDATE drupal_sequences SET id=@drupal_node_nid WHERE name = 'drupal_node_nid';
UPDATE drupal_sequences SET id=@drupal_users_uid WHERE name = 'drupal_users_uid';
with
DELETE FROM drupal_sequences WHERE name="drupal_term_data_tid";
DELETE FROM drupal_sequences WHERE name="drupal_comments_cid";
DELETE FROM drupal_sequences WHERE name="drupal_node_nid";
DELETE FROM drupal_sequences WHERE name="drupal_users_uid";
INSERT INTO drupal_sequences (name,id) SELECT "drupal_term_data_tid", @drupal_term_data_tid;
INSERT INTO drupal_sequences (name,id) SELECT "drupal_comments_cid",@drupal_comments_cid;
INSERT INTO drupal_sequences (name,id) SELECT "drupal_node_nid",@drupal_node_nid;
INSERT INTO drupal_sequences (name,id) SELECT "drupal_users_uid",@drupal_users_uid;
I updated the script on my site and asked axel to update the script in the cvs of drupal as well.
I get this:
I get this:
Parse error: parse error, unexpected $ in /home/user/public_html/phpbb2drupal.php on line 933
Line 933 is the close php tag, ?>
phpbb 4.18 to fresh drupal 4.6.5
There is now a Drupal module
There is now a Drupal module to easily migrate the phpbb2 data. See http://drupal.org/node/57197 for the must up to date information.
--
http://www.reuniting.info/
Healing with Sexual Relationships.