Simple Machines Community Forum

SMF Support => Converting to SMF => phpBB => Topic started by: rejetto on August 22, 2006, 08:29:55 PM

Title: PHPBB2 - problem with MySQL
Post by: rejetto on August 22, 2006, 08:29:55 PM
SMF Version: SMF 1.1 RC3
was importing my phpbb2 with MySQL 4.1.20 and encountered in some SQL syntax errors.
the errors are in the form SUBSTRING(a AS b,c,d) AS b
to fix the problem i had to remove the first "AS b"
you can get the fixed sql file here: http://www.sendspace.com/file/q0ly0r
Title: Re: PHPBB2 - problem with MySQL
Post by: Kret on August 23, 2006, 03:52:08 AM
nice fix rejetto
php-nuke have same problem, u dont mind to fix that one as well  ;D
ppl have problems: http://www.simplemachines.org/community/index.php?topic=35853.msg693352#new
Title: Re: PHPBB2 - problem with MySQL
Post by: Person on August 23, 2006, 06:20:00 AM
Converting...
Converting topics... Unsuccessful!
This query:

    INSERT INTO `acentermedia_main`.smf_topics
    (ID_TOPIC, isSticky, ID_FIRST_MSG, ID_LAST_MSG, ID_MEMBER_STARTED, ID_MEMBER_UPDATED, ID_BOARD, ID_POLL, locked, numReplies, numViews)
    VALUES ('3', '0', '3', '32', '2', '2', '2', '', '0', '1', '370'),

...

Caused the error:

    Incorrect integer value: '' for column 'ID_POLL' at row 1



It's problem, that I can't insert "" as integer :(
Title: Re: PHPBB2 - problem with MySQL
Post by: H on August 23, 2006, 12:53:40 PM
Do you have any phpbb mods installed?
Title: Re: PHPBB2 - problem with MySQL
Post by: Person on August 23, 2006, 01:34:26 PM
No, just original version phpBB 2.0.21. & I have used fixed version of converter which is posted at top of post.
This fixed version has minor changes in SQL code.
Title: Re: PHPBB2 - problem with MySQL
Post by: Artyemy on August 23, 2006, 03:01:50 PM
Hello.
Sorry for my english. I am russian.
I have problem with MySQL script too. Here is what gives me while runing this script:

Converting ranks... Successful.
Converting groups... Successful.
Converting members... Successful.
Converting additional member groups... Successful.
Converting categories... Successful.
Converting boards... Successful.
Converting topics... Unsuccessful!
This query:
INSERT INTO `forum`.smf_topics
(ID_TOPIC, isSticky, ID_FIRST_MSG, ID_LAST_MSG, ID_MEMBER_STARTED, ID_MEMBER_UPDATED, ID_BOARD, ID_POLL, locked, numReplies, numViews)
VALUES ('3', '0', '12', '12', '2', '2', '5', '', '1', '0', '56'),
('4', '0', '13', '686', '4', '15', '15', '', '0', '35', '355'),
('5', '0', '14', '515', '6', '15', '15', '', '0', '21', '203'),
('6', '0', '19', '24', '8', '3', '15', '', '0', '3', '71'),
('7', '0', '26', '583', '4', '3', '14', '', '0', '5', '77'),
('8', '0', '35', '35', '2', '2', '16', '', '1', '0', '138'),
('10', '0', '54', '561', '2', '11', '16', '', '0', '87', '658'),
('11', '0', '56', '56', '3', '3', '14', '', '1', '0', '37'),
('14', '0', '63', '189', '2', '3', '17', '', '0', '32', '105'),
('15', '0', '76', '254', '20', '3', '15', '', '0', '7', '85'),
('16', '0', '85', '90', '3', '2', '18', '', '0', '3', '49'),
('17', '0', '123', '140', '2', '11', '17', '', '0', '5', '16'),
('18', '0', '166', '693', '15', '23', '13', '', '0', '37', '226'),
('19', '0', '167', '172', '15', '11', '14', '', '0', '1', '20'),
('20', '0', '178', '240', '15', '15', '11', '', '0', '10', '57'),
('21', '0', '179', '292', '15', '15', '8', '', '0', '13', '79'),
('22', '0', '216', '216', '2', '2', '17', '', '0', '0', '5'),
('24', '0', '227', '350', '3', '11', '16', '1', '0', '36', '216'),
('25', '0', '234', '253', '3', '11', '17', '', '0', '1', '8'),
('26', '0', '274', '352', '15', '11', '9', '', '0', '13', '63'),
('27', '0', '276', '652', '26', '23', '12', '', '0', '25', '159'),
('28', '0', '286', '567', '15', '15', '7', '', '0', '46', '237'),
('29', '0', '340', '610', '15', '23', '16', '', '0', '42', '291'),
('30', '0', '347', '462', '11', '11', '11', '', '0', '13', '78'),
('31', '0', '374', '408', '11', '2', '17', '', '0', '1', '10'),
('34', '0', '410', '492', '2', '15', '8', '', '0', '8', '40'),
('35', '0', '419', '699', '11', '2', '6', '', '0', '14', '63'),
('37', '0', '452', '605', '3', '11', '17', '', '0', '6', '23'),
('38', '0', '469', '697', '11', '2', '11', '', '0', '13', '66'),
('39', '0', '474', '659', '26', '26', '11', '', '0', '8', '59'),
('41', '0', '498', '600', '3', '3', '10', '', '0', '22', '114'),
('42', '0', '509', '579', '26', '26', '10', '', '0', '8', '44'),
('43', '0', '512', '638', '2', '3', '16', '', '0', '15', '107'),
('44', '0', '523', '545', '2', '3', '17', '', '0', '1', '8'),
('45', '0', '537', '546', '2', '3', '17', '', '0', '2', '7'),
('46', '0', '584', '648', '3', '2', '17', '', '0', '8', '22'),
('47', '0', '599', '603', '2', '11', '17', '', '0', '1', '6'),
('48', '0', '616', '645', '23', '2', '16', '', '0', '15', '104'),
('49', '0', '640', '649', '3', '2', '17', '', '0', '1', '7'),
('50', '0', '667', '671', '3', '2', '17', '', '0', '1', '3'),
('51', '0', '670', '683', '2', '11', '13', '', '0', '6', '24'),
('52', '0', '675', '685', '11', '15', '15', '', '0', '3', '23'),
('53', '0', '695', '696', '23', '3', '13', '', '0', '1', '6'),
('54', '0', '698', '698', '2', '2', '5', '', '0', '0', '1');
Caused the error:
Incorrect integer value: '' for column 'ID_POLL' at row 1

SMF version 1.1RC3
PHPBB version 2.0.21
MySQL version 5.0
Title: Re: PHPBB2 - problem with MySQL
Post by: Person on August 23, 2006, 03:17:28 PM
I think that you have the same problem.

When this problem will be resolved, I would like to know how can I mod it to set source charset for phpBB2 data, because I have problem with importing backup SQL script ... some Slovenian special chars won't work :(
Title: Re: PHPBB2 - problem with MySQL
Post by: Artyemy on August 23, 2006, 03:33:03 PM
Yes. I think too. It's only one difference. You have original PHPBB. And I have some mods installed in my PHPBB.
Title: Re: PHPBB2 - problem with MySQL
Post by: Ferny on August 23, 2006, 05:40:48 PM
Hi 8)

I wanted to move my old phpbb to SMF and during some tests I had some problems like this during phpbb 2.0.21 to SMF 1.1-RC2 conversion, so I made some modifications to the .sql file to fix them. Also I added the "converting smilies" function.

Now it works fine on MySQL 5.0.24 and SMF 1.1-RC2, but I've not tested it with the new 1.1-RC3 version. I have seen that there's a new version of phpbb converter (updated for 1.1-RC3), but it fails during conversion, so I can do the same changes to the new converter and post it. Give me a couple of days (maybe one) and I'll post the new .sql file and comment the changes I've made so that the responsible ones are informed.

Ferny
Title: Re: PHPBB2 - problem with MySQL
Post by: Person on August 23, 2006, 05:49:27 PM
Cool. I can't wait for it ;)

Thanks for help :)
Title: Re: PHPBB2 - problem with MySQL
Post by: Ferny on August 23, 2006, 06:12:56 PM
I get the same errors as rejetto. I'll use his fixed sql file to begin my tests.
Title: Re: PHPBB2 - problem with MySQL - another fix
Post by: kylratix on August 23, 2006, 07:32:12 PM
This one is running phpBB 2.0.19 and it has a bunch of duplicate entries in the phpbb_topics_watch table. UNIQUE for the win. Modifying rejetto's sql file in the first post with a GROUP BY statement will solve this. If you run into before updating, you'll have to truncate the corresponding smf table first to remove problem keys.

QuoteConverting topic notifications... Unsuccessful!
This query:

    INSERT INTO `smf`.smf_log_notify
    (ID_MEMBER, ID_TOPIC)
    VALUES ('3', '2'),
    ('2', '3'),
    ('3', '4'),
    ('10', '10'),
[ed. ....]
    ('12', '360'),
    ('16', '360'),
    ('12', '361');

Caused the error:

    Duplicate entry '3-2-0' for key 1

New code:
/******************************************************************************/
--- Converting topic notifications...
/******************************************************************************/

TRUNCATE {$to_prefix}log_notify;

---* {$to_prefix}log_notify
SELECT user_id AS ID_MEMBER, topic_id AS ID_TOPIC
FROM {$from_prefix}topics_watch
GROUP BY ID_MEMBER, ID_TOPIC;
---*

/******************************************************************************/


Title: Re: PHPBB2 - problem with MySQL
Post by: Person on August 24, 2006, 02:46:09 AM
Quote from: Ferny on August 23, 2006, 06:12:56 PM
I get the same errors as rejetto. I'll use his fixed sql file to begin my tests.

This are differences: [133 - line number, * - original file, # - rejetto's sql file]

133  
* SUBSTRING(u.user_email AS emailAddress, 1, 255) AS emailAddress, 
# SUBSTRING(u.user_email, 1, 255) AS emailAddress,
135  
* SUBSTRING(u.user_msnm AS MSN, 1, 255) AS MSN, 
# SUBSTRING(u.user_msnm, 1, 255) AS MSN,
136  
* SUBSTRING(u.user_aim AS AIM, 1, 16) AS AIM, 
# SUBSTRING(u.user_aim, 1, 16) AS AIM,
367  
* SUBSTRING(uf.username AS fromName, 1, 255) AS fromName, 
# SUBSTRING(uf.username, 1, 255) AS fromName,


+ rejetto's sql file has one blank line at end (nothing special)
Title: Re: PHPBB2 - problem with MySQL
Post by: MrPrise on August 24, 2006, 08:26:51 AM
Thank you for the fix. I was looking for that! ;-)
Maybe the SMF team should upgrade the script at the download section.
Title: Re: PHPBB2 - problem with MySQL
Post by: MrPrise on August 24, 2006, 12:13:02 PM
The converter script removes the first character of the signatures.
Title: Re: PHPBB2 - problem with MySQL
Post by: Ferny on August 24, 2006, 12:42:45 PM
I downloaded phpBB2 to SMF 1.1-RC3 converter from http://www.simplemachines.org/download/?converters It contains two files, convert.php and phpbb2_to_smf.sql




File convert.php is not correct, it has some bugs. I've used the file which is attached at first post here, which has this bugs solved:
http://www.simplemachines.org/community/index.php?topic=65677.0 It works fine, but I noticed that there're a lot of empty lines (all even lines are empty), so I deleted them and I've attached the corrected file here: http://ultrashare.net/hosting/dl/be9a33aad3

Also I updated the following line at the beginning (changed RC2 to RC3):
* Software Version:           SMF 1.1 RC3                                     *

I think the converter should be updated with this new file.




File phpbb2_to_smf.sql works fine if we apply rejetto's modifications. I've not applied kylratix's modification, but It can be added. This sql file has solved the errors I've experimented on RC2 converter, so only it's necessary to apply this modifications.

But if somebody likes to import smilies, should do the following change in sql file:

After:
/******************************************************************************/
--- Converting groups...
/******************************************************************************/

---* {$to_prefix}membergroups
SELECT
SUBSTRING(CONCAT('phpBB ', group_name), 1, 255) AS groupName,
-1 AS minPosts, '' AS stars, '' AS onlineColor
FROM {$from_prefix}groups
WHERE group_single_user = 0;
---*


Add:

/******************************************************************************/
--- Converting smileys...
/******************************************************************************/

---# Copying over smilies directory...
---{
function copy_smilies($source, $dest)
{
if (!is_dir($source) || !($dir = opendir($source)))
return;

while ($file = readdir($dir))
{
if ($file == '.' || $file == '..')
continue;

// If we have a directory create it on the destination and copy contents into it!
if (is_dir($source . '/' . $file))
{
@mkdir($dest . '/' . $file, 0777);
copy_dir($source . '/' . $file, $dest . '/' . $file);
}
else
copy($source . '/' . $file, $dest . '/' . $file);
}
closedir($dir);
}

// Find the path for phpBB smileys.
$request = convert_query("
SELECT config_value
FROM {$from_prefix}config
WHERE config_name = 'smilies_path'
LIMIT 1");
list ($phpbb_smilies_path) = mysql_fetch_row($request);
mysql_free_result($request);

// Find the path for SMF smileys.
$request = convert_query("
SELECT value
FROM {$to_prefix}settings
WHERE variable = 'smileys_dir'
LIMIT 1");
list ($smf_smileys_dir) = mysql_fetch_row($request);
mysql_free_result($request);

$phpbb_smilies_path = $_POST['path_from'] . '/' . $phpbb_smilies_path;
copy_smilies($phpbb_smilies_path, $smf_smileys_dir . "/default");
---}
---#

---* {$to_prefix}smileys
SELECT code AS code, smile_url AS filename, emoticon AS description
FROM {$from_prefix}smilies;
---*


It adds all phpbb smilies to smf default set


Ferny
Title: Re: PHPBB2 - problem with MySQL
Post by: SBGamesCone on August 24, 2006, 12:54:38 PM
Thanks Ferny, that is a welcome modification.
Title: Re: PHPBB2 - problem with MySQL
Post by: Ferny on August 24, 2006, 12:59:58 PM
Quote from: MrPrise on August 24, 2006, 12:13:02 PM
The converter script removes the first character of the signatures.

Not only there but also in the avatar field of members table, making avatars not to work (only if avatars are type 3, those which are in phpBB's gallery)

The following changes in sql file should fix it:

Find the following and change the 1 to 0
$row['avatar'] = substr('gallery/' . $row['avatar'], 1, 255);

Find the following and change the 1 to 0
$row['signature'] = substr($row['signature'], 1, 65534);


Ferny
Title: Re: PHPBB2 - problem with MySQL
Post by: Person on August 24, 2006, 01:26:08 PM
Still this error  :(

QuoteConverting topics... Unsuccessful!
This query:

    INSERT INTO `acentermedia_main`.smf_topics
    (ID_TOPIC, isSticky, ID_FIRST_MSG, ID_LAST_MSG, ID_MEMBER_STARTED, ID_MEMBER_UPDATED, ID_BOARD, ID_POLL, locked, numReplies, numViews)
    VALUES ('3', '0', '3', '32', '2', '2', '2', '', '0', '1', '370'),
    ('4', '0', '4', '118', '2', '2', '1', '', '0', '10', '1318'),
    ('5', '0', '6', '81', '3', '2', '2', '', '0', '27', '2207'),
    ('6', '0', '14', '2822', '3', '27', '2', '', '0', '34', '5462'),
    ('7', '0', '19', '139', '4', '4', '6', '', '0', '2', '483'),
    ('8', '0', '23', '328', '3', '3', '2', '', '0', '6', '815'),
    ('9', '0', '24', '102', '3', '4', '7', '', '0', '3', '48'),
    ('10', '0', '42', '46', '2', '4', '6', '', '0', '1', '292'),
    ('12', '1', '59', '2774', '3', '4', '2', '', '0', '9', '1237'),
    ('13', '0', '87', '280', '4', '4', '3', '', '1', '83', '5912'),
   

Caused the error:

    Incorrect integer value: '' for column 'ID_POLL' at row 1

:(
Title: Re: PHPBB2 - problem with MySQL
Post by: MrPrise on August 24, 2006, 01:40:31 PM
Quote from: Ferny on August 24, 2006, 12:59:58 PM
Not only there but also in the avatar field of members table, making avatars not to work (only if avatars are type 3, those which are in phpBB's gallery)

The following changes in sql file should fix it
Thanks for the fix. I have a new problem. The convert doesn't try to convert birthdays.
I have PHPBB2 Plus and that stored the date as int( 8 ), SMF stored as date. Basically the fix is the date() PHP func, but I dont see where to put that, yet.

EDIT: the PHPBB2 without plus doesn't have birthday field, so this is not bug.
Title: Re: PHPBB2 - problem with MySQL
Post by: MrPrise on August 24, 2006, 01:45:16 PM
After the convert finished, it starts to "Recalculating forum statistics..." It takes a very long time, maybe forever?
Title: Re: PHPBB2 - problem with MySQL
Post by: Ferny on August 24, 2006, 04:04:33 PM
QuoteAfter the convert finished, it starts to "Recalculating forum statistics..." It takes a very long time, maybe forever?

It's a bug, see my post about convert.php above ;)
Title: Re: PHPBB2 - problem with MySQL
Post by: MrPrise on August 24, 2006, 04:09:02 PM
Quote from: Ferny on August 24, 2006, 04:04:33 PM
QuoteAfter the convert finished, it starts to "Recalculating forum statistics..." It takes a very long time, maybe forever?

It's a bug, see my post about convert.php above ;-)
Ahh. Now, it is ok. Thank you!
Title: Re: PHPBB2 - problem with MySQL
Post by: Ferny on August 24, 2006, 04:12:46 PM
Quote from: Person on August 24, 2006, 01:26:08 PM
Still this error  :(

QuoteConverting topics... Unsuccessful!
This query:

    INSERT INTO `acentermedia_main`.smf_topics
    (ID_TOPIC, isSticky, ID_FIRST_MSG, ID_LAST_MSG, ID_MEMBER_STARTED, ID_MEMBER_UPDATED, ID_BOARD, ID_POLL, locked, numReplies, numViews)
    VALUES ('3', '0', '3', '32', '2', '2', '2', '', '0', '1', '370'),
    ('4', '0', '4', '118', '2', '2', '1', '', '0', '10', '1318'),
    ('5', '0', '6', '81', '3', '2', '2', '', '0', '27', '2207'),
    ('6', '0', '14', '2822', '3', '27', '2', '', '0', '34', '5462'),
    ('7', '0', '19', '139', '4', '4', '6', '', '0', '2', '483'),
    ('8', '0', '23', '328', '3', '3', '2', '', '0', '6', '815'),
    ('9', '0', '24', '102', '3', '4', '7', '', '0', '3', '48'),
    ('10', '0', '42', '46', '2', '4', '6', '', '0', '1', '292'),
    ('12', '1', '59', '2774', '3', '4', '2', '', '0', '9', '1237'),
    ('13', '0', '87', '280', '4', '4', '3', '', '1', '83', '5912'),
   

Caused the error:

    Incorrect integer value: '' for column 'ID_POLL' at row 1

:(

This should fix it

Find in sql file:
/******************************************************************************/
--- Converting topics...
/******************************************************************************/

TRUNCATE {$to_prefix}topics;
TRUNCATE {$to_prefix}log_topics;
TRUNCATE {$to_prefix}log_boards;
TRUNCATE {$to_prefix}log_mark_read;

---* {$to_prefix}topics
SELECT
t.topic_id AS ID_TOPIC, t.topic_type = 1 AS isSticky,
t.topic_first_post_id AS ID_FIRST_MSG, t.topic_last_post_id AS ID_LAST_MSG,
t.topic_poster AS ID_MEMBER_STARTED, p.poster_id AS ID_MEMBER_UPDATED,
t.forum_id AS ID_BOARD, v.vote_id AS ID_POLL, t.topic_status = 1 AS locked,
t.topic_replies AS numReplies, t.topic_views AS numViews
FROM {$from_prefix}topics AS t
LEFT JOIN {$from_prefix}posts AS p ON (p.post_id = t.topic_last_post_id)
LEFT JOIN {$from_prefix}vote_desc AS v ON (v.topic_id = t.topic_id)
/* // !!! WHERE t.topic_moved_id = 0 */
GROUP BY t.topic_id
HAVING ID_FIRST_MSG != 0
AND ID_LAST_MSG != 0;
---*


Find:
v.vote_id AS ID_POLL

Replace it:
IF(v.vote_id <> 0, v.vote_id, 0) AS ID_POLL

I got this error converting one of my forums and it was solved. In other forum was not necessary. I recommend to do this change to be sure that the conversion doesn't fail
Title: Re: PHPBB2 - problem with MySQL
Post by: Ferny on August 24, 2006, 04:34:56 PM
Another fix. While converting posts, if you see an error involving column 'modifiedTime', you should apply this fix:

Find
/******************************************************************************/
--- Converting posts (this may take some time)...
/******************************************************************************/

TRUNCATE {$to_prefix}messages;

---* {$to_prefix}messages 200
---{
$row['body'] = preg_replace('~\[size=([789]|[012]\d)\]~is', '[size=$1px]', $row['body']);
---}
SELECT
p.post_id AS ID_MSG, p.topic_id AS ID_TOPIC, p.post_time AS posterTime,
p.poster_id AS ID_MEMBER,
SUBSTRING(IFNULL(u.user_email, ''), 1, 255) AS posterEmail,
SUBSTRING(IF(IFNULL(pt.post_subject, '') = '', t.topic_title, pt.post_subject), 1, 255) AS subject,
SUBSTRING(IF(IFNULL(p.post_username, '') = '', u.username, p.post_username), 1, 255) AS posterName,
p.enable_smilies AS smileysEnabled, p.post_edit_time AS modifiedTime,
CONCAT_WS('.', CONV(SUBSTRING(p.poster_ip, 1, 2), 16, 10), CONV(SUBSTRING(p.poster_ip, 3, 2), 16, 10), CONV(SUBSTRING(p.poster_ip, 5, 2), 16, 10), CONV(SUBSTRING(p.poster_ip, 7, 2), 16, 10)) AS posterIP,
SUBSTRING(REPLACE(REPLACE(IF(pt.bbcode_uid = '', pt.post_text, REPLACE(REPLACE(REPLACE(pt.post_text, CONCAT(':u:', pt.bbcode_uid), ''), CONCAT(':1:', pt.bbcode_uid), ''), CONCAT(':', pt.bbcode_uid), '')), '\n', '<br />'), '"', '"'), 1, 65534) AS body,
p.forum_id AS ID_BOARD, '' AS modifiedName, 'xx' AS icon
FROM ({$from_prefix}posts AS p, {$from_prefix}posts_text AS pt, {$from_prefix}topics AS t)
LEFT JOIN {$from_prefix}users AS u ON (u.user_id = p.poster_id)
WHERE pt.post_id = p.post_id
AND t.topic_id = p.topic_id;
---*


Find:
p.post_edit_time AS modifiedTime

Replace it:
IF(p.post_edit_time > 0, p.post_edit_time, 0) AS modifiedTime

Also I got this error in one forum but not in other...
Title: Re: PHPBB2 - problem with MySQL
Post by: Person on August 24, 2006, 04:40:50 PM
While you're typing about second bug I have found it too.

Now, it's better, but I have this problem:
QuoteConverting topic notifications... Unsuccessful!
This query:

    GROUP BY ID_MEMBER, ID_TOPIC
    LIMIT 0, 500;

Caused the error:

    You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'GROUP BY ID_MEMBER, ID_TOPIC
    LIMIT 0, 500' at line 1

Hmmm, I think that I saw solution somewhere on this forum ...

Thanks
Title: Re: PHPBB2 - problem with MySQL
Post by: Person on August 24, 2006, 04:45:53 PM
Without this fix http://www.simplemachines.org/community/index.php?topic=107868.msg695181#msg695181 (http://www.simplemachines.org/community/index.php?topic=107868.msg695181#msg695181) ... I have the same error.
When I changed code, I get error, which I have posted one post back.
Title: Re: PHPBB2 - problem with MySQL
Post by: Ferny on August 24, 2006, 04:55:27 PM
Post the code of that section in sql file
Title: Re: PHPBB2 - problem with MySQL
Post by: Person on August 24, 2006, 04:59:25 PM
Original code was:
/******************************************************************************/
--- Converting topic notifications...
/******************************************************************************/

TRUNCATE {$to_prefix}log_notify;

---* {$to_prefix}log_notify
SELECT user_id AS ID_MEMBER, topic_id AS ID_TOPIC
FROM {$from_prefix}topics_watch;
---*

This makes error: http://www.simplemachines.org/community/index.php?topic=107868.msg695181#msg695181 (http://www.simplemachines.org/community/index.php?topic=107868.msg695181#msg695181)

This is "fixed" code:
/******************************************************************************/
--- Converting topic notifications...
/******************************************************************************/

TRUNCATE {$to_prefix}log_notify;

---* {$to_prefix}log_notify
SELECT user_id AS ID_MEMBER, topic_id AS ID_TOPIC
FROM {$from_prefix}topics_watch;
GROUP BY ID_MEMBER, ID_TOPIC;
---*


And this makes this: http://www.simplemachines.org/community/index.php?topic=107868.msg696826#msg696826 (http://www.simplemachines.org/community/index.php?topic=107868.msg696826#msg696826)
Title: Re: PHPBB2 - problem with MySQL
Post by: Ferny on August 24, 2006, 05:03:54 PM
FROM {$from_prefix}topics_watch;

Just delete the last ; ;)

This is correct:
/******************************************************************************/
--- Converting topic notifications...
/******************************************************************************/

TRUNCATE {$to_prefix}log_notify;

---* {$to_prefix}log_notify
SELECT user_id AS ID_MEMBER, topic_id AS ID_TOPIC
FROM {$from_prefix}topics_watch
GROUP BY ID_MEMBER, ID_TOPIC;
---*
Title: Re: PHPBB2 - problem with MySQL
Post by: Person on August 24, 2006, 05:09:59 PM
Thanks!

Now, converting is OK, but I can't log myself on :(

An Error Has Occurred!
You were unable to login. Please check your cookie settings.


Any idea?

EDITED: I think that this is bug in Firefox ... I have just try IE and it's works. :)
Title: Re: PHPBB2 - problem with MySQL
Post by: Person on August 24, 2006, 05:17:19 PM
It's still imposible to log-on with Firefox ... :(
& I don't have Private messages in Inbox folder :(
Title: Re: PHPBB2 - problem with MySQL
Post by: Ferny on August 24, 2006, 05:45:07 PM
Try deleting your cookies

I still have not do a complete conversion, maybe appear some bugs more
Title: Re: PHPBB2 - problem with MySQL
Post by: Person on August 24, 2006, 06:03:29 PM
OK, now, when I deleted cookie, I can log-on.

Bug is in Private messages in Inbox & Labels ...
Title: Re: PHPBB2 - problem with MySQL
Post by: Person on August 24, 2006, 06:09:00 PM
& another bug: At membergroups is prefix phpBB

Sample:
QuotephpBB OK-SG
must be:
QuoteOK-SG
Title: Re: PHPBB2 - problem with MySQL
Post by: IGSkirk on August 24, 2006, 06:27:27 PM

Converting posts (this may take some time)... Unsuccessful!
This query:

    INSERT INTO `if_smf`.smf_messages
    (ID_MSG, ID_TOPIC, posterTime, ID_MEMBER, posterEmail, subject, posterName, smileysEnabled, modifiedTime, posterIP, body, ID_BOARD, modifiedName, icon)
    VALUES ('379072', '1949', '1126528814', '5863', '[email protected]', 'Ratchet &amp; Clank vending machine', 'Demolition', '1', '', '70.56.201.95', 'U get sasha
    <br />*inserts clank*', '6', '', 'xx'),

    [...snip...]

Caused the error:

    Duplicate entry '379072' for key 1


First off - thanks to Ferny and everyone for the updates & mods to the scripts - I've incorporated all those so far and it runs MORE smoothly - but I'm still getting a hiccup when importing POSTS (see above).

I checked the source phpbb_posts table and there has never yet been any duplicates of the post_id it's reporting (I have 800K posts, so forgive me that I haven't scanned the entire table visually). 

When I check the SMF posts table, there is already a post been inserted of this key.  It's as if the script is trying to insert the same post TWICE?

I've gotten this maybe 15-20 times so far, after about 50% of the posts.  My work-around to-date (over the last 24 hrs - and I've been running the script nearly all of that 24 hrs) has been to delete the source post from phpbb_posts (which isn't necessarily cool, since it's not a duplicate) - but now that I'm in the 450-475K range, I've gotten about 10 of these errors now, and so I'm starting to get concerned.

Any thoughts from anyone?
Title: Re: PHPBB2 - problem with MySQL
Post by: Ferny on August 25, 2006, 02:51:20 AM
Quote from: Person on August 24, 2006, 06:09:00 PM
& another bug: At membergroups is prefix phpBB

Sample:
QuotephpBB OK-SG
must be:
QuoteOK-SG

It's not a bug, the converter automatically adds the phpbb prefix to all phpbb ranks. If you don't want it, do this change.

Find:
SELECT
SUBSTRING(CONCAT('phpBB ', rank_title), 1, 255) AS groupName,
rank_image AS stars, IF(rank_special = 0, rank_min, -1) AS minPosts,
'' AS onlineColor
FROM {$from_prefix}ranks
ORDER BY rank_min;


Replace it:
SELECT
SUBSTRING(rank_title, 1, 255) AS groupName,
rank_image AS stars, IF(rank_special = 0, rank_min, -1) AS minPosts,
'' AS onlineColor
FROM {$from_prefix}ranks
ORDER BY rank_min;





To IGSkirk: I don't know why this occurs (I converted a forum with 110K posts without this error) but I'll review the code.
Title: Re: PHPBB2 - problem with MySQL
Post by: Person on August 25, 2006, 03:10:54 AM
OK, this is now OK.

Problems:
* Private messages - inbox, labels (scrip create one with only number)

I have one questions. How can I force convertion script to use UTF8 charset?
Title: Re: PHPBB2 - problem with MySQL
Post by: kitz on August 25, 2006, 04:48:47 AM
First of all guys, thanks for the work youve put into this so far.....

However Im still having a problem here


QuoteConverting topic notifications... Unsuccessful!
This query:
INSERT INTO `forum`.smf_log_notify
(ID_MEMBER, ID_TOPIC)
VALUES ('2', '44'),
('3', '44'),
('6', '11'),
('6', '13'),

//snip

Caused the error:

Duplicate entry '2-44-0' for key 1

This is my code...  am I missing something blindingly obvious?

/******************************************************************************/
--- Converting topic notifications...
/******************************************************************************/

TRUNCATE {$to_prefix}log_notify;

---* {$to_prefix}log_notify
SELECT user_id AS ID_MEMBER, topic_id AS ID_TOPIC
FROM {$from_prefix}topics_watch
GROUP BY ID_MEMBER, ID_TOPIC;
---*
Title: Re: PHPBB2 - problem with MySQL
Post by: pkeffect on August 25, 2006, 02:25:12 PM
SMF 1.1RC3

Some of it worked.

Trying to convert phpBB from 2.0.18. Most of it went well even though I had a sub-category mod installed. It converted all to the main index.

No biggie.

Here's the failure.

QuoteConverting members... Unsuccessful!
This query:

    SELECT
    u.user_id AS ID_MEMBER, SUBSTRING(u.username, 1, 80) AS memberName,
    SUBSTRING(u.username, 1, 255) AS realName,
    SUBSTRING(u.user_password, 1, 64) AS passwd, u.user_lastvisit AS lastLogin,
    u.user_regdate AS dateRegistered,
    SUBSTRING(u.user_from, 1, 255) AS location,
    u.user_posts AS posts, IF(u.user_level = 1, 1, mg.ID_GROUP) AS ID_GROUP,
    u.user_new_privmsg AS instantMessages,
    SUBSTRING(u.user_email AS emailAddress, 1, 255) AS emailAddress,
    u.user_unread_privmsg AS unreadMessages,
    SUBSTRING(u.user_msnm AS MSN, 1, 255) AS MSN,
    SUBSTRING(u.user_aim AS AIM, 1, 16) AS AIM,
    SUBSTRING(u.user_icq, 1, 255) AS ICQ,
    SUBSTRING(u.user_yim, 1, 32) AS YIM,
    SUBSTRING(u.user_website, 1, 255) AS websiteTitle,
    SUBSTRING(u.user_website, 1, 255) AS websiteUrl,
    u.user_allow_viewonline AS showOnline, u.user_timezone AS timeOffset,
    IF(u.user_viewemail = 1, 0, 1) AS hideEmail, u.user_avatar AS avatar,
    REPLACE(u.user_sig, '\n', '<br />') AS signature,
    u.user_sig_bbcode_uid AS signature_uid, u.user_avatar_type,
    u.user_notify_pm AS pm_email_notify, u.user_active AS is_activated,
    '' AS lngfile, '' AS buddy_list, '' AS pm_ignore_list, '' AS messageLabels,
    '' AS personalText, '' AS timeFormat, '' AS usertitle, '' AS memberIP,
    '' AS secretQuestion, '' AS secretAnswer, '' AS validation_code,
    '' AS additionalGroups, '' AS smileySet, '' AS passwordSalt,
    '' AS memberIP2
    FROM `herbtalk_info_-_phpbb`.phpbb_users AS u
    LEFT JOIN `herbtalk_info_-_phpbb`.phpbb_ranks AS r ON (r.rank_id = u.user_rank AND r.rank_special = 1)
    LEFT JOIN `herbtalk_info_-_pmf`.smf_membergroups AS mg ON (BINARY mg.groupName = CONCAT('phpBB ', r.rank_title))
    WHERE u.user_id != -1
    GROUP BY u.user_id
    LIMIT 0, 500;

Caused the error:

    You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AS emailAddress, 1, 255) AS emailAddress,
    u.user_unread_privmsg

....
Title: Re: PHPBB2 - problem with MySQL
Post by: Person on August 25, 2006, 02:38:48 PM
The last version of converter (still some bugs)

* private messages - inbox is not OK
* private messages - labels (one blank label)

phpbb2_to_smf_2006_08_24.zip (http://person.acentermedia.net/SMF/phpbb2_to_smf_2006_08_24.zip)
Title: Re: PHPBB2 - problem with MySQL
Post by: pkeffect on August 25, 2006, 02:45:20 PM
Just ran that new zip.

Beautiful!

No errors.

Thank you!


--pkeffect
Title: Re: PHPBB2 - problem with MySQL
Post by: Person on August 25, 2006, 02:48:52 PM
Quote from: pkeffect on August 25, 2006, 02:45:20 PM
No errors.
Yes, but you will have corrupted private messages ... I'm waiting for fix ... ;)
Title: Re: PHPBB2 - problem with MySQL
Post by: Person on August 25, 2006, 03:17:31 PM
If you want to set input charset:

Original code in file convert.php:
// Persist?
if (empty($db_persist))
mysql_connect($db_server, $db_user, $db_passwd);
else
mysql_pconnect($db_server, $db_user, $db_passwd);


Modified file (input/output charset is set to "UTF8")
// Persist?
if (empty($db_persist))
mysql_connect($db_server, $db_user, $db_passwd);
else
mysql_pconnect($db_server, $db_user, $db_passwd);

// UTF8
mysql_query("SET NAMES 'UTF8'");
mysql_query("SET CHARACTER SET 'UTF8'");


I think that it works  ;)


These bugs are open:
* private messages - inbox messages ase not shown
* private messages - labels (one blank label)
Title: Re: PHPBB2 - problem with MySQL
Post by: Person on August 25, 2006, 03:50:26 PM
I think that I have solved these bugs ;)
Fixed files: phpbb2_to_smf_2006_08_25.zip (http://person.acentermedia.net/SMF/phpbb2_to_smf_2006_08_25.zip)

Changed from previous version:
Original:
/******************************************************************************/
--- Converting personal messages (step 2)...
/******************************************************************************/

TRUNCATE {$to_prefix}pm_recipients;

---* {$to_prefix}pm_recipients
SELECT
pm.privmsgs_id AS ID_PM, pm.privmsgs_to_userid AS ID_MEMBER,
pm.privmsgs_type = 5 AS is_read, pm.privmsgs_type IN (2, 4) AS deleted,
'' AS labels
FROM ({$from_prefix}privmsgs AS pm, {$from_prefix}privmsgs_text AS pmt)
LEFT JOIN {$from_prefix}users AS uf ON (uf.user_id = pm.privmsgs_from_userid)
WHERE pmt.privmsgs_text_id = pm.privmsgs_id;
---*


Fixed:
/******************************************************************************/
--- Converting personal messages (step 2)...
/******************************************************************************/

TRUNCATE {$to_prefix}pm_recipients;

---* {$to_prefix}pm_recipients
SELECT
pm.privmsgs_id AS ID_PM, pm.privmsgs_to_userid AS ID_MEMBER,
pm.privmsgs_type = 5 AS is_read, pm.privmsgs_type IN (2, 4) AS deleted,
'-1' AS labels
FROM ({$from_prefix}privmsgs AS pm, {$from_prefix}privmsgs_text AS pmt)
LEFT JOIN {$from_prefix}users AS uf ON (uf.user_id = pm.privmsgs_from_userid)
WHERE pmt.privmsgs_text_id = pm.privmsgs_id;
---*


Changed default value of column labels from '' to '-1'.

Now should works  ;)
Title: Re: PHPBB2 - problem with MySQL
Post by: pkeffect on August 25, 2006, 06:20:35 PM
Can I just run the part for the PM's alone and if so how would I go about doing that?

I would rather not go through eveything again.


--pk
Title: Re: PHPBB2 - problem with MySQL
Post by: Ferny on August 25, 2006, 06:46:53 PM
Great fix Person. I got that error and putting a '-1' in 'labels' column fixed it!!

There's still another minor bug. In the step 2, substep 10, it says something about that modSetting is not defined or something like that (I don't remember what said exactly). The line affected (in convert.php) is:

$filename = $modSettings['custom_avatar_dir'] . '/' . $row['filename'];

Although I got this error, the forum seems to have been converted successfully. I'll try to repair this error, but at the moment I recommend to use phpbb2_to_smf_2006_08_25.zip (see two posts ago).

Ferny
Title: Re: PHPBB2 - problem with MySQL
Post by: Ferny on August 25, 2006, 06:49:29 PM
Quote from: pkeffect on August 25, 2006, 06:20:35 PM
Can I just run the part for the PM's alone and if so how would I go about doing that?

I would rather not go through eveything again.


--pk

If you have phpmyadmin, you only have to run this query in your database:

UPDATE smf_pm_recipients SET labels = -1

(change prefix if needed)
Title: Re: PHPBB2 - problem with MySQL
Post by: pkeffect on August 25, 2006, 06:53:14 PM
You sir rock, ty.

On another note, didn't know where to ask, maybe someone could point me somewhere.

Is there a way to migrate post count stats up through the child hierarchy to the index page? Total listed for all sub cats ect.

I thought the was an option in 1.0.8 but maybe I was dreaming. Not that I am running 1.0.8 now...


--pk
Title: Re: PHPBB2 - problem with MySQL
Post by: Person on August 25, 2006, 06:58:16 PM
Quote from: pkeffect on August 25, 2006, 06:20:35 PM
Can I just run the part for the PM's alone and if so how would I go about doing that?

This should work:

Replace your phpbb2_to_smf.sql file with this text only & start convert.php again:
/* ATTENTION: You don't need to run or use this file!  The convert.php script does everything for you! */

/******************************************************************************/
---~ name: "phpBB2"
/******************************************************************************/
---~ version: "SMF 1.1 RC3"
---~ settings: "/extension.inc", "/config.php"
---~ defines: IN_PHPBB
---~ from_prefix: "`$dbname`.$table_prefix"
---~ table_test: "{$from_prefix}users"


/******************************************************************************/
--- Converting personal messages (step 2)...
/******************************************************************************/

TRUNCATE {$to_prefix}pm_recipients;

---* {$to_prefix}pm_recipients
SELECT
pm.privmsgs_id AS ID_PM, pm.privmsgs_to_userid AS ID_MEMBER,
pm.privmsgs_type = 5 AS is_read, pm.privmsgs_type IN (2, 4) AS deleted,
'-1' AS labels
FROM ({$from_prefix}privmsgs AS pm, {$from_prefix}privmsgs_text AS pmt)
LEFT JOIN {$from_prefix}users AS uf ON (uf.user_id = pm.privmsgs_from_userid)
WHERE pmt.privmsgs_text_id = pm.privmsgs_id;
---*
Title: Re: PHPBB2 - problem with MySQL
Post by: Ferny on August 26, 2006, 11:10:00 AM
Another fix to solve this error: Notice: Undefined variable: modSettings in [path]convert.php on line 1374

This error should only occur if you do the change in the way avatars are imported, which is in the second part of this post. If you don't do it, you'll not see this error, because the affected code will never be executed. But as I consider it a bug, I'll give the correction:

In convert.php find:
while ($row = mysql_fetch_assoc($request))
{
if ($row['attachmentType'] == 1)
$filename = $modSettings['custom_avatar_dir'] . '/' . $row['filename'];
else
$filename = getAttachmentFilename($row['filename'], $row['ID_ATTACH']);
// Probably not one of the converted ones, then?
if (!file_exists($filename))
continue;

$size = @getimagesize($filename);
if (!empty($size) && !empty($size[0]) && !empty($size[1]))
convert_query("
UPDATE {$to_prefix}attachments
SET
width = " . (int) $size[0] . ",
height = " . (int) $size[1] . "
WHERE ID_ATTACH = $row[ID_ATTACH]
LIMIT 1");
}


Replace it:
while ($row = mysql_fetch_assoc($request))
{
if ($row['attachmentType'] == 1)
{
$request2 = convert_query("
SELECT value
FROM {$to_prefix}settings
WHERE variable = 'custom_avatar_dir'
LIMIT 1");
list ($custom_avatar_dir) = mysql_fetch_row($request2);
mysql_free_result($request2);

$filename = $custom_avatar_dir . '/' . $row['filename'];
}
else
$filename = getAttachmentFilename($row['filename'], $row['ID_ATTACH']);
// Probably not one of the converted ones, then?
if (!file_exists($filename))
continue;

$size = @getimagesize($filename);
$filesize = @filesize($filename);
if (!empty($size) && !empty($size[0]) && !empty($size[1]) && !empty($filesize))
convert_query("
UPDATE {$to_prefix}attachments
SET
size = " . (int) $filesize . ",
width = " . (int) $size[0] . ",
height = " . (int) $size[1] . "
WHERE ID_ATTACH = $row[ID_ATTACH]
LIMIT 1");
}


This code updates filesize, width and height of uploaded avatars in custom avatar dir. Filesize is not updated in the original code, I've added it.




The following is not a fix, just another way to import uploaded avatars!!!

If you see sql file on "Converting members" section, you'll notice that avatars are converted like attachments, not like avatars (attachmentType is 0 and should be 1), and they're placed in the same directory as attachments. Although it works, I don't like this :D so I made one change. If you want avatars to be converted like uploaded avatars and placed in custom uploaded avatars dir, do this change in sql file:

Find:
/******************************************************************************/
--- Converting members...
/******************************************************************************/

TRUNCATE {$to_prefix}members;
TRUNCATE {$to_prefix}attachments;

---* {$to_prefix}members
---{
// Got the board timezone?
if (!isset($board_timezone))
{
$request2 = convert_query("
SELECT config_value
FROM {$from_prefix}config
WHERE config_name = 'board_timezone'
LIMIT 1");
list ($board_timezone) = mysql_fetch_row($request2);
mysql_free_result($request2);

// Find out where uploaded avatars go (attachments dir.)
$request2 = convert_query("
SELECT value
FROM {$to_prefix}settings
WHERE variable = 'attachmentUploadDir'
LIMIT 1");
list ($smf_attachments_dir) = mysql_fetch_row($request2);
mysql_free_result($request2);

$request2 = convert_query("
SELECT config_value
FROM {$from_prefix}config
WHERE config_name = 'avatar_path'
LIMIT 1");
$phpbb_avatar_upload_path = $_POST['path_from'] . '/' . mysql_result($request2, 0, 'config_value');
mysql_free_result($request2);
}

// timeOffset = phpBB user TZ - phpBB board TZ.
$row['timeOffset'] = $row['timeOffset'] - $board_timezone;

if ($row['user_avatar_type'] == 0)
$row['avatar'] = '';
// If the avatar type is uploaded (type = 1) copy avatar as an attachment with the correct name.
elseif ($row['user_avatar_type'] == 1 && strlen($row['avatar']) > 0)
{
$smf_avatar_filename = 'avatar_' . $row['ID_MEMBER'] . strrchr($row['avatar'], '.');
copy($phpbb_avatar_upload_path . '/' . $row['avatar'], $smf_attachments_dir . '/' . $smf_avatar_filename);

convert_query("
INSERT INTO {$to_prefix}attachments
(ID_MSG, ID_MEMBER, filename)
VALUES (0, $row[ID_MEMBER], SUBSTRING('" . addslashes($smf_avatar_filename) . "', 1, 255))");
$row['avatar'] = '';
}
elseif ($row['user_avatar_type'] == 3)
$row['avatar'] = substr('gallery/' . $row['avatar'], 0, 255);
unset($row['user_avatar_type']);

$row['signature'] = preg_replace('~\[size=([789]|[012]\d)\]~i', '[size=$1px]', $row['signature']);
if ($row['signature_uid'] != '')
$row['signature'] = preg_replace('~(:u:|:1:|:)' . preg_quote($row['signature_uid'], '~') . '~i', '', $row['signature']);
$row['signature'] = substr($row['signature'], 0, 65534);
unset($row['signature_uid']);
---}
SELECT
u.user_id AS ID_MEMBER, SUBSTRING(u.username, 1, 80) AS memberName,
SUBSTRING(u.username, 1, 255) AS realName,
SUBSTRING(u.user_password, 1, 64) AS passwd, u.user_lastvisit AS lastLogin,
u.user_regdate AS dateRegistered,
SUBSTRING(u.user_from, 1, 255) AS location,
u.user_posts AS posts, IF(u.user_level = 1, 1, mg.ID_GROUP) AS ID_GROUP,
u.user_new_privmsg AS instantMessages,
SUBSTRING(u.user_email, 1, 255) AS emailAddress,
u.user_unread_privmsg AS unreadMessages,
SUBSTRING(u.user_msnm, 1, 255) AS MSN,
SUBSTRING(u.user_aim, 1, 16) AS AIM,
SUBSTRING(u.user_icq, 1, 255) AS ICQ,
SUBSTRING(u.user_yim, 1, 32) AS YIM,
SUBSTRING(u.user_website, 1, 255) AS websiteTitle,
SUBSTRING(u.user_website, 1, 255) AS websiteUrl,
u.user_allow_viewonline AS showOnline, u.user_timezone AS timeOffset,
IF(u.user_viewemail = 1, 0, 1) AS hideEmail, u.user_avatar AS avatar,
REPLACE(u.user_sig, '\n', '<br />') AS signature,
u.user_sig_bbcode_uid AS signature_uid, u.user_avatar_type,
u.user_notify_pm AS pm_email_notify, u.user_active AS is_activated,
'' AS lngfile, '' AS buddy_list, '' AS pm_ignore_list, '' AS messageLabels,
'' AS personalText, '' AS timeFormat, '' AS usertitle, '' AS memberIP,
'' AS secretQuestion, '' AS secretAnswer, '' AS validation_code,
'' AS additionalGroups, '' AS smileySet, '' AS passwordSalt,
'' AS memberIP2
FROM {$from_prefix}users AS u
LEFT JOIN {$from_prefix}ranks AS r ON (r.rank_id = u.user_rank AND r.rank_special = 1)
LEFT JOIN {$to_prefix}membergroups AS mg ON (BINARY mg.groupName = CONCAT('phpBB ', r.rank_title))
WHERE u.user_id != -1
GROUP BY u.user_id;
---*


Replace it:
/******************************************************************************/
--- Converting members...
/******************************************************************************/

TRUNCATE {$to_prefix}members;
TRUNCATE {$to_prefix}attachments;

---* {$to_prefix}members
---{
// Got the board timezone?
if (!isset($board_timezone))
{
$request2 = convert_query("
SELECT config_value
FROM {$from_prefix}config
WHERE config_name = 'board_timezone'
LIMIT 1");
list ($board_timezone) = mysql_fetch_row($request2);
mysql_free_result($request2);

// Find out where uploaded avatars go (uploaded avatars dir)
$request2 = convert_query("
SELECT value
FROM {$to_prefix}settings
WHERE variable = 'custom_avatar_dir'
LIMIT 1");
list ($custom_avatar_dir) = mysql_fetch_row($request2);
mysql_free_result($request2);

$request2 = convert_query("
SELECT config_value
FROM {$from_prefix}config
WHERE config_name = 'avatar_path'
LIMIT 1");
$phpbb_avatar_upload_path = $_POST['path_from'] . '/' . mysql_result($request2, 0, 'config_value');
mysql_free_result($request2);
}

// timeOffset = phpBB user TZ - phpBB board TZ.
$row['timeOffset'] = $row['timeOffset'] - $board_timezone;

if ($row['user_avatar_type'] == 0)
$row['avatar'] = '';
// If the avatar type is uploaded (type = 1) copy avatar with the correct name.
elseif ($row['user_avatar_type'] == 1 && strlen($row['avatar']) > 0)
{
$smf_avatar_filename = 'avatar_' . $row['ID_MEMBER'] . strrchr($row['avatar'], '.');
@copy($phpbb_avatar_upload_path . '/' . $row['avatar'], $custom_avatar_dir . '/' . $smf_avatar_filename);

convert_query("
INSERT INTO {$to_prefix}attachments
(ID_MSG, ID_MEMBER, filename, attachmentType)
VALUES (0, $row[ID_MEMBER], SUBSTRING('" . addslashes($smf_avatar_filename) . "', 1, 255), 1)");
$row['avatar'] = '';
}
elseif ($row['user_avatar_type'] == 3)
$row['avatar'] = substr('gallery/' . $row['avatar'], 0, 255);
unset($row['user_avatar_type']);

$row['signature'] = preg_replace('~\[size=([789]|[012]\d)\]~i', '[size=$1px]', $row['signature']);
if ($row['signature_uid'] != '')
$row['signature'] = preg_replace('~(:u:|:1:|:)' . preg_quote($row['signature_uid'], '~') . '~i', '', $row['signature']);
$row['signature'] = substr($row['signature'], 0, 65534);
unset($row['signature_uid']);
---}
SELECT
u.user_id AS ID_MEMBER, SUBSTRING(u.username, 1, 80) AS memberName,
SUBSTRING(u.username, 1, 255) AS realName,
SUBSTRING(u.user_password, 1, 64) AS passwd, u.user_lastvisit AS lastLogin,
u.user_regdate AS dateRegistered,
SUBSTRING(u.user_from, 1, 255) AS location,
u.user_posts AS posts, IF(u.user_level = 1, 1, mg.ID_GROUP) AS ID_GROUP,
u.user_new_privmsg AS instantMessages,
SUBSTRING(u.user_email, 1, 255) AS emailAddress,
u.user_unread_privmsg AS unreadMessages,
SUBSTRING(u.user_msnm, 1, 255) AS MSN,
SUBSTRING(u.user_aim, 1, 16) AS AIM,
SUBSTRING(u.user_icq, 1, 255) AS ICQ,
SUBSTRING(u.user_yim, 1, 32) AS YIM,
SUBSTRING(u.user_website, 1, 255) AS websiteTitle,
SUBSTRING(u.user_website, 1, 255) AS websiteUrl,
u.user_allow_viewonline AS showOnline, u.user_timezone AS timeOffset,
IF(u.user_viewemail = 1, 0, 1) AS hideEmail, u.user_avatar AS avatar,
REPLACE(u.user_sig, '\n', '<br />') AS signature,
u.user_sig_bbcode_uid AS signature_uid, u.user_avatar_type,
u.user_notify_pm AS pm_email_notify, u.user_active AS is_activated,
'' AS lngfile, '' AS buddy_list, '' AS pm_ignore_list, '' AS messageLabels,
'' AS personalText, '' AS timeFormat, '' AS usertitle, '' AS memberIP,
'' AS secretQuestion, '' AS secretAnswer, '' AS validation_code,
'' AS additionalGroups, '' AS smileySet, '' AS passwordSalt,
'' AS memberIP2
FROM {$from_prefix}users AS u
LEFT JOIN {$from_prefix}ranks AS r ON (r.rank_id = u.user_rank AND r.rank_special = 1)
LEFT JOIN {$to_prefix}membergroups AS mg ON (BINARY mg.groupName = CONCAT('phpBB ', r.rank_title))
WHERE u.user_id != -1
GROUP BY u.user_id;
---*


IMPORTANT: if you want to do this change, BEFORE converting your forum you should go to SMF control panel, and in Avatar settings you need to change this:

Upload avatars to... -> Specific directory
Upload directory -> [Select the directory you want]

This is necessary in order to create 'custom_avatar_dir' entry in settings table. And you need to do the change in convert.php which is above.




This is updated converter only with the change in convert.php
http://ultrashare.net/hosting/fl/c37ccc563f/

This is updated converter with changes in convert.php and sql file:
http://ultrashare.net/hosting/fl/92752746ad/

I don't get more errors... if you see another one please tell it.

Ferny
Title: Re: PHPBB2 - problem with MySQL
Post by: Person on August 26, 2006, 12:13:06 PM
I have one small problem with Private Messages.
When I run convert script I get one unread private message in my inbox.
I will try to fix it.
Title: Re: PHPBB2 - problem with MySQL
Post by: Person on August 26, 2006, 12:41:44 PM
I think that I have fixed bug:

Your old script (based on avartar fix, the same part as in my file):
/******************************************************************************/
--- Converting personal messages (step 2)...
/******************************************************************************/

TRUNCATE {$to_prefix}pm_recipients;

---* {$to_prefix}pm_recipients
SELECT
pm.privmsgs_id AS ID_PM, pm.privmsgs_to_userid AS ID_MEMBER,
pm.privmsgs_type = 5 AS is_read, pm.privmsgs_type IN (2, 4) AS deleted,
'-1' AS labels
FROM ({$from_prefix}privmsgs AS pm, {$from_prefix}privmsgs_text AS pmt)
LEFT JOIN {$from_prefix}users AS uf ON (uf.user_id = pm.privmsgs_from_userid)
WHERE pmt.privmsgs_text_id = pm.privmsgs_id;
---*


Fixed script:
/******************************************************************************/
--- Converting personal messages (step 2)...
/******************************************************************************/

TRUNCATE {$to_prefix}pm_recipients;

---* {$to_prefix}pm_recipients
SELECT
pm.privmsgs_id AS ID_PM, pm.privmsgs_to_userid AS ID_MEMBER,
pm.privmsgs_type = 0 AS is_read, pm.privmsgs_type IN (2, 4) AS deleted,
'-1' AS labels
FROM ({$from_prefix}privmsgs AS pm, {$from_prefix}privmsgs_text AS pmt)
LEFT JOIN {$from_prefix}users AS uf ON (uf.user_id = pm.privmsgs_from_userid)
WHERE pmt.privmsgs_text_id = pm.privmsgs_id;
---*


I have tested phpBB2 forum. I think: Number 5 means that PM is stil unread. Number 0 mans that PM hvae been read.

Now I have correct flag in table smf_pm_recipients at column is_read.
Except for PM whic have been deleted ... but SMF auto correct their flags.


Person
Title: Re: PHPBB2 - problem with MySQL
Post by: Person on August 26, 2006, 12:51:55 PM
I have a little modified upper code ... now the deleted PM has correct flag for read/unread (I think)

/******************************************************************************/
--- Converting personal messages (step 2)...
/******************************************************************************/

TRUNCATE {$to_prefix}pm_recipients;

---* {$to_prefix}pm_recipients
SELECT
pm.privmsgs_id AS ID_PM, pm.privmsgs_to_userid AS ID_MEMBER,
pm.privmsgs_type IN (0,2,4)AS is_read, pm.privmsgs_type IN (2, 4) AS deleted,
'-1' AS labels
FROM ({$from_prefix}privmsgs AS pm, {$from_prefix}privmsgs_text AS pmt)
LEFT JOIN {$from_prefix}users AS uf ON (uf.user_id = pm.privmsgs_from_userid)
WHERE pmt.privmsgs_text_id = pm.privmsgs_id;
---*


From only 0 to (0,2,4)

EDITED:
Last version: phpbb2_to_smf_2006_08_26-3.zip (http://person.acentermedia.net/SMF/phpbb2_to_smf_2006_08_26-3.zip)

Last UTF8 version: phpbb2_to_smf_2006_08_26-3-utf8.zip (http://person.acentermedia.net/SMF/phpbb2_to_smf_2006_08_26-3-utf8.zip)

EDITED 2: Code correction ;)

Person
Title: Re: PHPBB2 - problem with MySQL
Post by: whitewun on August 27, 2006, 05:35:42 AM
This is my problem! something to do with importing email address's can someone please please please advise me on a fix!

cheeeers!

Converting...
Converting ranks... Successful.
Converting groups... Successful.
Converting members... Unsuccessful!
This query:
SELECT
u.user_id AS ID_MEMBER, SUBSTRING(u.username, 1, 80) AS memberName,
SUBSTRING(u.username, 1, 255) AS realName,
SUBSTRING(u.user_password, 1, 64) AS passwd, u.user_lastvisit AS lastLogin,
u.user_regdate AS dateRegistered,
SUBSTRING(u.user_from, 1, 255) AS location,
u.user_posts AS posts, IF(u.user_level = 1, 1, mg.ID_GROUP) AS ID_GROUP,
u.user_new_privmsg AS instantMessages,
SUBSTRING(u.user_email AS emailAddress, 1, 255) AS emailAddress,
u.user_unread_privmsg AS unreadMessages,
SUBSTRING(u.user_msnm AS MSN, 1, 255) AS MSN,
SUBSTRING(u.user_aim AS AIM, 1, 16) AS AIM,
SUBSTRING(u.user_icq, 1, 255) AS ICQ,
SUBSTRING(u.user_yim, 1, 32) AS YIM,
SUBSTRING(u.user_website, 1, 255) AS websiteTitle,
SUBSTRING(u.user_website, 1, 255) AS websiteUrl,
u.user_allow_viewonline AS showOnline, u.user_timezone AS timeOffset,
IF(u.user_viewemail = 1, 0, 1) AS hideEmail, u.user_avatar AS avatar,
REPLACE(u.user_sig, '\n', '<br />') AS signature,
u.user_sig_bbcode_uid AS signature_uid, u.user_avatar_type,
u.user_notify_pm AS pm_email_notify, u.user_active AS is_activated,
'' AS lngfile, '' AS buddy_list, '' AS pm_ignore_list, '' AS messageLabels,
'' AS personalText, '' AS timeFormat, '' AS usertitle, '' AS memberIP,
'' AS secretQuestion, '' AS secretAnswer, '' AS validation_code,
'' AS additionalGroups, '' AS smileySet, '' AS passwordSalt,
'' AS memberIP2
FROM `swapahome`.phpbb_users AS u
LEFT JOIN `swapahome`.phpbb_ranks AS r ON (r.rank_id = u.user_rank AND r.rank_special = 1)
LEFT JOIN `swapahome`.smf_membergroups AS mg ON (BINARY mg.groupName = CONCAT('phpBB ', r.rank_title))
WHERE u.user_id != -1
GROUP BY u.user_id
LIMIT 0, 500;
Caused the error:

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AS emailAddress, 1, 255) AS emailAddress,
u.user_unread_privmsg AS unreadMessag' at line 9
Title: Re: PHPBB2 - problem with MySQL
Post by: Ferny on August 27, 2006, 07:41:44 AM
whitewun: use the converter that is in the post above yours, it has some fixes.
Title: Re: PHPBB2 - problem with MySQL
Post by: Ferny on August 27, 2006, 07:55:06 AM
Person, your last modification doesn't work. Maybe instead of pm.privmsgs_type = (0,2,4) should be pm.privmsgs_type IN (0,2,4)

?

I'll try with "IN"
Title: Re: PHPBB2 - problem with MySQL
Post by: kitz on August 27, 2006, 08:44:06 AM
Thanks guys.. specially ferny and person for their input..

finally got it to work after using the latest upgrade file and after doing a fresh install of SMF.

mhwuah  :-*


Title: Re: PHPBB2 - problem with MySQL
Post by: Person on August 27, 2006, 01:06:41 PM
Quote from: Ferny on August 27, 2006, 07:55:06 AM
Person, your last modification doesn't work. Maybe instead of pm.privmsgs_type = (0,2,4) should be pm.privmsgs_type IN (0,2,4)

?

I'll try with "IN"
Oh, sorry, I have did a mistake with correction ... in my uploaded file is correct  ;)
Yes, pm.privmsgs_type IN (0,2,4)AS is_read is correct ;)
Title: Re: PHPBB2 - problem with MySQL
Post by: Person on August 28, 2006, 10:30:17 AM
There might be another fix:
http://www.simplemachines.org/community/index.php?topic=109303.msg703496#msg703496 (http://www.simplemachines.org/community/index.php?topic=109303.msg703496#msg703496)
Title: Re: PHPBB2 - problem with MySQL
Post by: MrPrise on August 31, 2006, 09:00:03 AM
Thanks for all the fix.
There is a bug in the avatar conversion. If the avatar has the size bbcode the size value will not has the pt after the number as SMF wants it.
Title: Re: PHPBB2 - problem with MySQL
Post by: kainelderan on August 31, 2006, 05:22:02 PM
I just converted over from phpBB2 and I'm now getting this error on my bridged Joomla.

Notice: Undefined index: custom_avatar_url in /var/www/html/si/silverfalls.org/SMF/Sources/Subs.php on line 3047

Can anyone help me fix this? I tried looking at the code in the Subs.php but I couldn't figure out where the problem was.
Title: Re: PHPBB2 - problem with MySQL
Post by: Ferny on September 01, 2006, 02:21:32 AM
Quote from: kainelderan on August 31, 2006, 05:22:02 PM
I just converted over from phpBB2 and I'm now getting this error on my bridged Joomla.

Notice: Undefined index: custom_avatar_url in /var/www/html/si/silverfalls.org/SMF/Sources/Subs.php on line 3047

Can anyone help me fix this? I tried looking at the code in the Subs.php but I couldn't figure out where the problem was.

You can undo the second modification in this post and it will work: http://www.simplemachines.org/community/index.php?topic=107868.msg699910#msg699910

But it's simpler to do what the "important" note in that post says ;)

QuoteIMPORTANT: if you want to do this change, BEFORE converting your forum you should go to SMF control panel, and in Avatar settings you need to change this:

Upload avatars to... -> Specific directory
Upload directory -> [Select the directory you want]

This is necessary in order to create 'custom_avatar_dir' entry in settings table.

This weekend I'll post a modification so that this error doesn't occur.

Ferny
Title: Re: PHPBB2 - problem with MySQL
Post by: Person on September 01, 2006, 03:08:36 AM
You can do a little modification that if custom_avatar_url is undefined that then it use standard path ;)
Title: Re: PHPBB2 - problem with MySQL
Post by: Ferny on September 01, 2006, 10:25:36 AM
It was easier than I expected :D

You only have to replace the entire "Converting members" section with this:

/******************************************************************************/
--- Converting members...
/******************************************************************************/

TRUNCATE {$to_prefix}members;
TRUNCATE {$to_prefix}attachments;

---* {$to_prefix}members
---{
// Got the board timezone?
if (!isset($board_timezone))
{
$request2 = convert_query("
SELECT config_value
FROM {$from_prefix}config
WHERE config_name = 'board_timezone'
LIMIT 1");
list ($board_timezone) = mysql_fetch_row($request2);
mysql_free_result($request2);

// Find out where uploaded avatars go
$request2 = convert_query("
SELECT value
FROM {$to_prefix}settings
WHERE variable = 'custom_avatar_enabled'
LIMIT 1");
if (mysql_num_rows($request2))
list ($custom_avatar_enabled) = mysql_fetch_row($request2);
else
$custom_avatar_enabled = false;
mysql_free_result($request2);

if ($custom_avatar_enabled)
{
// Custom avatar dir.
$request2 = convert_query("
SELECT value
FROM {$to_prefix}settings
WHERE variable = 'custom_avatar_dir'
LIMIT 1");
list ($avatar_dir) = mysql_fetch_row($request2);
$attachmentType = '1';
}
else
{
// Attachments dir.
$request2 = convert_query("
SELECT value
FROM {$to_prefix}settings
WHERE variable = 'attachmentUploadDir'
LIMIT 1");
list ($avatar_dir) = mysql_fetch_row($request2);
$attachmentType = '0';
}
mysql_free_result($request2);

$request2 = convert_query("
SELECT config_value
FROM {$from_prefix}config
WHERE config_name = 'avatar_path'
LIMIT 1");
$phpbb_avatar_upload_path = $_POST['path_from'] . '/' . mysql_result($request2, 0, 'config_value');
mysql_free_result($request2);
}

// timeOffset = phpBB user TZ - phpBB board TZ.
$row['timeOffset'] = $row['timeOffset'] - $board_timezone;

if ($row['user_avatar_type'] == 0)
$row['avatar'] = '';
// If the avatar type is uploaded (type = 1) copy avatar with the correct name.
elseif ($row['user_avatar_type'] == 1 && strlen($row['avatar']) > 0)
{
$smf_avatar_filename = 'avatar_' . $row['ID_MEMBER'] . strrchr($row['avatar'], '.');
@copy($phpbb_avatar_upload_path . '/' . $row['avatar'], $avatar_dir . '/' . $smf_avatar_filename);

convert_query("
INSERT INTO {$to_prefix}attachments
(ID_MSG, ID_MEMBER, filename, attachmentType)
VALUES (0, $row[ID_MEMBER], SUBSTRING('" . addslashes($smf_avatar_filename) . "', 1, 255), " . $attachmentType . ")");
$row['avatar'] = '';
}
elseif ($row['user_avatar_type'] == 3)
$row['avatar'] = substr('gallery/' . $row['avatar'], 0, 255);
unset($row['user_avatar_type']);

$row['signature'] = preg_replace('~\[size=([789]|[012]\d)\]~i', '[size=$1px]', $row['signature']);
if ($row['signature_uid'] != '')
$row['signature'] = preg_replace('~(:u:|:1:|:)' . preg_quote($row['signature_uid'], '~') . '~i', '', $row['signature']);
$row['signature'] = substr($row['signature'], 0, 65534);
unset($row['signature_uid']);
---}
SELECT
u.user_id AS ID_MEMBER, SUBSTRING(u.username, 1, 80) AS memberName,
SUBSTRING(u.username, 1, 255) AS realName,
SUBSTRING(u.user_password, 1, 64) AS passwd, u.user_lastvisit AS lastLogin,
u.user_regdate AS dateRegistered,
SUBSTRING(u.user_from, 1, 255) AS location,
u.user_posts AS posts, IF(u.user_level = 1, 1, mg.ID_GROUP) AS ID_GROUP,
u.user_new_privmsg AS instantMessages,
SUBSTRING(u.user_email, 1, 255) AS emailAddress,
u.user_unread_privmsg AS unreadMessages,
SUBSTRING(u.user_msnm, 1, 255) AS MSN,
SUBSTRING(u.user_aim, 1, 16) AS AIM,
SUBSTRING(u.user_icq, 1, 255) AS ICQ,
SUBSTRING(u.user_yim, 1, 32) AS YIM,
SUBSTRING(u.user_website, 1, 255) AS websiteTitle,
SUBSTRING(u.user_website, 1, 255) AS websiteUrl,
u.user_allow_viewonline AS showOnline, u.user_timezone AS timeOffset,
IF(u.user_viewemail = 1, 0, 1) AS hideEmail, u.user_avatar AS avatar,
REPLACE(u.user_sig, '\n', '<br />') AS signature,
u.user_sig_bbcode_uid AS signature_uid, u.user_avatar_type,
u.user_notify_pm AS pm_email_notify, u.user_active AS is_activated,
'' AS lngfile, '' AS buddy_list, '' AS pm_ignore_list, '' AS messageLabels,
'' AS personalText, '' AS timeFormat, '' AS usertitle, '' AS memberIP,
'' AS secretQuestion, '' AS secretAnswer, '' AS validation_code,
'' AS additionalGroups, '' AS smileySet, '' AS passwordSalt,
'' AS memberIP2
FROM {$from_prefix}users AS u
LEFT JOIN {$from_prefix}ranks AS r ON (r.rank_id = u.user_rank AND r.rank_special = 1)
LEFT JOIN {$to_prefix}membergroups AS mg ON (BINARY mg.groupName = CONCAT('phpBB ', r.rank_title))
WHERE u.user_id != -1
GROUP BY u.user_id;
---*


If custom_avatar_enabled is not defined or its value is 0, then avatars go to attachments dir, else if it's defined, then avatars go to custom_avatar_dir




I think that the modification about following line (removing comments) is not necessary, but if somebody has problems with it, we can apply it

/* // !!! WHERE t.topic_moved_id = 0 *




This is the latest version, with member conversion change included. It also includes smilies import, which wasn't in the latest files we uploaded (I thought it was, but not)

[EDIT] There's a new version, see some posts below

Please Person do the modifications for UTF-8 version ;)
Title: Re: PHPBB2 - problem with MySQL
Post by: Ferny on September 01, 2006, 10:44:00 AM
Quote from: MrPrise on August 31, 2006, 09:00:03 AM
Thanks for all the fix.
There is a bug in the avatar conversion. If the avatar has the size bbcode the size value will not has the pt after the number as SMF wants it.

I think it's not a bug from the converter. Size bbcode does not work in the same way on posts and user signatures (avatars?) as in phpbb, but it can be solved if you edit Sources/Subs.php and do the following change:

Find:
array(
'tag' => 'size',
'type' => 'unparsed_equals',
'test' => '[\d]\]',
// !!! line-height
'before' => '<font size="$1" style="line-height: 1.3em;">',
'after' => '</font>',
),


Replace it:
array(
'tag' => 'size',
'type' => 'unparsed_equals',
'test' => '([\d]{1,2})\]',
// !!! line-height
'before' => '<font style="font-size: $1px; line-height: 1.3em;">',
'after' => '</font>',
),


This is more simpler than to modify the converter ;)
Title: Re: PHPBB2 - problem with MySQL
Post by: Ferny on September 02, 2006, 09:26:15 AM
Another fix. Record online users was not imported because the name of the variable is incorrect

In SQL file, find:
elseif ($row['config_name'] == 'record_users_online')

Replace by:
elseif ($row['config_name'] == 'record_online_users')

phpbb2_to_smf_2006_09_02.zip (http://ultrashare.net/hosting/fl/776a7ef05d/)


Ferny
Title: Re: PHPBB2 - problem with MySQL
Post by: frwjd on September 03, 2006, 03:03:07 PM
Hi everyone

I'm trying to convert from phpBB 2.0.19 but get the following error message

Converting members... Unsuccessful!
This query:
SELECT
u.user_id AS ID_MEMBER, SUBSTRING(u.username, 1, 80) AS memberName,
SUBSTRING(u.username, 1, 255) AS realName,
SUBSTRING(u.user_password, 1, 64) AS passwd, u.user_lastvisit AS lastLogin,
u.user_regdate AS dateRegistered,
SUBSTRING(u.user_from, 1, 255) AS location,
u.user_posts AS posts, IF(u.user_level = 1, 1, mg.ID_GROUP) AS ID_GROUP,
u.user_new_privmsg AS instantMessages,
SUBSTRING(u.user_email AS emailAddress, 1, 255) AS emailAddress,
u.user_unread_privmsg AS unreadMessages,
SUBSTRING(u.user_msnm AS MSN, 1, 255) AS MSN,
SUBSTRING(u.user_aim AS AIM, 1, 16) AS AIM,
SUBSTRING(u.user_icq, 1, 255) AS ICQ,
SUBSTRING(u.user_yim, 1, 32) AS YIM,
SUBSTRING(u.user_website, 1, 255) AS websiteTitle,
SUBSTRING(u.user_website, 1, 255) AS websiteUrl,
u.user_allow_viewonline AS showOnline, u.user_timezone AS timeOffset,
IF(u.user_viewemail = 1, 0, 1) AS hideEmail, u.user_avatar AS avatar,
REPLACE(u.user_sig, '\n', '<br />') AS signature,
u.user_sig_bbcode_uid AS signature_uid, u.user_avatar_type,
u.user_notify_pm AS pm_email_notify, u.user_active AS is_activated,
'' AS lngfile, '' AS buddy_list, '' AS pm_ignore_list, '' AS messageLabels,
'' AS personalText, '' AS timeFormat, '' AS usertitle, '' AS memberIP,
'' AS secretQuestion, '' AS secretAnswer, '' AS validation_code,
'' AS additionalGroups, '' AS smileySet, '' AS passwordSalt,
'' AS memberIP2
FROM `frenchwi_phpbb1`.phpbb_users AS u
LEFT JOIN `frenchwi_phpbb1`.phpbb_ranks AS r ON (r.rank_id = u.user_rank AND r.rank_special = 1)
LEFT JOIN `frenchwi_asdwforum`.smf_membergroups AS mg ON (BINARY mg.groupName = CONCAT('phpBB ', r.rank_title))
WHERE u.user_id != -1
GROUP BY u.user_id
LIMIT 0, 500;
Caused the error:

You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'AS emailAddress, 1, 255) AS emailAddress,
u.user_unread_privms

I am very new to all this and would appreciate a dummys guide to resolving this problem

thanks
Title: Re: PHPBB2 - problem with MySQL
Post by: Ferny on September 03, 2006, 03:41:33 PM
frwjd: see my post above yours and download that converter ;) It fixes this error and some others
Title: Re: PHPBB2 - problem with MySQL
Post by: frwjd on September 03, 2006, 05:28:57 PM
Ferny

What can I say? Superb!

sincere thanks
Title: Re: PHPBB2 - problem with MySQL
Post by: Kakao on September 04, 2006, 11:35:28 AM
Worked perfectly for me. Thanks.
Title: Re: PHPBB2 - problem with MySQL
Post by: janmartin on September 08, 2006, 07:20:23 AM
Using phpbb2_to_smf_2006_09_02.zip from above i got this error 23 times:

Warning: copy(/home/mysite/public_html/smf/Smileys/default/icon_confused.gif) [function.copy]: failed to open stream: Permission denied in /home/mysite/public_html/smf/convert.php(653) : eval()'d code on line 16

Any idea?
The rest seems to have worked.
Title: Re: PHPBB2 - problem with MySQL
Post by: Ferny on September 08, 2006, 09:22:16 AM
I think you have to make your directory writable
Chmod it to 777 and try again ;)

If you don't know how to do it or if you can't, you can also & paste the files from one directory to another. Affected files are smilies from phpbb. If you do it, you don't have to run the script again
Title: Re: PHPBB2 - problem with MySQL
Post by: JayBachatero on September 08, 2006, 09:34:20 AM
It might be that the file is missing.  Make sure that the file actually exists.
Title: Re: PHPBB2 - problem with MySQL
Post by: janmartin on September 08, 2006, 06:05:37 PM
Using phpbb2_to_smf_2006_09_02.zip from above with and smf 1.1 RC3 I noticed that the thumbnails are not converted and therefore not displayed.
So  attachments are displayed as a link only.

First I thought its a misconfiguaration in smf, but then I created a testuser and posted a new topic with an attachment. A thumbnail has been created and is displayed properly as a resized thumbnail and also link to the full size picture.

However thumbnails for converted attachments are missing in the smf/attachments folder and also the entries in the smf_attachments table.

Any idea?

The phpBB2 thumbs folder has right 0777 and the thumbnails 0644.

This is what phpmyadmin displays.
The top line is the thumbnail for the line under it.
All other lines are just attachments, but no thumbnails.

Thanks.


ID_ATTACH Descending       ID_THUMB       ID_MSG       ID_MEMBER       attachmentType       filename       size       downloads       width       height
68    0    192    0    3    Who is this again.jpg_thumb    206866    0    400    300
67    68     192    0    0    Who is this again.jpg    600535    1    2048    1536
66    0    190    0    0    Ikea Job Interview.jpg    39305    2    0    0
65    0    178    0    0    P7050025.jpg    282518    1    0    0
64    0    177    0    0    rotk_hobbitfoot.jpg    138667    0    0    0
Title: Re: PHPBB2 - problem with MySQL
Post by: JayBachatero on September 08, 2006, 10:10:23 PM
At the moment the conversion doesn't support converting thumbnails.
Title: Re: PHPBB2 - problem with MySQL
Post by: stockkarts on September 13, 2006, 03:00:57 PM
we also have a problem

http://www.simplemachines.org/community/index.php?topic=112262.msg727938#new

we would really like to convert
Title: Re: PHPBB2 - problem with MySQL
Post by: j3cubcapt on September 13, 2006, 09:25:48 PM
I WAS having trouble converting from PHPbb 2.0.21 to SMF 1.1 RC3, until I found this post. I used the phpbb2_to_smf_2006_09_02 Converter and everything including the Avatars came over.

Thanks
Will
Title: Re: PHPBB2 - problem with MySQL
Post by: JayBachatero on September 14, 2006, 08:12:28 AM
stockkarts did you try thos file?
http://person.acentermedia.net/SMF/phpbb2_to_smf_2006_08_26-3-utf8.zip
Title: Re: PHPBB2 - problem with MySQL
Post by: stockkarts on September 14, 2006, 01:02:33 PM
I got this

Notice: Undefined index: convert_script in /var/www/html/stockkarts2/convert.php on line 572

Warning: Invalid argument supplied for foreach() in /var/www/html/stockkarts2/convert.php on line 575

Notice: Undefined index: convert_script in /var/www/html/stockkarts2/convert.php on line 580
Successful.
Recalculating forum statistics...
Notice: Undefined variable: result in /var/www/html/stockkarts2/convert.php on line 1817

Notice: Undefined variable: result in /var/www/html/stockkarts2/convert.php on line 1818

Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /var/www/html/stockkarts2/convert.php on line 922

Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in /var/www/html/stockkarts2/convert.php on line 932

Notice: Undefined variable: result in /var/www/html/stockkarts2/convert.php on line 1817

Notice: Undefined variable: result in /var/www/html/stockkarts2/convert.php on line 1818

Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /var/www/html/stockkarts2/convert.php on line 940

Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in /var/www/html/stockkarts2/convert.php on line 950

Notice: Undefined variable: result in /var/www/html/stockkarts2/convert.php on line 1817

Notice: Undefined variable: result in /var/www/html/stockkarts2/convert.php on line 1818

Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /var/www/html/stockkarts2/convert.php on line 963

Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in /var/www/html/stockkarts2/convert.php on line 976

Notice: Undefined variable: result in /var/www/html/stockkarts2/convert.php on line 1817

Notice: Undefined variable: result in /var/www/html/stockkarts2/convert.php on line 1818

Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /var/www/html/stockkarts2/convert.php on line 1022

Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in /var/www/html/stockkarts2/convert.php on line 1024

Notice: Undefined variable: result in /var/www/html/stockkarts2/convert.php on line 1817

Notice: Undefined variable: result in /var/www/html/stockkarts2/convert.php on line 1818

Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /var/www/html/stockkarts2/convert.php on line 1030

Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in /var/www/html/stockkarts2/convert.php on line 1036

Notice: Undefined variable: result in /var/www/html/stockkarts2/convert.php on line 1817

Notice: Undefined variable: result in /var/www/html/stockkarts2/convert.php on line 1818

Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /var/www/html/stockkarts2/convert.php on line 1047

Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in /var/www/html/stockkarts2/convert.php on line 1048

Notice: Undefined variable: result in /var/www/html/stockkarts2/convert.php on line 1817

Notice: Undefined variable: result in /var/www/html/stockkarts2/convert.php on line 1818

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /var/www/html/stockkarts2/convert.php on line 1056

Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in /var/www/html/stockkarts2/convert.php on line 1058

Notice: Undefined variable: result in /var/www/html/stockkarts2/convert.php on line 1817

Notice: Undefined variable: result in /var/www/html/stockkarts2/convert.php on line 1818

Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /var/www/html/stockkarts2/convert.php on line 1064

Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in /var/www/html/stockkarts2/convert.php on line 1065

Notice: Undefined variable: result in /var/www/html/stockkarts2/convert.php on line 1817

Notice: Undefined variable: result in /var/www/html/stockkarts2/convert.php on line 1818

Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /var/www/html/stockkarts2/convert.php on line 1071

Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in /var/www/html/stockkarts2/convert.php on line 1072

Notice: Undefined variable: result in /var/www/html/stockkarts2/convert.php on line 1817

Notice: Undefined variable: result in /var/www/html/stockkarts2/convert.php on line 1818

Notice: Undefined variable: result in /var/www/html/stockkarts2/convert.php on line 1817

Notice: Undefined variable: result in /var/www/html/stockkarts2/convert.php on line 1818

Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /var/www/html/stockkarts2/convert.php on line 1096

Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in /var/www/html/stockkarts2/convert.php on line 1098

Notice: Undefined variable: result in /var/www/html/stockkarts2/convert.php on line 1817

Notice: Undefined variable: result in /var/www/html/stockkarts2/convert.php on line 1818

Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /var/www/html/stockkarts2/convert.php on line 1104

Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in /var/www/html/stockkarts2/convert.php on line 1116

Notice: Undefined variable: result in /var/www/html/stockkarts2/convert.php on line 1817

Notice: Undefined variable: result in /var/www/html/stockkarts2/convert.php on line 1818

Notice: Undefined variable: result in /var/www/html/stockkarts2/convert.php on line 1817

Notice: Undefined variable: result in /var/www/html/stockkarts2/convert.php on line 1818

Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /var/www/html/stockkarts2/convert.php on line 1141

Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in /var/www/html/stockkarts2/convert.php on line 1143

Notice: Undefined variable: result in /var/www/html/stockkarts2/convert.php on line 1817

Notice: Undefined variable: result in /var/www/html/stockkarts2/convert.php on line 1818

Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in /var/www/html/stockkarts2/convert.php on line 1179

Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in /var/www/html/stockkarts2/convert.php on line 1180

Notice: Undefined variable: result in /var/www/html/stockkarts2/convert.php on line 1817

Notice: Undefined variable: result in /var/www/html/stockkarts2/convert.php on line 1818

Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /var/www/html/stockkarts2/convert.php on line 1218

Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in /var/www/html/stockkarts2/convert.php on line 1223

Notice: Undefined variable: result in /var/www/html/stockkarts2/convert.php on line 1817

Notice: Undefined variable: result in /var/www/html/stockkarts2/convert.php on line 1818

Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /var/www/html/stockkarts2/convert.php on line 1284

Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in /var/www/html/stockkarts2/convert.php on line 1286

Notice: Undefined variable: result in /var/www/html/stockkarts2/convert.php on line 1817

Notice: Undefined variable: result in /var/www/html/stockkarts2/convert.php on line 1818

Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /var/www/html/stockkarts2/convert.php on line 1322

Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in /var/www/html/stockkarts2/convert.php on line 1341

Notice: Undefined variable: result in /var/www/html/stockkarts2/convert.php on line 1817

Notice: Undefined variable: result in /var/www/html/stockkarts2/convert.php on line 1818

Notice: Undefined variable: result in /var/www/html/stockkarts2/convert.php on line 1817

Notice: Undefined variable: result in /var/www/html/stockkarts2/convert.php on line 1818

Notice: Undefined variable: result in /var/www/html/stockkarts2/convert.php on line 1817

Notice: Undefined variable: result in /var/www/html/stockkarts2/convert.php on line 1818

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /var/www/html/stockkarts2/convert.php on line 1373
Successful.

but still no change to the new forum...
Title: Re: PHPBB2 - problem with MySQL
Post by: stockkarts on September 14, 2006, 01:27:22 PM
but when I try it again I get the same message I got in the other posts...
it acts like it's bringing across the posts and threads, but doesn't link them up so leaves them...

is it worth looking at uninstalling all our mods etc?
Title: Re: PHPBB2 - problem with MySQL
Post by: J. Williams on September 14, 2006, 01:30:55 PM
A mod of phpBB which changes the structure like CH is likely needed to be removed :P
Title: Re: PHPBB2 - problem with MySQL
Post by: stockkarts on September 14, 2006, 01:33:47 PM
Quote from: J J Williams on September 14, 2006, 01:30:55 PM
A mod of phpBB which changes the structure like CH is likely needed to be removed :P
daft question

"Changes the structure like CH"

????
Title: Re: PHPBB2 - problem with MySQL
Post by: J. Williams on September 14, 2006, 01:51:40 PM
Category Hierarchy, I do know some mods have an uninstall option; now I don't recommend this but if you have easy mod, revert to the backups of your first ever modification installed :P
Title: Re: PHPBB2 - problem with MySQL
Post by: stockkarts on September 14, 2006, 01:53:26 PM
um so things like attachment mod etc would do it then...  but do we just need to change the database don't we not the files....
Title: Re: PHPBB2 - problem with MySQL
Post by: J. Williams on September 14, 2006, 01:55:49 PM
Well actually no, your problem is a MYSQL related problem; did you make sure the SMF DB User can access your old phpbb's database?
Title: Re: PHPBB2 - problem with MySQL
Post by: stockkarts on September 14, 2006, 02:03:03 PM
how do you do that?
Title: Re: PHPBB2 - problem with MySQL
Post by: stockkarts on September 14, 2006, 02:10:11 PM
ok

I uninstall this database and then reinstalled the software (new forum) and than ran the convertor and it worked :)

thank you
Title: Re: PHPBB2 - problem with MySQL
Post by: panacea on September 14, 2006, 02:37:23 PM
I am converting from phpbb 2021 to smf 1.1 rc3
All iam concerned is about posts, so when i got error in converting the user i deleted all the users.

Then i got this error in converting posts


Converting posts (this may take some time)... Unsuccessful!
This query:
INSERT INTO `smfpaper2`.smf_messages
(ID_MSG, ID_TOPIC, posterTime, ID_MEMBER, posterEmail, subject, posterName, smileysEnabled, modifiedTime, posterIP, body, ID_BOARD, modifiedName, icon)
VALUES ('2', '2', '1123433567', '2', '', 'Paper 1', '', '1', '0', '128.107.253.41', 'blah blah title
<br />
<br />
<br />1) What is a smith chart used for
<br />
<br />2) How is impedance matching done and why do we need it (basically can talk about ideal power supply needing a low internal resistance and high load to function properly. so one stage of transistor amplifier has to have low o/p resistance and high i/p resistance for next stage- do look up all basic electronics) ( also about sinking high currents without damage)
<br />
<br />3) Name all flipflops u know and working esp. master slave.
<br />
<br />4) C programming - program to find how many 1\'s are present in an integer variable using bitwise operators. something about dynamic allocation, static functions, macros
<br />
<br />5) c++ virtual functions
<br />
<br />6) what types of control r there
', '1', '', 'xx'),
Title: Re: PHPBB2 - problem with MySQL
Post by: Person on September 17, 2006, 06:25:01 AM
Ok, I'm back ... and I'm going to apply all modifications into my version of converters ...
Title: Re: PHPBB2 - problem with MySQL
Post by: okbluejays on September 17, 2006, 07:39:42 PM
Converting a forum  and getting the following when it unsuccessfully converts users. Its all greek to me


    SELECT
    u.user_id AS ID_MEMBER, SUBSTRING(u.username, 1, 80) AS memberName,
    SUBSTRING(u.username, 1, 255) AS realName,
    SUBSTRING(u.user_password, 1, 64) AS passwd, u.user_lastvisit AS lastLogin,
    u.user_regdate AS dateRegistered,
    SUBSTRING(u.user_from, 1, 255) AS location,
    u.user_posts AS posts, IF(u.user_level = 1, 1, mg.ID_GROUP) AS ID_GROUP,
    u.user_new_privmsg AS instantMessages,
    SUBSTRING(u.user_email AS emailAddress, 1, 255) AS emailAddress,
    u.user_unread_privmsg AS unreadMessages,
    SUBSTRING(u.user_msnm AS MSN, 1, 255) AS MSN,
    SUBSTRING(u.user_aim AS AIM, 1, 16) AS AIM,
    SUBSTRING(u.user_icq, 1, 255) AS ICQ,
    SUBSTRING(u.user_yim, 1, 32) AS YIM,
    SUBSTRING(u.user_website, 1, 255) AS websiteTitle,
    SUBSTRING(u.user_website, 1, 255) AS websiteUrl,
    u.user_allow_viewonline AS showOnline, u.user_timezone AS timeOffset,
    IF(u.user_viewemail = 1, 0, 1) AS hideEmail, u.user_avatar AS avatar,
    REPLACE(u.user_sig, '\n', '<br />') AS signature,
    u.user_sig_bbcode_uid AS signature_uid, u.user_avatar_type,
    u.user_notify_pm AS pm_email_notify, u.user_active AS is_activated,
    '' AS lngfile, '' AS buddy_list, '' AS pm_ignore_list, '' AS messageLabels,
    '' AS personalText, '' AS timeFormat, '' AS usertitle, '' AS memberIP,
    '' AS secretQuestion, '' AS secretAnswer, '' AS validation_code,
    '' AS additionalGroups, '' AS smileySet, '' AS passwordSalt,
    '' AS memberIP2
    FROM `hockey_hhhockeyforum`.phpbb_users AS u
    LEFT JOIN `hockey_hhhockeyforum`.phpbb_ranks AS r ON (r.rank_id = u.user_rank AND r.rank_special = 1)
    LEFT JOIN `hockey_hhhockeyforum`.smf_membergroups AS mg ON (BINARY mg.groupName = CONCAT('phpBB ', r.rank_title))
    WHERE u.user_id != -1
    GROUP BY u.user_id
    LIMIT 0, 500;

Caused the error:

    You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AS emailAddress, 1, 255) AS emailAddress,
    u.user_unread_privmsg AS unreadMessag' at line 9
Title: Re: PHPBB2 - problem with MySQL
Post by: Ferny on September 18, 2006, 09:23:37 AM
Use this: phpbb2_to_smf_2006_09_02.zip (http://ultrashare.net/hosting/fl/776a7ef05d/)
Title: Re: PHPBB2 - problem with MySQL
Post by: bebe on September 19, 2006, 11:49:54 PM
Never mind, problems solved.
I got the status changed from "Awaiting Activation" to "Awaiting Approval" using the following query in MyPhpAdmin:-
UPDATE smf_members SET is_activated=REPLACE(is_activated, '0', '3')


Hi,

I used the above converter to convert phpBB 2.0.21 to SMF 1.1 RC3 without any problems. Thanks Ferny. :)

Now i have a small problem.

I have been using "enable account activation by Admin" (which should be the registration method of "Member Approval" in SMF) with my existing forum and i have a lot of members have not been activated (i managed to leave the records there without showing to others except the admin with a mod).
After converting to SMF, i discovered that those members not activated by Admin, which i reckon should be similar to the case of "members not yet approved by the admin" in SMF, are showing in "Awaiting Activation" list instead of "Awaiting Approval" list. (If the forum has been using "enable account activation by Users" in phoBB, which should be the same as registration method of "Members Activation" in SMF, then those who has not yet activated their account should be showing in "Awaiting Activation" list.)

May i know what can i do (changing of scripts?) to have those members' to be listed under "Awaiting Approval" instead of "Awaiting Activation" once the database being converted from phpBB to SMF?

Would love to have your help asap. Thanks.
Title: Re: PHPBB2 - problem with MySQL
Post by: limpbrains on September 20, 2006, 07:15:33 AM
I'm trying to convert phpbb 2.0.21 to SMF 1.1 RC3
when using usual converter a have this error


Converting ranks... Successful.
Converting groups... Successful.
Converting members... Unsuccessful!
This query:

    SELECT
    u.user_id AS ID_MEMBER, SUBSTRING(u.username, 1, 80) AS memberName,
    SUBSTRING(u.username, 1, 255) AS realName,
    SUBSTRING(u.user_password, 1, 64) AS passwd, u.user_lastvisit AS lastLogin,
    u.user_regdate AS dateRegistered,
    SUBSTRING(u.user_from, 1, 255) AS location,
    u.user_posts AS posts, IF(u.user_level = 1, 1, mg.ID_GROUP) AS ID_GROUP,
    u.user_new_privmsg AS instantMessages,
    SUBSTRING(u.user_email AS emailAddress, 1, 255) AS emailAddress,
    u.user_unread_privmsg AS unreadMessages,
    SUBSTRING(u.user_msnm AS MSN, 1, 255) AS MSN,
    SUBSTRING(u.user_aim AS AIM, 1, 16) AS AIM,
    SUBSTRING(u.user_icq, 1, 255) AS ICQ,
    SUBSTRING(u.user_yim, 1, 32) AS YIM,
    SUBSTRING(u.user_website, 1, 255) AS websiteTitle,
    SUBSTRING(u.user_website, 1, 255) AS websiteUrl,
    u.user_allow_viewonline AS showOnline, u.user_timezone AS timeOffset,
    IF(u.user_viewemail = 1, 0, 1) AS hideEmail, u.user_avatar AS avatar,
    REPLACE(u.user_sig, '\n', '<br />') AS signature,
    u.user_sig_bbcode_uid AS signature_uid, u.user_avatar_type,
    u.user_notify_pm AS pm_email_notify, u.user_active AS is_activated,
    '' AS lngfile, '' AS buddy_list, '' AS pm_ignore_list, '' AS messageLabels,
    '' AS personalText, '' AS timeFormat, '' AS usertitle, '' AS memberIP,
    '' AS secretQuestion, '' AS secretAnswer, '' AS validation_code,
    '' AS additionalGroups, '' AS smileySet, '' AS passwordSalt,
    '' AS memberIP2
    FROM `forum`.phpbb_users AS u
    LEFT JOIN `forum`.phpbb_ranks AS r ON (r.rank_id = u.user_rank AND r.rank_special = 1)
    LEFT JOIN `site`.smf_membergroups AS mg ON (BINARY mg.groupName = CONCAT('phpBB ', r.rank_title))
    WHERE u.user_id != -1
    GROUP BY u.user_id
    LIMIT 0, 500;

Caused the error:

    You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AS emailAddress, 1, 255) AS emailAddress,
    u.user_unread_privmsg AS unreadMessag' at line 9


when trying

http://acentermedia.net/Person/SMF/phpbb2_to_smf_2006_08_26-3.zip (http://acentermedia.net/Person/SMF/phpbb2_to_smf_2006_08_26-3.zip)
or
http://person.acentermedia.net/SMF/phpbb2_to_smf_2006_08_26-3-utf8.zip (http://person.acentermedia.net/SMF/phpbb2_to_smf_2006_08_26-3-utf8.zip)

there is no errors but script ends unexpectly



Converting...
Converting ranks... Successful.
Converting groups... Successful.
Converting smileys...
Title: Re: PHPBB2 - problem with MySQL
Post by: limpbrains on September 20, 2006, 09:13:59 AM
sorry, a little mistace.
I have tried

phpbb2_to_smf_2006_08_26-3.zip
and
phpbb2_to_smf_2006_09_02.zip

not
phpbb2_to_smf_2006_08_26-3.zip
and
phpbb2_to_smf_2006_08_26-3-utf8.zip

and phpbb2_to_smf_2006_09_02.zip gives the same error
Title: Re: PHPBB2 - problem with MySQL
Post by: bebe on September 20, 2006, 09:36:13 AM
Well, i just found out another problem even though i got no errors in the process of converting.

The Approved Member's count and list is correct, the Awaiting Approval's count and list is correct too. The problem lies with the "View All Members" list, it only shows 3 pages... why ???



I found out that the problem is not caused by the converter, hence, i'll continue in search of the solutions here (http://www.simplemachines.org/community/index.php?topic=115197.0).
Title: Re: PHPBB2 - problem with MySQL
Post by: Person on September 21, 2006, 10:27:41 AM
I have repacked version phpbb2_to_smf_2006_09_02.zip:

This is only difference between default and UTF8 version:

Code ("Default charset for MySQL") Select
// Persist?
if (empty($db_persist))
mysql_connect($db_server, $db_user, $db_passwd);
else
mysql_pconnect($db_server, $db_user, $db_passwd);


Code ("UTF8 charset for MySQL") Select
// Persist?
if (empty($db_persist))
mysql_connect($db_server, $db_user, $db_passwd);
else
mysql_pconnect($db_server, $db_user, $db_passwd);

// UTF8
mysql_query("SET NAMES UTF8");


New files:
phpbb2_to_smf_2006_09_21.zip (http://smf.person-lab.net/phpbb2_to_smf_2006_09_21.zip)
phpbb2_to_smf_2006_09_21-utf8.zip (http://smf.person-lab.net/phpbb2_to_smf_2006_09_21-utf8.zip)

And other old files:
smf.person-lab.net (http://smf.person-lab.net)

By
Title: Re: PHPBB2 - problem with MySQL
Post by: limpbrains on September 22, 2006, 01:50:50 AM
To slove my problem with smileys

I've just deleted this section from phpbb2_to_smf.sql  ;D

But now Im have the folowing error


Converting topics... Unsuccessful!
This query:

    INSERT INTO `site`.smf_topics
    (ID_TOPIC, isSticky, ID_FIRST_MSG, ID_LAST_MSG, ID_MEMBER_STARTED, ID_MEMBER_UPDATED, ID_BOARD, ID_POLL, locked, numReplies, numViews)
    VALUES ('3', '0', '6', '6', '4', '4', '7', '0', '1', '0', '460'),
    ('4', '0', '15', '4212', '4', '4', '7', '0', '1', '2', '2770'),
    ('5', '0', '20', '20', '4', '4', '7', '0', '1', '0', '467'),
    ('6', '0', '21', '21', '4', '4', '2', '0', '1', '0', '539'),
    ('7', '0', '22', '1486', '6', '16', '6', '0', '0', '21', '1037'),
    ('8', '0', '23', '697', '6', '109', '5', '0', '0', '17', '956'),
    ('10', '0', '29', '29', '4', '4', '9', '0', '1', '0', '304'),
    ('11', '0', '32', '6598', '9', '166', '6', '0', '0', '31', '1559'),
    ('12', '0', '34', '34', '4', '4', '4', '0', '1', '0', '392'),
    ('13', '0', '38', '38', '2', '2', '2', '0', '1', '0', '3109'),
    ('14', '0', '43', '308', '8', '36', '3', '0', '0', '19', '892'),
    ('16', '0', '47', '49', '8', '8', '5', '0', '0', '2', '314'),
    ('17', '0', '64', '3668', '8', '93', '5', '0', '0', '41', '2599'),
    ('19', '0', '99', '99', '6', '6', '3', '0', '0', '0', '225'),
    ('20', '0', '101', '109', '6', '6', '3', '0', '0', '5', '343'),
    ('21', '0', '103', '105', '16', '2', '5', '0', '1', '1', '313'),
    ('22', '0', '108', '6091', '4', '93', '12', '0', '1', '9', '441'),
    ('23', '0', '110', '407', '6', '6', '8', '0', '0', '9', '66'),
    ('24', '0', '111', '111', '6', '6', '3', '0', '0', '0', '197'),
    ('25', '0', '113', '113', '6', '6', '3', '0', '0', '0', '201'),
    ('26', '0', '119', '349', '6', '7', '3', '0', '0', '4', '299'),
...
    ('564', '0', '4518', '4524', '166', '193', '3', '0', '0', '3', '100'),
    ('565', '0', '4522', '4598', '93', '166', '8', '0', '0', '5', '40'),
    ('566', '0', '4554', '4566', '166', '193', '3', '0', '0', '1', '78'),
    ('567', '0', '4556', '4561', '280', '105', '9', '0', '0', '2', '101'),
    ('568', '0', '4557', '4567', '280', '154', '3', '0', '0', '3', '107');


Caused the error:

    Duplicate entry '833-5' for key 3

Title: Re: PHPBB2 - problem with MySQL
Post by: bebe on September 22, 2006, 07:43:29 AM
Hi Person,
I used "phpbb2_to_smf_2006_09_21-utf8.zip" and successfully in converting phpBB 2.0.21 to SMF 1.1 RC3 (without any error or problems). :)
Title: Re: PHPBB2 - problem with MySQL
Post by: Person on September 22, 2006, 08:09:33 AM
Cool ... I have made this simple utf8 mod to convert phpBB2 forum which is in Slovenian language (special characters [ščćžđ ŠČĆŽĐ]).
The original version don't convert this characters. ;)
Title: Re: PHPBB2 - problem with MySQL
Post by: sayokan on September 25, 2006, 09:42:09 AM
I used the same file and converted with no problems but what I have is all none English characters are muddled up like "gönüllüsü arkadaþlar".

I have SMF setup in Turkish language. Any ideas would be highly appriciated!!!
Title: Re: PHPBB2 - problem with MySQL
Post by: chipset66 on September 25, 2006, 10:27:25 AM
Hi,
I to use this version: phpbb2_to_smf_2006_09_21.
This works, but with a 1 mini problem: Everi group have 5 stars instead 1, 2, 3......8. I fix this from adminpanel for everi group and now is OK.

10x for this updated convert.
Title: Re: PHPBB2 - problem with MySQL
Post by: EvilDragon on September 25, 2006, 07:33:32 PM
I tried it (and many other converter versions...) But I have a similar problem as above:


Converting...
Converting ranks... Successful.
Converting groups... Successful.
Converting smileys... Successful.
Converting members... Successful.
Converting additional member groups... Successful.
Converting categories... Successful.
Converting boards... Successful.
Converting topics... Unsuccessful!
This query:
INSERT INTO `sql740`.smf_topics
(ID_TOPIC, isSticky, ID_FIRST_MSG, ID_LAST_MSG, ID_MEMBER_STARTED, ID_MEMBER_UPDATED, ID_BOARD, ID_POLL, locked, numReplies, numViews)
VALUES ('2039', '0', '26421', '26461', '2', '148', '2', '0', '0', '1', '369'),
('2040', '0', '26438', '35943', '512', '674', '4', '0', '0', '6', '538'),
('2041', '0', '26443', '26616', '78', '181', '9', '0', '0', '33', '1196'),
('2042', '0', '26448', '26552', '512', '109', '8', '0', '0', '5', '373'),
('2043', '0', '26487', '26648', '286', '286', '9', '0', '0', '20', '683'),
('2044', '0', '26518', '26613', '35', '79', '2', '0', '0', '5', '527'),
('2045', '0', '26543', '30672', '517', '11', '15', '0', '0', '5', '353'),
('2046', '0', '26549', '26553', '106', '488', '8', '0', '0', '1', '240'),
('2047', '0', '26559', '26857', '526', '447', '5', '0', '0', '17', '757'),
('2048', '0', '26575', '26772', '181', '181', '9', '0', '0', '7', '363'),
('2049', '0', '26576', '26576', '13', '13', '1', '0', '0', '0', '395'),

... some SQL lines deleted...

('2071', '0', '26882', '27070', '445', '200', '10', '0', '0', '4', '343'),
('2072', '0', '26882', '26882', '445', '445', '10', '0', '0', '0', '15'),
('2073', '0', '26890', '26958', '530', '530', '5', '0', '0', '5', '207'),
('2074', '0', '26910', '26914', '62', '4', '6', '0', '0', '2', '254'),
('2075', '0', '26916', '26959', '-1', '181', '18', '0', '0', '11', '466'),
('2076', '0', '26922', '27399', '428', '28', '1', '0', '0', '10', '615'),
('2077', '0', '26936', '26967', '517', '517', '5', '0', '0', '8', '216'),

... some more SQL Lines deleted...

Caused the error:

Duplicate entry '26882-10' for key 3

[/quote]

I checked the Database of php2bb, and there are definately no two entries for 26882...

Any idea?
Title: Re: PHPBB2 - problem with MySQL
Post by: sayokan on September 27, 2006, 06:20:54 AM
Quote from: Ferny on September 03, 2006, 03:41:33 PM
frwjd: see my post above yours and download that converter ;) It fixes this error and some others

This worked fine to convert but I am having this error now:

Database Error
Please try again. If you come back to this error screen, report the error to an administrator.

It prevents me logging into system and also doesn't show anything.
Title: Re: PHPBB2 - problem with MySQL
Post by: kRisTen26 on September 30, 2006, 11:18:39 PM
I feel like a total idiot and I've been at this for hours.  I've finally gotten the converter to actually DO something and wind up with this:

Converting...
Converting ranks... Successful.
Converting groups... Successful.
Converting members... Unsuccessful!
This query:

    SELECT
    u.user_id AS ID_MEMBER, SUBSTRING(u.username, 1, 80) AS memberName,
    SUBSTRING(u.username, 1, 255) AS realName,
    SUBSTRING(u.user_password, 1, 64) AS passwd, u.user_lastvisit AS lastLogin,
    u.user_regdate AS dateRegistered,
    SUBSTRING(u.user_from, 1, 255) AS location,
    u.user_posts AS posts, IF(u.user_level = 1, 1, mg.ID_GROUP) AS ID_GROUP,
    u.user_new_privmsg AS instantMessages,
    SUBSTRING(u.user_email AS emailAddress, 1, 255) AS emailAddress,
    u.user_unread_privmsg AS unreadMessages,
    SUBSTRING(u.user_msnm AS MSN, 1, 255) AS MSN,
    SUBSTRING(u.user_aim AS AIM, 1, 16) AS AIM,
    SUBSTRING(u.user_icq, 1, 255) AS ICQ,
    SUBSTRING(u.user_yim, 1, 32) AS YIM,
    SUBSTRING(u.user_website, 1, 255) AS websiteTitle,
    SUBSTRING(u.user_website, 1, 255) AS websiteUrl,
    u.user_allow_viewonline AS showOnline, u.user_timezone AS timeOffset,
    IF(u.user_viewemail = 1, 0, 1) AS hideEmail, u.user_avatar AS avatar,
    REPLACE(u.user_sig, '\n', '<br />') AS signature,
    u.user_sig_bbcode_uid AS signature_uid, u.user_avatar_type,
    u.user_notify_pm AS pm_email_notify, u.user_active AS is_activated,
    '' AS lngfile, '' AS buddy_list, '' AS pm_ignore_list, '' AS messageLabels,
    '' AS personalText, '' AS timeFormat, '' AS usertitle, '' AS memberIP,
    '' AS secretQuestion, '' AS secretAnswer, '' AS validation_code,
    '' AS additionalGroups, '' AS smileySet, '' AS passwordSalt,
    '' AS memberIP2
    FROM `desti10_forum`.phpbb_users AS u
    LEFT JOIN `desti10_forum`.phpbb_ranks AS r ON (r.rank_id = u.user_rank AND r.rank_special = 1)
    LEFT JOIN `desti10_Forum`.smf_membergroups AS mg ON (BINARY mg.groupName = CONCAT('phpBB ', r.rank_title))
    WHERE u.user_id != -1
    GROUP BY u.user_id
    LIMIT 0, 500;

Caused the error:

    You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AS emailAddress, 1, 255) AS emailAddress,
    u.user_unread_privmsg AS unreadMessag' at line 9

What's causing it and HOW can I fix it?! 

I'm going a little out of my mind here...

Kristen
Title: Re: PHPBB2 - problem with MySQL
Post by: Person on October 01, 2006, 05:07:30 AM
Please read this: (some posts above)
http://www.simplemachines.org/community/index.php?topic=107868.msg738192#msg738192 (http://www.simplemachines.org/community/index.php?topic=107868.msg738192#msg738192)
Title: Re: PHPBB2 - problem with MySQL
Post by: kRisTen26 on October 01, 2006, 05:01:11 PM
Thanks for the advice.  I've downloaded and run the phpbb2_to_smf_2006_09_21-utf8.zip file, but am now getting this error:

Converting ranks... Successful.
Converting groups... Successful.
Converting smileys...
Fatal error: Call to undefined function: copy_dir() in /home/desti10/public_html/Forum/convert.php(656) : eval()'d code on line 13

I'm still stumped... :(

Title: Re: PHPBB2 - problem with MySQL
Post by: Oldiesmann on October 01, 2006, 05:41:35 PM
copy_dir is defined in the phpbb2_to_smf.sql file, so I'm not sure why you're getting that error...
Title: Re: PHPBB2 - problem with MySQL
Post by: kRisTen26 on October 01, 2006, 06:22:54 PM
Is there anything I can do to fix it?  I have not altered the uploaded files in any way.  I've also tried going from my phpBB board to the 1.0.8 version and just a 500 error when I delete the 1.1 and upload the 1.0.8 files.  The 1.1 board runs, but will not convert. ::)

Title: Re: PHPBB2 - problem with MySQL
Post by: Oldiesmann on October 02, 2006, 02:04:47 PM
Try moving the "function copy_dir" block from phpbb2_to_smf.sql to convert.php - that might make the converter think it's defined (especially if you put the function declaration at the beginning of the file).
Title: Re: PHPBB2 - problem with MySQL
Post by: Burke on October 08, 2006, 09:15:53 PM
I am trying to convert from phpBB2 Plus 1.53a (http://www.phpbb2.de) to SMF 1.1 RC3 using these converters:

phpbb2_to_smf_2006_09_02.zip
phpbb2_to_smf_2006_09_21.zip
phpbb2_to_smf_2006_09_21-utf8.zip
smf_1-1-rc3_phpbb2_converter.zip

I know that the converters are supposed to convert only clean phpBB2 boards, but the Plus version is based on phpBB2 and should work I guess. I would appreciate any help. Thanks.

The error message:

Converting...
Converting ranks... Successful.
Converting groups... Successful.
Converting members... Unsuccessful!
This query:
SELECT
u.user_id AS ID_MEMBER, SUBSTRING(u.username, 1, 80) AS memberName,
SUBSTRING(u.username, 1, 255) AS realName,
SUBSTRING(u.user_password, 1, 64) AS passwd, u.user_lastvisit AS lastLogin,
u.user_regdate AS dateRegistered,
SUBSTRING(u.user_from, 1, 255) AS location,
u.user_posts AS posts, IF(u.user_level = 1, 1, mg.ID_GROUP) AS ID_GROUP,
u.user_new_privmsg AS instantMessages,
SUBSTRING(u.user_email AS emailAddress, 1, 255) AS emailAddress,
u.user_unread_privmsg AS unreadMessages,
SUBSTRING(u.user_msnm AS MSN, 1, 255) AS MSN,
SUBSTRING(u.user_aim AS AIM, 1, 16) AS AIM,
SUBSTRING(u.user_icq, 1, 255) AS ICQ,
SUBSTRING(u.user_yim, 1, 32) AS YIM,
SUBSTRING(u.user_website, 1, 255) AS websiteTitle,
SUBSTRING(u.user_website, 1, 255) AS websiteUrl,
u.user_allow_viewonline AS showOnline, u.user_timezone AS timeOffset,
IF(u.user_viewemail = 1, 0, 1) AS hideEmail, u.user_avatar AS avatar,
REPLACE(u.user_sig, '\n', '<br />') AS signature,
u.user_sig_bbcode_uid AS signature_uid, u.user_avatar_type,
u.user_notify_pm AS pm_email_notify, u.user_active AS is_activated,
'' AS lngfile, '' AS buddy_list, '' AS pm_ignore_list, '' AS messageLabels,
'' AS personalText, '' AS timeFormat, '' AS usertitle, '' AS memberIP,
'' AS secretQuestion, '' AS secretAnswer, '' AS validation_code,
'' AS additionalGroups, '' AS smileySet, '' AS passwordSalt,
'' AS memberIP2
FROM `database1`.phpbb_users AS u
LEFT JOIN `database1`.phpbb_ranks AS r ON (r.rank_id = u.user_rank AND r.rank_special = 1)
LEFT JOIN `database2`.smf_membergroups AS mg ON (BINARY mg.groupName = CONCAT('phpBB ', r.rank_title))
WHERE u.user_id != -1
GROUP BY u.user_id
LIMIT 0, 500;
Caused the error:

You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'AS emailAddress, 1, 255) AS emailAddress,
u.user_unread_privms
Title: Re: PHPBB2 - problem with MySQL
Post by: Ferny on October 09, 2006, 10:13:02 AM
This error should be fixed in: phpbb2_to_smf_2006_09_02.zip phpbb2_to_smf_2006_09_21.zip and phpbb2_to_smf_2006_09_21-utf8.zip

Delete current convert.php and phpbb2_to_smf.sql, unzip phpbb2_to_smf_2006_09_21.zip and use the files from them (it's the latest update).
Title: Re: PHPBB2 - problem with MySQL
Post by: kRisTen26 on October 09, 2006, 04:07:32 PM
At the risk of sounding dumb, you only need to use one converter, right?  I've been trying to use the    phpbb2_to_smf_2006_09_21-utf8.zip version and have not been successful.  I'm still coming up with "Converting...
Converting ranks... Successful.
Converting groups... Successful.
Converting smileys...
Fatal error: Call to undefined function: copy_dir() in /home/desti10/public_html/smf/convert.php(656) : eval()'d code on line 13"

Do I need to use another converter as well? 
Title: Re: PHPBB2 - problem with MySQL
Post by: Burke on October 09, 2006, 04:09:09 PM
Thanks, I did that. I tried all the convertion scripts. Using the latest update, this happens:

I still get errorr. It shows that error occurs with images, and with smileys. It is impossbile for me to get the log, as everything flows fast accros the screen, and then finally shows as the convertion was successful. While the Convert.php is running, it shows a lot of errors regarding at least images and smileys, but at the end it says that the convertion was successful. This is kind of a contradict I think. Can anyone tell me why I get this error, and perhpas tell me if the convertion was indeed succesful or not as the convert.php ends up reporting. Thanks.
Title: Re: PHPBB2 - problem with MySQL
Post by: Ferny on October 09, 2006, 04:28:26 PM
Quote from: Burke on October 09, 2006, 04:09:09 PM
Thanks, I did that. I tried all the convertion scripts. Using the latest update, this happens:

I still get errorr. It shows that error occurs with images, and with smileys. It is impossbile for me to get the log, as everything flows fast accros the screen, and then finally shows as the convertion was successful. While the Convert.php is running, it shows a lot of errors regarding at least images and smileys, but at the end it says that the convertion was successful. This is kind of a contradict I think. Can anyone tell me why I get this error, and perhpas tell me if the convertion was indeed succesful or not as the convert.php ends up reporting. Thanks.

I think those errors occur because the script can't copy files from one directory to other (an example, if your directory doesn't have writing permission). You can copy them by hand ;)
Title: Re: PHPBB2 - problem with MySQL
Post by: Oldiesmann on October 09, 2006, 05:29:00 PM
Ok... Try these files. I moved the copy_dir function from phpbb2_to_smf.sql to convert.php.
Title: Re: PHPBB2 - problem with MySQL
Post by: Resourcez on October 09, 2006, 08:15:32 PM
The issue is probably that the file permissions in the 'copy to' directory are incorrect e.g. they may be 755 instead of 644.
Title: Re: PHPBB2 - problem with MySQL
Post by: Burke on October 10, 2006, 05:30:53 PM
Thanks for the suggestions. I now get these 3 errors:

Converting attachment mod (if installed)... Incomplete

Copying smileys
Warning: copy(/hsphere/local/home/xxx/domain.tld/smf/Smileys/default/icon_arrow.gif): failed to open stream: Permission denied in /hsphere/local/home/xxx/domain.tld/smf/convert.php(653) : eval()'d code on line 16

Copying Avatars (including the images in the /avatars/gallery folder of phpBB2)
Warning: copy(/hsphere/local/home/xxx/domain.tld/smf/avatars/gallery/World_of_Warcraft/004.gif): failed to open stream: No such file or directory in /hsphere/local/home/xxx/domain.tld/smf/convert.php(653) : eval()'d code on line 16

What might be wrong? I checked the CHMOD, the avatars folder etc. are all 777 so should not be because of the permissions. And actually ALL files (attachments and avatars) are copied to the /smf/attachments folder. I thought that avartars images should be copied to the /smf/avatars images folder? Anyway, despite the copying of files, I still get the above errors. Thanks.
Title: Re: PHPBB2 - problem with MySQL
Post by: jacky on October 14, 2006, 08:37:37 AM
hi, im french and i have a error with the script.


Converting...
Converting ranks... Successful.
Converting groups... Successful.
Converting smileys... Successful.
Converting members... Successful.
Converting additional member groups... Successful.
Converting categories... Successful.
Converting boards... Successful.
Converting topics... Successful.
Converting posts (this may take some time)... Unsuccessful!
This query:

    SELECT
    p.post_id AS ID_MSG, p.topic_id AS ID_TOPIC, p.post_time AS posterTime,
    p.poster_id AS ID_MEMBER,
    SUBSTRING(IFNULL(u.user_email, ''), 1, 255) AS posterEmail,
    SUBSTRING(IF(IFNULL(pt.post_subject, '') = '', t.topic_title, pt.post_subject), 1, 255) AS subject,
    SUBSTRING(IF(IFNULL(p.post_username, '') = '', u.username, p.post_username), 1, 255) AS posterName,
    p.enable_smilies AS smileysEnabled, IF(p.post_edit_time > 0, p.post_edit_time, 0) AS modifiedTime,
    CONCAT_WS('.', CONV(SUBSTRING(p.poster_ip, 1, 2), 16, 10), CONV(SUBSTRING(p.poster_ip, 3, 2), 16, 10), CONV(SUBSTRING(p.poster_ip, 5, 2), 16, 10), CONV(SUBSTRING(p.poster_ip, 7, 2), 16, 10)) AS posterIP,
    SUBSTRING(REPLACE(REPLACE(IF(pt.bbcode_uid = '', pt.post_text, REPLACE(REPLACE(REPLACE(pt.post_text, CONCAT(':u:', pt.bbcode_uid), ''), CONCAT(':1:', pt.bbcode_uid), ''), CONCAT(':', pt.bbcode_uid), '')), '\n', '<br />'), '"', '"'), 1, 65534) AS body,
    p.forum_id AS ID_BOARD, '' AS modifiedName, 'xx' AS icon
    FROM (`forum`.phpbb_posts AS p, `forum`.phpbb_posts_text AS pt, `forum`.phpbb_topics AS t)
    LEFT JOIN `forum`.phpbb_users AS u ON (u.user_id = p.poster_id)
    WHERE pt.post_id = p.post_id
    AND t.topic_id = p.topic_id
    LIMIT 0, 200;

Caused the error:

    Champ 'pt.post_subject' inconnu dans field list


What is the problem?
I already used other corrected scripts
thanks
Title: Re: PHPBB2 - problem with MySQL
Post by: Oldiesmann on October 14, 2006, 02:06:46 PM
It's saying that the post_subject column doesn't exist in the phpbb_posts_text table. Try this SQL file (upload it to your forum directory, overwriting the existing one).
Title: Re: PHPBB2 - problem with MySQL
Post by: jacky on October 14, 2006, 07:00:53 PM
I don't know too much in sql, which would be the code?
Title: Re: PHPBB2 - problem with MySQL
Post by: Oldiesmann on October 14, 2006, 07:34:09 PM
There are two files that you need for the converter - convert.php and phpbb2_to_smf.sql. Download the SQL file I attached to my last post in this topic and upload it to your SMF directory, overwriting the existing one.
Title: Re: PHPBB2 - problem with MySQL
Post by: jacky on October 15, 2006, 06:39:41 AM
Sorry I had not seen the file   :P

It's good, thanks you  :-*
Title: Re: PHPBB2 - problem with MySQL
Post by: Iehova on October 15, 2006, 02:18:15 PM
I, like many others, am having trouble converting from phpBB2. I've tried every converter in this topic and I'm still getting the same (apparently common) problem:

Converting ranks... Successful.
Converting groups... Successful.
Converting smileys... Successful.
Converting members... Successful.
Converting additional member groups... Successful.
Converting categories... Successful.
Converting boards... Successful.
Converting topics... Unsuccessful!
This query:

    INSERT INTO `iehova_smf1`.smf_topics
    (ID_TOPIC, isSticky, ID_FIRST_MSG, ID_LAST_MSG, ID_MEMBER_STARTED, ID_MEMBER_UPDATED, ID_BOARD, ID_POLL, locked, numReplies, numViews)
    VALUES ('530', '0', '20682', '24773', '138', '138', '29', '0', '0', '268', '4812'),
    ('531', '0', '20683', '24096', '2', '9', '11', '0', '1', '25', '78'),
    ('532', '0', '20684', '21335', '2', '115', '30', '0', '0', '26', '59'),
    ('533', '0', '20696', '21281', '2', '115', '30', '0', '0', '26', '59'),
    ('534', '0', '20774', '20875', '2', '115', '30', '0', '0', '1', '11'),
    ('535', '0', '20828', '22015', '34', '34', '22', '0', '0', '8', '20'),

[...]

    ('1008', '0', '34081', '34081', '83', '83', '37', '0', '0', '0', '3'),
    ('1009', '0', '34082', '34085', '83', '83', '37', '0', '0', '3', '5'),
    ('1010', '0', '34089', '34091', '83', '83', '9', '0', '0', '2', '9'),
    ('1011', '0', '34094', '34094', '2', '2', '9', '0', '0', '0', '3'),
    ('1012', '0', '34095', '34099', '2', '2', '3', '0', '0', '2', '6');

Caused the error:

    Duplicate entry '6410-15' for key 2


Any ideas?
Title: Re: PHPBB2 - problem with MySQL
Post by: mycroft on October 20, 2006, 01:25:26 PM
Same here, same error.  ANY help would be appreciated; if I can't move my board from phpBB to SMF, I will have to stick with phpBB, which I'd rather *not* do.

I've tried the conversion routine on several phpBB boards I administer; sometimes I get the duplicate key for TOPICS and sometimes for MESSAGES, but it ALWAYS is a duplicate key error.

Help.
Title: Re: PHPBB2 - problem with MySQL
Post by: Oldiesmann on October 20, 2006, 02:03:20 PM
phpbb2_to_smf.sql

Find
/* // !!! WHERE t.topic_moved_id = 0 */

Replace
WHERE t.topic_moved_id = 0

I believe that will fix the problem.
Title: Re: PHPBB2 - problem with MySQL
Post by: mycroft on October 20, 2006, 02:08:05 PM
The version of phpbb2_to_smf.sql I have already has that particular change applied.  Is there a comparable analog to the actual message conversion routine?

Many thanks for your reply.

Title: Re: PHPBB2 - problem with MySQL
Post by: Oldiesmann on October 20, 2006, 02:11:00 PM
What specific error message are you getting for the messages?
Title: Re: PHPBB2 - problem with MySQL
Post by: mycroft on October 20, 2006, 02:13:31 PM
I have the conversion script running again now; it's the same duplicate key message, only during the post conversion.  I note that the script does bulk inserts; I know that's faster, but more difficult to recover from if there's an error.  What happens is that the post conversion section gets to a place where it fancies it has a duplicate post (same id_msg) and bombs out with the error message noted.
Title: Re: PHPBB2 - problem with MySQL
Post by: Oldiesmann on October 20, 2006, 02:19:03 PM
Hmmm... Try this one and see if it works.
Title: Re: PHPBB2 - problem with MySQL
Post by: mycroft on October 20, 2006, 03:14:30 PM
Running now; I have 326,000 posts to convert (at 120K now), and I'll post the results.  Thanks!
Title: Re: PHPBB2 - problem with MySQL
Post by: mycroft on October 20, 2006, 04:52:23 PM
Barfaroony at around 216000 while converting posts...

Converting...
Converting posts (this may take some time)... Unsuccessful!
This query:

    INSERT INTO `tbforum_prod`.smf_messages
    (ID_MSG, ID_TOPIC, posterTime, ID_MEMBER, posterEmail, subject, posterName, smileysEnabled, modifiedTime, posterIP, body, ID_BOARD, modifiedName, icon)
    VALUES ('241748', '17974', '1125459032', '7066', '[email protected]', 'Odd, harmless thing about you?', 'Thomas Matta', '1', '0', '68.255.26.132', 'I use my cell phone alarm, too! And sometimes I pay $1.99 for a wake up call!
    <br />
    <br />I\'m out of control!', '6', '', 'xx'),

...many other values deleted...

Caused the error:

    Duplicate entry '241748' for key 1

Title: Re: PHPBB2 - problem with MySQL
Post by: mycroft on October 21, 2006, 08:39:12 AM
Oldiesmann:

I ran your updated version of the .SQL last night with the added DISTINCT in the topics conversion; same tune, basically (see below).  Suggestions?

---

Converting posts (this may take some time)... Unsuccessful!
This query:

    INSERT INTO `tbforum_prod`.smf_messages
    (ID_MSG, ID_TOPIC, posterTime, ID_MEMBER, posterEmail, subject, posterName, smileysEnabled, modifiedTime, posterIP, body, ID_BOARD, modifiedName, icon)
    VALUES ('17931', '1087', '1051876440', '3324', '', 'Trombone ensemble names', '', '0', '0', '151.203.195.149', '</font><blockquote><font size=\"1\" face=\"Verdana, Geneva, sans-serif\">quote:</font><hr /><font
... miles of SQL deleted...

Caused the error:

    Duplicate entry '17931' for key 1

Title: Re: PHPBB2 - problem with MySQL
Post by: mycroft on October 21, 2006, 08:48:58 AM
Bit more info:

The post in question in the error above, ID 17931, does NOT exist twice in the phpBB installation.

When looking at the data already moved across to the smf_messages table, ID_MSG 17931 already DOES exist in the table.

It would *seem* that for some reason the converter attempted to move this one message from phpBB --> SMF twice.  I've also noticed that in every single Duplicate Key error I've seen, the key that is duplicated is *always* the first one in the bulk insert statement, never one of the IDs in the middle or at the end. 

I'm wondering if that is indicative of the query accidentally "double grabbing" that one row in phpBB.phpbb_posts...
Title: Re: PHPBB2 - problem with MySQL
Post by: Oldiesmann on October 21, 2006, 12:49:18 PM
Let me look at this some more and see if I can figure out what's going on. The messages table is cleared before anything is inserted, so I'm not sure why it's doing that.
Title: Re: PHPBB2 - problem with MySQL
Post by: mycroft on October 21, 2006, 12:51:38 PM
Many thanks.  Please let me know if you need any more details from my end.  Understandably, I am at a loss.  I've look at the code myself, and can see no logical reason why this would only happen *sometimes*.

R
Title: Re: PHPBB2 - problem with MySQL
Post by: Oldiesmann on October 21, 2006, 01:09:01 PM
Can you send me a copy of the data from your phpbb_posts and phpbb_topics tables? I've looked at the code as well and can't figure it out.
Title: Re: PHPBB2 - problem with MySQL
Post by: mycroft on October 21, 2006, 01:33:47 PM
Working....it's going to be pretty large, as I have about 326,000 posts...
Title: Re: PHPBB2 - problem with MySQL
Post by: mycroft on October 21, 2006, 01:35:01 PM
Data as SQL statements, CSV, or XML?

And do you want the posts_text table as well?
Title: Re: PHPBB2 - problem with MySQL
Post by: mycroft on October 21, 2006, 01:48:54 PM
In the interest of time, I've dumped the CSV files out and zipped them.  Location in a PM.
Title: Re: PHPBB2 - problem with MySQL
Post by: Oldiesmann on October 21, 2006, 02:18:22 PM
Could you re-send the PM? I must have accidentally deleted it when I was clearing out my inbox earlier.
Title: Re: PHPBB2 - problem with MySQL
Post by: mycroft on October 21, 2006, 02:34:17 PM
In yer box.
Title: Re: PHPBB2 - problem with MySQL
Post by: Oldiesmann on October 21, 2006, 03:53:48 PM
Got it this time. Thanks.
Title: Re: PHPBB2 - problem with MySQL
Post by: Oldiesmann on October 21, 2006, 04:04:17 PM
I'm not sure what's going on. I'd just suggest dropping the primary keys from the topics and posts tables (this will allow duplicate values in the ID column) and then adding them back when you're done:

ALTER TABLE smf_messages DROP PRIMARY KEY;
ALTER TABLE smf_topics DROP PRIMARY KEY;


Then when you're done:
ALTER TABLE smf_messages CHANGE ID_MSG ID_MSG int(10) unsigned not null auto_increment PRIMARY KEY;
ALTER TABLE smf_topics CHANGE ID_TOPIC ID_TOPIC mediumint(8) unsigned not null auto_increment PRIMARY KEY;
Title: Re: PHPBB2 - problem with MySQL
Post by: mycroft on October 21, 2006, 04:18:15 PM
*sigh*

I was afraid you were going to say that.  I've had an attempt like that running for about 2 hours now.
Title: Re: PHPBB2 - problem with MySQL
Post by: Oldiesmann on October 21, 2006, 04:22:50 PM
Wow. Didn't realize it would take that long to drop primary keys.
Title: Re: PHPBB2 - problem with MySQL
Post by: mycroft on October 21, 2006, 04:32:52 PM
Ack, I wasn't clear!  Dropped keys already, the re-execution convert.php has been running for about 2 hours.

(*cackle*, takin' two hours for an alter table command can only be accomplished with MSSQL.   :P)
Title: Re: PHPBB2 - problem with MySQL
Post by: Oldiesmann on October 21, 2006, 05:48:23 PM
Ok. Any progress yet?
Title: Re: PHPBB2 - problem with MySQL
Post by: mycroft on October 21, 2006, 05:50:33 PM
Up to 177,400 out of 341,000 posts, give or take a few.
Title: Re: PHPBB2 - problem with MySQL
Post by: Oldiesmann on October 21, 2006, 05:59:02 PM
Ok. That's good. Let me know how it goes :)
Title: Re: PHPBB2 - problem with MySQL
Post by: ComposerRyan on October 21, 2006, 06:16:24 PM
Hey everyone,

I'm trying to convert my phpBB 2.0.17 over to SMF.  I had to merge some phpbb forums before converting to SMF.

Now that I'm using the SMF converters (I've tried ALL of them) I am getting the same error over and over again:

Converting ranks... Successful.
Converting groups... Successful.
Converting smileys... Successful.
Converting members... Unsuccessful!
This query:
INSERT INTO `webquadc_mambocms`.wqsmf_members
(ID_MEMBER, memberName, realName, passwd, lastLogin, dateRegistered, location, posts, ID_GROUP, instantMessages, emailAddress, unreadMessages, MSN, AIM, ICQ, YIM, websiteTitle, websiteUrl, showOnline, timeOffset, hideEmail, avatar, signature, pm_email_notify, is_activated, lngfile, buddy_list, pm_ignore_list, messageLabels, personalText, timeFormat, usertitle, memberIP, secretQuestion, secretAnswer, validation_code, additionalGroups, smileySet, passwordSalt, memberIP2)
VALUES ('2', 'admin', 'admin', '553ae6421f6984a2216ff05060012e80', '1161460454', '1161453034', '', '2', '1', '0', '[email protected]', '0', '', '', '', '', '', '', '1', '0', '0', '', '', '1', '1', '', '', '', '', '', '', '', '', '', '', '', '', '', '', ''),
('4', 'KnightRobby', 'KnightRobby', '5eaa742981366419de211a0325b9170e', '1153680589', '1095526269', '', '153', '1', '2', '[email protected]', '41', '', '', '', '', '', '', '1', '0', '0', 'gallery/medalofhonor/35avatar.jpg', '', '0', '1', '', '', '', '', '', '', '', '', '', '', '', '', '', '', ''),
('5', 'SHAO KHAN 20', 'SHAO KHAN 20', '21bb5bb51758eab175d4d640334abba0', '1107556820', '1101761143', 'Dave\'s MK', '0', '', '6', '[email protected]', '0', '', '', '', '', '', '', '1', '0', '1', 'gallery/mortalkombat/18avatar.jpg', '', '1', '1', '', '', '', '', '', '', '', '', '', '', '', '', '', '', ''),
('6', 'Scorpion The Ninja', 'Scorpion The Ninja', 'ad9269b456a2aa8181665b3296b115d9', '1123034813', '1101762036', 'You Tell Me', '49', '683', '1', '[email protected]', '5', '', '', '', '', '', '', '1', '-5', '1', 'gallery/mortalkombat/50avatar.jpg', '', '1', '1', '', '', '', '', '', '', '', '', '', '', '', '', '', '', ''),
('7', 'ermac_1324', 'ermac_1324', '2c5d15d4c2edf4b630cc300ded7a2ff8', '1111179681', '1101762218', 'New Zealand', '0', '', '0', '[email protected]', '0', '[email protected]', '', '', '', '', '', '1', '0', '1', 'gallery/mortalkombat/31avatar.jpg', '', '1', '1', '', '', '', '', '', '', '', '', '', '', '', '', '', '', ''),
('8', 'kali', 'kali', '76be6d6dd0ac324ca57c73afc7dfe077', '1107006564', '1101763834', '', '0', '', '3', '[email protected]', '0', '', '', '', '', 'http://www.mkfanatic.net', 'http://www.mkfanatic.net', '1', '0', '1', '', '', '1', '1', '', '', '', '', '', '', '', '', '', '', '', '', '', '', ''),
('9', 'mileena', 'mileena', 'a29bac723ca2d59ed78a2d715e17e92f', '1113339860', '1101765308', '', '0', '', '3623', '[email protected]', '1', '', 'Mileena Kitana', '', '', '', '', '1', '0', '1', 'gallery/mortalkombat/20avatar.jpg', '', '1', '1', '', '', '', '', '', '', '', '', '', '', '', '', '', '', ''),
('10', 'Jackson Briggs', 'Jackson Briggs', '7e65a9b554bbc9817aa049ce38c84a72', '1114303684', '1101768471', 'Dallas, TX', '0', '', '63', '[email protected]', '7', '[email protected]', 'jacksonbriggs37', '', '[email protected]', 'http://jacksonbriggs.proboards28.com', 'http://jacksonbriggs.proboards28.com', '1', '-6', '1', '', '', '1', '1', '', '', '', '', '', '', '', '', '', '', '', '', '', '', ''),
('11', 'KKW2', 'KKW2', 'e0208ae0d9cf8113885b1a90d0233a17', '1104797075', '1101777674', '', '0', '', '3', '[email protected]', '0', '', '', '', '', 'http://www.throughkenshiseyes.cjb.net', 'http://www.throug


<--------deleted some stuff here ------------------>

yea Add me on MSN', '1', '1', '', '', '', '', '', '', '', '', '', '', '', '', '', '', ''),
('463', 'crapman', 'crapman', '79cfdd0e92b120faadd7eb253eb800d0', '1111239907', '1111235847', '', '0', '', '1', '[email protected]', '0', '', '', '', '', '', '', '1', '0', '0', '', '', '1', '1', '', '', '', '', '', '', '', '', '', '', '', '', '', '', ''),
('464', 'RedTyga', 'RedTyga', '87850caf3cc34ac152862d28e818d9c0', '1115163271', '1111242971', 'California', '0', '', '0', '[email protected]', '0', '', 'dezisabadmofo', '', '[email protected]', '', '', '1', '-8', '1', 'gallery/defjam/16defav.jpg', '', '1', '1', '', '', '', '', '', '', '', '', '', '', '', '', '', '', ''),
('465', 'vicho', 'vicho', 'ed4d28b87a726bf1502ae9a530f0bf60', '1111243319', '1111243294', '', '0', '', '0', '[email protected]', '0', '[email protected]', '', '', '', '', '', '1', '0', '1', '', '', '1', '1', '', '', '', '', '', '', '', '', '', '', '', '', '', '', ''),
('466', 'GamePlayer16', 'GamePlayer16', '20d31c21944df5a6534181f2ae262ab9', '0', '1111270373', '??', '0', '', '0', '[email protected]', '0', '??', '??', '', '??', '', '', '0', '0', '1', '', '??????????', '1', '0', '', '', '', '', '', '', '', '', '', '', '', '', '', '', ''),
('467', 'CHI@ANG', 'CHI@ANG', '8a5f1e2bd269a9254cc2bdd7023a7d5b', '1111596094', '1111272745', '', '0', '', '0', '[email protected]', '1', '', '', '', '', '', '', '1', '0', '1', '', '', '1', '1', '', '', '', '', '', '', '', '', '', '', '', '', '', '', ''),
('468', 'stylz', 'stylz', '955fb354f3074f3505620d725ca95acb', '1111877874', '1111274311', 'London, Ontario', '0', '', '0', '[email protected]', '0', '[email protected]', '', '', '', '', '', '1', '-5', '1', 'gallery/defjam/16defav.jpg', 'Bow down to the champ, chump.', '1', '1', '', '', '', '', '', '', '', '', '', '', '', '', '', '', ''),
('469', 'TaY That Compton Crip', 'TaY That Compton Crip', '25d55ad283aa400af464c76d713c07ad', '1111279727', '1111278393', 'Compton, California', '0', '', '0', '[email protected]', '0', '', '', '', '', 'http://www.streetgangs.com/compton/crips', 'http://www.streetgangs.com/compton/crips', '1', '0', '1', '', '', '1', '1', '', '', '', '', '', '', '', '', '', '', '', '', '', '', ''),
('470', 'ccandlejjack', 'ccandlejjack', '503e319a35297f9ee439654dc424468f', '1114631205', '1111280602', '', '0', '', '0', '[email protected]', '0', '', '', '', '', '', '', '1', '0', '0', 'gallery/defjam/49defav.jpg', '', '1', '1', '', '', '', '', '', '', '', '', '', '', '', '', '', '', ''),
('471', 'Ether', 'Ether', 'a4d2f0d23dcc84ce983ff9157f8b7f88', '1111289120', '1111288482', 'Dirty South', '0', '', '0', '[email protected]', '0', '', '', '', '', '', '', '1', '0', '1', '', '', '1', '1', '', '', '', '', '', '', '', '', '', '', '', '', '', '', ''),
('472', 'kindathirsty', 'kindathirsty', '42d6bc620071b80da379878bd861db96', '1111291616', '1111289050', '', '0', '', '0', '[email protected]', '0', '', 'kindathirsty', '', '', '', '', '1', '0', '1', '', '', '1', '1', '', '', '', '', '', '', '', '', '', '', '', '', '', '', ''),
('473', 'LOG@N', 'LOG@N', '9e86e748b6ac2ef1228c33fa71c6a8d5', '1111297492', '1111291594', '', '0', '', '0', '[email protected]', '0', '', '', '', '', '', '', '0', '3', '1', '', 'LOGAN SCOTT RODOCKER', '0', '1', '', '', '', '', '', '', '', '', '', '', '', '', '', '', ''),
('474', 'thehitman', 'thehitman', '068ee9e9d43c26a82718ef89edffa3c8', '1111300465', '1111300354', '', '0', '', '0', '[email protected]', '0', '', '', '', '', '', '', '1', '0', '1', '', '', '1', '1', '', '', '', '', '', '', '', '', '', '', '', '', '', '', ''),
('475', 'cpc', 'cpc', '66622909e22e869ab282cdccd59c7f3d', '1111317618', '1111317599', '', '0', '', '0', '[email protected]', '0', '', '', '', '', '', '', '1', '0', '1', '', '', '1', '1', '', '', '', '', '', '', '', '', '', '', '', '', '', '', ''),
('476', 'koeli_G', 'koeli_G', 'edba6f3230922f75eae09423ecaba49b', '1111318228', '1111318205', '', '0', '', '0', '[email protected]', '0', '', '', '', '', '', '', '0', '0', '0', '', '', '1', '1', '', '', '', '', '', '', '', '', '', '', '', '', '', '', ''),
('477', 'sculasmi', 'sculasmi', 'a147fafa752cff0035c62c1c7765548a', '1111323652', '1111323260', 'cacd', '0', '', '0', '[email protected]', '0', '[email protected]', 'rua+ders', '67457987297', '[email protected]', 'http://www.defjamfight4ny.com', 'http://www.defjamfight4ny.com', '1', '0', '1', '', 'Sculasmi', '1', '1', '', '', '', '', '', '', '', '', '', '', '', '', '', '', ''),
('478', 'BkBomber', 'BkBomber', '965dbaac085fc891bfbbd4f9d145bbc8', '1111324332', '1111323322', '', '0', '', '0', '[email protected]', '0', '', '', '', '', 'http://www.miseryartsink.com', 'http://www.miseryartsink.com', '1', '0', '1', '', '', '1', '1', '', '', '', '', '', '', '', '', '', '', '', '', '', '', ''),
('479', 'pelirrojo9', 'pelirrojo9', 'bd1941798f23a7c8cc03839aba79846b', '1111329714', '1111329697', '', '0', '', '0', '[email protected]', '0', '', '', '', '', '', '', '1', '0', '1', '', '', '1', '1', '', '', '', '', '', '', '', '', '', '', '', '', '', '', ''),
('480', 'Lil Mark The Compton Crip', 'Lil Mark The Compton Crip', '37430a92973d1adca9934f0a5ecc53d2', '1111339337', '1111338582', '', '0', '', '0', '[email protected]', '0', '', '', '', '', '', '', '1', '0', '0', '', '', '1', '1', '', '', '', '', '', '', '', '', '', '', '', '', '', '', ''),
('481', 'Dooper', 'Dooper', 'fdea1d0befd9055e97c25413cee7d83a', '1113159823', '1111343372', '', '0', '', '0', '[email protected]', '0', '', 'fusi0nbyt3', '', '', '', '', '1', '0', '1', '', '', '1', '1', '', '', '', '', '', '', '', '', '', '', '', '', '', '', ''),
('482', 'shad_2511', 'shad_2511', '16a43f607350d55f22b888004387b159', '1112371432', '1111349080', '', '0', '', '0', '[email protected]', '0', '', '', '', '', '', '', '1', '0', '1', '', '', '1', '1', '', '', '', '', '', '', '', '', '', '', '', '', '', '', ''),
('483', 'Raekwon The Chef', 'Raekwon The Chef', '2105a4479a0000a1ba07012d7f02672b', '1111352205', '1111351054', '', '0', '', '0', '[email protected]', '0', '', '', '', '', '', '', '1', '0', '1', '', '', '1', '1', '', '', '', '', '', '', '', '', '', '', '', '', '', '', ''),
('484', 'SOLO', 'SOLO', 'c4fc616543430eb35f01f70ee1bc1628', '0', '1111357328', 'pecos,tx', '0', '', '0', '[email protected]', '0', '[email protected]', '', '79772', 'texas_hotboi23', '', '', '1', '1', '1', '', '', '1', '0', '', '', '', '', '', '', '', '', '', '', '', '', '', '', ''),
('485', 'LOCK', 'LOCK', 'c4fc616543430eb35f01f70ee1bc1628', '0', '1111358126', 'Odessa,Tx', '0', '', '0', '[email protected]', '0', 'blr2369@hotmail', '', '79772', 'texas_hotboi23', '', '', '1', '0', '1', '', '', '1', '0', '', '', '', '', '', '', '', '', '', '', '', '', '', '', ''),
('486', 'Doc', 'Doc', 'd056025fbea3c4700729c5b96b0ff97b', '0', '1111358559', 'Odessa,Tx', '0', '', '0', '[email protected]', '0', '[email protected]', '', '79772', 'texas_hotboi23', '', '', '1', '0', '1', '', '', '1', '0', '', '', '', '', '', '', '', '', '', '', '', '', '', '', ''),
('487', 'Trefizzle', 'Trefizzle', '04c3b57dc6aebc62a5e222c218a00f79', '1111370358', '1111370285', '', '0', '', '0', '[email protected]', '0', '', '', '', '', '', '', '1', '3', '1', '', '', '1', '1', '', '', '', '', '', '', '', '', '', '', '', '', '', '', ''),
('488', 'Tiltsis', 'Tiltsis', '21f1938bae2fda91f2cdca6060bdcfb1', '1113309752', '1111373716', 'Sydney - Australia', '0', '', '0', '[email protected]', '0', '', '', '', '', '', '', '1', '0', '1', '', '', '1', '1', '', '', '', '', '', '', '', '', '', '', '', '', '', '', ''),
('489', 'FlipHKD', 'FlipHKD', '8e2dcfd7e7e24b1ca76c1193f645902b', '1111375639', '1111375625', '', '0', '', '0', '[email protected]', '0', '', '', '', '', '', '', '1', '0', '1', '', '', '1', '1', '', '', '', '', '', '', '', '', '', '', '', '', '', '', ''),
('490', 'thegiver', 'thegiver', '28214f7adfc921bb4cb0d00efa882622', '1111376414', '1111375648', '', '0', '', '0', '[email protected]', '0', '', '', '', '', '', '', '1', '0', '1', '', '', '1', '1', '', '', '', '', '', '', '', '', '', '', '', '', '', '', ''),
('491', 'BATMAN', 'BATMAN', 'd099b25e9c797fc6ea02aa663632b98d', '1111377380', '1111376663', '', '0', '', '1', '[email protected]', '0', '', '', '', '', '', '', '1', '0', '1', '', '', '1', '1', '', '', '', '', '', '', '', '', '', '', '', '', '', '', ''),
('492', 'Gatman', 'Gatman', '6645af7ddb864a027899482f49ca1e74', '1111391506', '1111391224', '', '0', '', '0', '[email protected]', '0', '[email protected]', '', '', '', '', '', '0', '0', '0', '', 'DmanG', '1', '1', '', '', '', '', '', '', '', '', '', '', '', '', '', '', ''),
('493', 's-karl', 's-karl', '1ba059b636fb449476d5e5d74d9bdf9e', '1111485452', '1111398914', '', '0', '', '0', '[email protected]', '0', '', '', '', '', '', '', '0', '0', '0', '', '', '1', '1', '', '', '', '', '', '', '', '', '', '', '', '', '', '', ''),
('494', 'Lukey-b', 'Lukey-b', '02e2110ce4dad6bf98792a1bb06208ad', '1111403726', '1111403665', '', '0', '', '0', '[email protected]', '0', '', '', '', '', '', '', '1', '0', '1', '', '', '1', '1', '', '', '', '', '', '', '', '', '', '', '', '', '', '', ''),
('495', 'grifo78', 'grifo78', '6ab8c071842e7bc2fe980fb075c71383', '1111416056', '1111415962', '', '0', '', '1', '[email protected]', '0', '', '', '', '', '', '', '1', '0', '1', '', '', '1', '1', '', '', '', '', '', '', '', '', '', '', '', '', '', '', ''),
('496', 'g blingout', 'g blingout', 'b86a2d98fe0a24f53860179baf2cdb59', '1111508086', '1111426739', '', '0', '', '0', '[email protected]', '0', '', '', '', '', '', '', '1', '0', '1', '', '', '1', '1', '', '', '', '', '', '', '', '', '', '', '', '', '', '', ''),
('497', 'sandman6262001', 'sandman6262001', '0aa08b5c91758a166d13e7cd3f455951', '1111433031', '1111432953', 'houston, tx', '0', '', '0', '[email protected]', '0', '', '', '', '[email protected]', '', '', '1', '0', '1', '', '', '1', '1', '', '', '', '', '', '', '', '', '', '', '', '', '', '', ''),
('498', 'AndrossMentaki', 'AndrossMentaki', 'ae21370e3292d3adfe5fbdbe6c9d702d', '1111433394', '1111433319', 'florida', '0', '', '0', '[email protected]', '0', '', '', '', '', '', '', '1', '0', '0', '', '', '1', '1', '', '', '', '', '', '', '', '', '', '', '', '', '', '', ''),
('499', 'Sapokiller', 'Sapokiller', 'cd644e316cfb3268c442b72791c2749b', '1111448828', '1111448789', 'Venezuela', '0', '', '0', '[email protected]', '0', '[email protected]', '', '', '', 'http://calicoelectronioco.com', 'http://calicoelectronioco.com', '1', '1', '0', '', 'i m just looking for cute girls dude !!
<br /> im a real street figther and i got the scars to prove it', '1', '1', '', '', '', '', '', '', '', '', '', '', '', '', '', '', ''),
('500', 'CRG', 'CRG', '457b8e35ad9a1fa7939837bc71dda55b', '1111454126', '1111454108', '', '0', '', '0', '[email protected]', '0', '', '', '', '', '', '', '1', '0', '1', '', '', '1', '1', '', '', '', '', '', '', '', '', '', '', '', '', '', '', ''),
('501', 'reebokamaze', 'reebokamaze', '4346feb9ed5b01950e2b78bf196aa5c3', '1111458481', '1111458190', '', '0', '', '0', '[email protected]', '0', '', '', '', '', '', '', '0', '0', '1', '', '', '1', '1', '', '', '', '', '', '', '', '', '', '', '', '', '', '', ''),
('502', 'SnoopaLoop', 'Snoop'a'Loop', '13b5eb84acdcb1fbf868afe503584827', '1112408945', '1111461560', 'HR', '0', '', '2', '[email protected]', '0', '', 'VampiricCharm', '', '', '', '', '1', '0', '1', '', '', '1', '1', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '');
Caused the error:

Unknown column 'memberIP2' in 'field list'
Title: Re: PHPBB2 - problem with MySQL
Post by: Oldiesmann on October 21, 2006, 06:23:07 PM
Which version of SMF are you using?
Title: Re: PHPBB2 - problem with MySQL
Post by: ComposerRyan on October 21, 2006, 06:45:37 PM
I'm using 1.1RC2...do I need to upgrade to RC3?
Title: Re: PHPBB2 - problem with MySQL
Post by: Oldiesmann on October 21, 2006, 07:17:51 PM
Yes, you should upgrade to 1.1 RC3, then try the converter at http://www.simplemachines.org/community/index.php?topic=107868.msg761440#msg761440
Title: Re: PHPBB2 - problem with MySQL
Post by: mycroft on October 21, 2006, 09:45:10 PM
My conversion from phpBB-->SMF bombed out at 297,800, Oldiesmann.

I'm thinking that since this error is being caused to the conversion script(s) doing a "double grab" of a row to convert that ANY index using ID_MSG will cause this kind of error.  True or False?

Suggestions?

r


Error was thus:

Converting posts (this may take some time)... Unsuccessful!
This query:

    INSERT INTO `tbforum_prod`.smf_messages
    (ID_MSG, ID_TOPIC, posterTime, ID_MEMBER, posterEmail, subject, posterName, smileysEnabled, modifiedTime, posterIP, body, ID_BOARD, modifiedName, icon)
    VALUES ('353733', '25508', '1151234960', '5589', '[email protected]', 'Favorite big bands', 'mwhaa', '1', '0', '70.188.145.130', 'Check out as many of the LA Big Bands as you can. They\'re made up of mostly the same guys but each group has their own style.
... deleted stuff ...

Caused the error:

    Duplicate entry '25508-353733' for key 1

Title: Re: PHPBB2 - problem with MySQL
Post by: mycroft on October 21, 2006, 09:51:38 PM
Okay, have removed the UNIQUE from smf_messages index topic, ID_MEMBER, and ID_BOARD.  Re-running convert.php

*SIGH*

Title: Re: PHPBB2 - problem with MySQL
Post by: mycroft on October 22, 2006, 08:21:14 AM
Oldiesmann:

With all UNIQUE indexes redefined to be un-unique and the PRIMARY index dropped, the posts import works fine, until...(and remember, I'm using the version of convert.php that has the copy_dir() function in the .php as well as the .sql file...

Converting...
Converting personal messages (step 2)... Successful.
Converting topic notifications... Successful.
Converting board access... Successful.
Converting group access... Successful.
Converting moderators... Successful.
Converting avatar gallery images...
Fatal error: Cannot redeclare copy_dir() (previously declared in /home/virtual/site15/fst/var/www/html/convert.php:3) in /home/virtual/site15/fst/var/www/html/convert.php(677) : eval()'d code on line 1

I suppose I can just delete the function, reload the page, and keep going, but is there a way to make this process a bit more...elegant?   ;D
Title: Re: PHPBB2 - problem with MySQL
Post by: Oldiesmann on October 22, 2006, 08:32:51 PM
Didn't know there was a version with that function in two different files. Just delete the version in the .sql file and try again.
Title: Re: PHPBB2 - problem with MySQL
Post by: ComposerRyan on October 22, 2006, 08:45:10 PM
Quote from: Oldiesmann on October 21, 2006, 07:17:51 PM
Yes, you should upgrade to 1.1 RC3, then try the converter at http://www.simplemachines.org/community/index.php?topic=107868.msg761440#msg761440

Thank you Oldiesmann!  That did the trick..but now I'm having a problem where all the users are duplicate...can you please view my post here? (http://www.simplemachines.org/community/index.php?topic=122049.0)
Title: Re: PHPBB2 - problem with MySQL
Post by: Resourcez on October 23, 2006, 03:18:55 AM
Having recently been through many of the same frustrations in converting databases, may I make a couple of observations,
1. your existing database needs to be offline - either a duplicate db or have the site in maintenance mode.

2. if in a shared hosting environment, it helps to pick a quiet time.

3. coming from a register_globals OFF environment where we actually destroy any GET/POST/Cookie variables from the global scope ($_REQUEST), and the fact that the converter does seem to lose its way, perhaps it would be better to replace all instances of $_REQUEST['start'] and $_REQUEST[start] with $_GET in the convert and sql files, to ensure you get exactly what you are expecting :)

(the latter is especially relevant for IIS users)

Oh, and one other observation - why don't the downloadable converters get updated to remedy the myriad of fixed issues being endlessly propogated?
Title: Re: PHPBB2 - problem with MySQL
Post by: JayBachatero on October 23, 2006, 08:30:53 AM
They will be updated in the upcoming days.  They just need to be properly tested.
Title: Re: PHPBB2 - problem with MySQL
Post by: mycroft on October 24, 2006, 01:40:46 PM
FWIW, I *did* finally get my database posted over; however, it DID require a bit of finagling.  (Many thanks to the ever-patient Oldiesmann)

I do not vouch for the following steps, but they did work for me in moving from phpBB to SMF:

1.  Ensure that copy_dir() is in the SQL file and convert.php. (otherwise there is a step where the copy_dir function is not found)
2.  Remove ALL indexes from smf_messages that contain ID_MSG. 
3.  Run convert.  It'll bomb at some point because of *duplicate* copy_dir functions (6 of one, half dozen of the other)
4.  Comment the copy_dir() in the SQL file out.
5.  Reload the page that bombed.
5a. You MAY have to drop the primary index on smf_board_perms as well (PRIMARY key has ID_GROUP, ID_BOARD, and permission.)
6.  Recreate all indexes that were dropped or modified.
7.  Forewarned is forearmed:  ALL the board perms come across as local, and while the phpBB usergroups/moderator groups *are* transferred, they need monkeying with to make work in the SMF environment.

So, bottom line is that it DOES work, but requires a bit of elbow grease.  All things considered, I much prefer this method to losing over 6K users and half a million posts!



Title: Re: PHPBB2 - problem with MySQL
Post by: Oldiesmann on October 24, 2006, 03:49:20 PM
Glad you got it all worked out. I'm still not sure why you were running into the problems with duplicate posts, etc., but at least you got it working :)
Title: Re: PHPBB2 - problem with MySQL
Post by: nathan42100 on November 04, 2006, 06:09:44 PM
Sorry for bumping a semi-old topic but just to make sure, http://smf.person-lab.net/phpbb2_to_smf_2006_09_21.zip
The above link is the most recent and bug free version of the converter and fixes bugs such as the PM bug and the 1 letter sig chop off?
Title: Re: PHPBB2 - problem with MySQL
Post by: JayBachatero on November 05, 2006, 06:42:27 PM
http://www.simplemachines.org/community/index.php?topic=107868.msg761440#msg761440
Title: Re: PHPBB2 - problem with MySQL
Post by: supersuineg on December 06, 2006, 09:47:06 AM
Quote from: nathan42100 on November 04, 2006, 06:09:44 PM
Sorry for bumping a semi-old topic but just to make sure, http://smf.person-lab.net/phpbb2_to_smf_2006_09_21.zip
The above link is the most recent and bug free version of the converter and fixes bugs such as the PM bug and the 1 letter sig chop off?

tried it i get this Converting smileys...
Fatal error: Call to undefined function: copy_dir() in /mnt/w0713/d06/s47/b02406a6/www/forum/convert.php(653) : eval()'d code on line 13

with the one i got from here yesterday i get this
Duplicate entry '14617' for key 1
the numbers change with each try. i have tried to rerun the whole converter 5 times and clicked the "try again" butten loads of times.  its the post data that is having the problum.
i must have this new forum running by tomarrow 12-06-06
is there anyway to bypass this or skip this one enrty or over wright it or tell the convert to just move on to the next qurry. is there away to do this one by hand . can i just mod the scrip to focus on just the post data ( tho i think the prob will still pop up) however it has to happen i will do it.
Thanks for your time http://www.simplemachines.org/community/index.php?topic=131974.0
Title: Re: PHPBB2 - problem with MySQL
Post by: supersuineg on December 06, 2006, 11:49:35 AM
used the pach sql found on page 9 of this topic and now i get this (below) and not all the posts got moved as well as the forum won't let me login. Please i must have the smf forum up and running asap.

Notice: Undefined index: convert_script in /mnt/w0713/d06/s47/b02406a6/www/forum/convert.php on line 571

Warning: Invalid argument supplied for foreach() in /mnt/w0713/d06/s47/b02406a6/www/forum/convert.php on line 574

Notice: Undefined index: convert_script in /mnt/w0713/d06/s47/b02406a6/www/forum/convert.php on line 579
Successful.
Recalculating forum statistics...
Notice: Undefined variable: result in /mnt/w0713/d06/s47/b02406a6/www/forum/convert.php on line 1816

Notice: Undefined variable: result in /mnt/w0713/d06/s47/b02406a6/www/forum/convert.php on line 1817

Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /mnt/w0713/d06/s47/b02406a6/www/forum/convert.php on line 921

Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in /mnt/w0713/d06/s47/b02406a6/www/forum/convert.php on line 931

Notice: Undefined variable: result in /mnt/w0713/d06/s47/b02406a6/www/forum/convert.php on line 1816

Notice: Undefined variable: result in /mnt/w0713/d06/s47/b02406a6/www/forum/convert.php on line 1817

Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /mnt/w0713/d06/s47/b02406a6/www/forum/convert.php on line 939

Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in /mnt/w0713/d06/s47/b02406a6/www/forum/convert.php on line 949

Notice: Undefined variable: result in /mnt/w0713/d06/s47/b02406a6/www/forum/convert.php on line 1816

Notice: Undefined variable: result in /mnt/w0713/d06/s47/b02406a6/www/forum/convert.php on line 1817

Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /mnt/w0713/d06/s47/b02406a6/www/forum/convert.php on line 962

Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in /mnt/w0713/d06/s47/b02406a6/www/forum/convert.php on line 975

Notice: Undefined variable: result in /mnt/w0713/d06/s47/b02406a6/www/forum/convert.php on line 1816

Notice: Undefined variable: result in /mnt/w0713/d06/s47/b02406a6/www/forum/convert.php on line 1817

Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /mnt/w0713/d06/s47/b02406a6/www/forum/convert.php on line 1021

Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in /mnt/w0713/d06/s47/b02406a6/www/forum/convert.php on line 1023

Notice: Undefined variable: result in /mnt/w0713/d06/s47/b02406a6/www/forum/convert.php on line 1816

Notice: Undefined variable: result in /mnt/w0713/d06/s47/b02406a6/www/forum/convert.php on line 1817

Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /mnt/w0713/d06/s47/b02406a6/www/forum/convert.php on line 1029

Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in /mnt/w0713/d06/s47/b02406a6/www/forum/convert.php on line 1035

Notice: Undefined variable: result in /mnt/w0713/d06/s47/b02406a6/www/forum/convert.php on line 1816

Notice: Undefined variable: result in /mnt/w0713/d06/s47/b02406a6/www/forum/convert.php on line 1817

Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /mnt/w0713/d06/s47/b02406a6/www/forum/convert.php on line 1046

Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in /mnt/w0713/d06/s47/b02406a6/www/forum/convert.php on line 1047

Notice: Undefined variable: result in /mnt/w0713/d06/s47/b02406a6/www/forum/convert.php on line 1816

Notice: Undefined variable: result in /mnt/w0713/d06/s47/b02406a6/www/forum/convert.php on line 1817

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /mnt/w0713/d06/s47/b02406a6/www/forum/convert.php on line 1055

Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in /mnt/w0713/d06/s47/b02406a6/www/forum/convert.php on line 1057

Notice: Undefined variable: result in /mnt/w0713/d06/s47/b02406a6/www/forum/convert.php on line 1816

Notice: Undefined variable: result in /mnt/w0713/d06/s47/b02406a6/www/forum/convert.php on line 1817

Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /mnt/w0713/d06/s47/b02406a6/www/forum/convert.php on line 1063

Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in /mnt/w0713/d06/s47/b02406a6/www/forum/convert.php on line 1064

Notice: Undefined variable: result in /mnt/w0713/d06/s47/b02406a6/www/forum/convert.php on line 1816

Notice: Undefined variable: result in /mnt/w0713/d06/s47/b02406a6/www/forum/convert.php on line 1817

Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /mnt/w0713/d06/s47/b02406a6/www/forum/convert.php on line 1070

Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in /mnt/w0713/d06/s47/b02406a6/www/forum/convert.php on line 1071

Notice: Undefined variable: result in /mnt/w0713/d06/s47/b02406a6/www/forum/convert.php on line 1816

Notice: Undefined variable: result in /mnt/w0713/d06/s47/b02406a6/www/forum/convert.php on line 1817

Notice: Undefined variable: result in /mnt/w0713/d06/s47/b02406a6/www/forum/convert.php on line 1816

Notice: Undefined variable: result in /mnt/w0713/d06/s47/b02406a6/www/forum/convert.php on line 1817

Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /mnt/w0713/d06/s47/b02406a6/www/forum/convert.php on line 1095

Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in /mnt/w0713/d06/s47/b02406a6/www/forum/convert.php on line 1097

Notice: Undefined variable: result in /mnt/w0713/d06/s47/b02406a6/www/forum/convert.php on line 1816

Notice: Undefined variable: result in /mnt/w0713/d06/s47/b02406a6/www/forum/convert.php on line 1817

Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /mnt/w0713/d06/s47/b02406a6/www/forum/convert.php on line 1103

Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in /mnt/w0713/d06/s47/b02406a6/www/forum/convert.php on line 1115

Notice: Undefined variable: result in /mnt/w0713/d06/s47/b02406a6/www/forum/convert.php on line 1816

Notice: Undefined variable: result in /mnt/w0713/d06/s47/b02406a6/www/forum/convert.php on line 1817

Notice: Undefined variable: result in /mnt/w0713/d06/s47/b02406a6/www/forum/convert.php on line 1816

Notice: Undefined variable: result in /mnt/w0713/d06/s47/b02406a6/www/forum/convert.php on line 1817

Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /mnt/w0713/d06/s47/b02406a6/www/forum/convert.php on line 1140

Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in /mnt/w0713/d06/s47/b02406a6/www/forum/convert.php on line 1142

Notice: Undefined variable: result in /mnt/w0713/d06/s47/b02406a6/www/forum/convert.php on line 1816

Notice: Undefined variable: result in /mnt/w0713/d06/s47/b02406a6/www/forum/convert.php on line 1817

Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in /mnt/w0713/d06/s47/b02406a6/www/forum/convert.php on line 1178

Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in /mnt/w0713/d06/s47/b02406a6/www/forum/convert.php on line 1179

Notice: Undefined variable: result in /mnt/w0713/d06/s47/b02406a6/www/forum/convert.php on line 1816

Notice: Undefined variable: result in /mnt/w0713/d06/s47/b02406a6/www/forum/convert.php on line 1817

Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /mnt/w0713/d06/s47/b02406a6/www/forum/convert.php on line 1217

Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in /mnt/w0713/d06/s47/b02406a6/www/forum/convert.php on line 1222

Notice: Undefined variable: result in /mnt/w0713/d06/s47/b02406a6/www/forum/convert.php on line 1816

Notice: Undefined variable: result in /mnt/w0713/d06/s47/b02406a6/www/forum/convert.php on line 1817

Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /mnt/w0713/d06/s47/b02406a6/www/forum/convert.php on line 1283

Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in /mnt/w0713/d06/s47/b02406a6/www/forum/convert.php on line 1285

Notice: Undefined variable: result in /mnt/w0713/d06/s47/b02406a6/www/forum/convert.php on line 1816

Notice: Undefined variable: result in /mnt/w0713/d06/s47/b02406a6/www/forum/convert.php on line 1817

Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /mnt/w0713/d06/s47/b02406a6/www/forum/convert.php on line 1321

Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in /mnt/w0713/d06/s47/b02406a6/www/forum/convert.php on line 1340

Notice: Undefined variable: result in /mnt/w0713/d06/s47/b02406a6/www/forum/convert.php on line 1816

Notice: Undefined variable: result in /mnt/w0713/d06/s47/b02406a6/www/forum/convert.php on line 1817

Notice: Undefined variable: result in /mnt/w0713/d06/s47/b02406a6/www/forum/convert.php on line 1816

Notice: Undefined variable: result in /mnt/w0713/d06/s47/b02406a6/www/forum/convert.php on line 1817

Notice: Undefined variable: result in /mnt/w0713/d06/s47/b02406a6/www/forum/convert.php on line 1816

Notice: Undefined variable: result in /mnt/w0713/d06/s47/b02406a6/www/forum/convert.php on line 1817

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /mnt/w0713/d06/s47/b02406a6/www/forum/convert.php on line 1372
Successful.
Conversion Complete
Congratulations, the conversion has completed sucessfully. If you have or had any problems with this converter, or need help using SMF, please feel free to look to us for support.
Please check this box to delete the converter right now for security reasons. (doesn't work on all servers.)

Now that everything is converted over, your SMF installation should have all the posts, boards, and members from the
Notice: Undefined index: name in /mnt/w0713/d06/s47/b02406a6/www/forum/convert.php on line 1448
installation.

We hope you had a smooth transition!

Title: Re: PHPBB2 - problem with MySQL
Post by: jerm on December 23, 2006, 11:46:22 PM
Were you able to resolve this issue?
Title: Re: PHPBB2 - problem with MySQL
Post by: Benzin on December 27, 2006, 10:15:19 PM
Quote from: Oldiesmann on October 21, 2006, 04:04:17 PM
I'm not sure what's going on. I'd just suggest dropping the primary keys from the topics and posts tables (this will allow duplicate values in the ID column) and then adding them back when you're done:

ALTER TABLE smf_messages DROP PRIMARY KEY;
ALTER TABLE smf_topics DROP PRIMARY KEY;


Then when you're done:
ALTER TABLE smf_messages CHANGE ID_MSG ID_MSG int(10) unsigned not null auto_increment PRIMARY KEY;
ALTER TABLE smf_topics CHANGE ID_TOPIC ID_TOPIC mediumint(8) unsigned not null auto_increment PRIMARY KEY;


hmm  :'( i cant convert.. im stuck with this phpbb2 forum... dammit!!!
Title: Re: PHPBB2 - problem with MySQL
Post by: Benzin on December 27, 2006, 11:00:31 PM
Well ... FINALLY !  :D

I tried Tutsi´s tip

Quotehad the some problem, tried some fixes mentioned here on the forums but they all dont work. Until I found the workaround with the old converter, which worked for me.

1) Install 1.0.9
2) convert phpbb2 with old converter to smf 1.0.9
3) upgrade smf 1.0.9 to 1.1.1

So it seems the new converter still has issues the old one has no trouble at all with.

Anyway it worked so I am happy :-)

Good new year!

And.. IT WORKED! Thank you WERY much! and a Good new year!
Title: Re: PHPBB2 - problem with MySQL
Post by: prodigal on December 28, 2006, 08:27:25 AM
I had the same problem as Benzin and others , I fixed it by dropping smf_topics and recreating it with the following syntax


CREATE TABLE smf_topics(
ID_TOPIC mediumint( 8 ) unsigned NOT NULL AUTO_INCREMENT ,
isSticky tinyint( 4 ) NOT NULL default '0',
ID_BOARD smallint( 5 ) unsigned NOT NULL default '0',
ID_FIRST_MSG int( 10 ) unsigned NOT NULL default '0',
ID_LAST_MSG int( 10 ) unsigned NOT NULL default '0',
ID_MEMBER_STARTED mediumint( 8 ) unsigned NOT NULL default '0',
ID_MEMBER_UPDATED mediumint( 8 ) unsigned NOT NULL default '0',
ID_POLL mediumint( 8 ) unsigned NOT NULL default '0',
numReplies int( 10 ) unsigned NOT NULL default '0',
numViews int( 10 ) unsigned NOT NULL default '0',
locked tinyint( 4 ) NOT NULL default '0',
PRIMARY KEY ( ID_TOPIC )
);
Title: Re: PHPBB2 - problem with MySQL
Post by: Benzin on January 02, 2007, 12:26:58 AM
thank you prodigal ! that worked too :)
Title: Re: PHPBB2 - problem with MySQL
Post by: noaneo on January 03, 2007, 03:13:06 PM
Good evening,
I have a small problem with convert.php
I am SMF 1.0.7 et phpbb v2.0.22

Error message:
Quote
Which software are you using?
The converter did not find any conversion data files. Please check to see if the one you want is available for download at www.simplemachines.org. If it isn't, we may be able to write one for you - just ask us!
After you download it, simply upload it into the same folder as this convert.php file. If you're having any other problems with this converter, don't hesitate to look for help on our forum.

Try again

Warning: Unknown(): open(/mnt/133/sdb/9/c/noaneo/sessions/sess_034c162fa0a36f15042aa89f4fce91cf, O_RDWR) failed: No such file or directory (2) in Unknown on line 0

Warning: Unknown(): Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/mnt/133/sdb/9/c/noaneo/sessions) in Unknown on line 0

Why?

Thank you
Title: Re: PHPBB2 - problem with MySQL
Post by: prodigal on January 12, 2007, 10:30:38 PM
looks like you got either your path to phpbb or smf wrong
Title: Re: PHPBB2 - problem with MySQL
Post by: JayBachatero on January 12, 2007, 10:54:00 PM
No that means that the session.save_path is wrong or not writeable in php.ini.  What hosting company are you with?
Title: Re: PHPBB2 - problem with MySQL
Post by: SillyCone on January 22, 2007, 05:54:20 PM
Hello there,

I found some very interesting fixes in here, so I guess this would be a good place to propose mine...

I don't know about you, but I was very annoyed by the fact that the attachements were correctly copied over to SMF from phpBB2 attachment mod, but that the image didn't display in the posts... When I asked here in the community if it was possible, I was told : SMF Convert doesn't support thumbnails yet...

So I tried to hack the phpbb2_to_smf.sql to copy the attachment twice, resize the second copy, and insert it in the db with attachmentType set to 3... It worked, but nothing more was displayed. Damn, I hoped I didn't have anything to change elsewhere in the db, like the posts tables and so...
So I simply created a new post as a simple member, uploaded a picture, and it displayed as I wanted it to be. A quick look in the db showed that the only difference between my converted attachments and the native ones was... the width and the height columns in the smf_attachments table ! :)

So I changed the width and height of my attachments in the db, and voilà, everything was working perfectly !
I don't even need an actual thumbnail file nor a record in the attachments table, just setting the width and height of the pictures made my day.

I hope it's not breaking anything, not until now after a few tests, here is the code...

find this :

while ($row = mysql_fetch_assoc($result))
{
if (!file_exists($oldAttachmentDir . '/' . $row['encrypted']))
$row['encrypted'] = strtr($row['encrypted'], '& ', '__');

// Get the true filesize in case the old db lied!
$fileSize = filesize($oldAttachmentDir . '/' . $row['encrypted']);
if (!is_integer($fileSize))
continue;

// Frankly I don't care whether they want encrypted filenames - they're having it - too dangerous.
$newfilename = getAttachmentFilename($row['filename'], $ID_ATTACH);

if (strlen($newfilename) <= 255 && copy($oldAttachmentDir . '/' . $row['encrypted'], $attachmentUploadDir . '/' . $newfilename))
{
$attachments[] = "($ID_ATTACH, $fileSize, SUBSTRING('" . addslashes($row['filename']) . "', 1, 255), $row[ID_MSG], $row[downloads])";

$ID_ATTACH++;
}
}

if (!empty($attachments))
convert_query("
INSERT INTO {$to_prefix}attachments
(ID_ATTACH, size, filename, ID_MSG, downloads)
VALUES " . implode(', ', $attachments));


and replace with this :

while ($row = mysql_fetch_assoc($result))
{
if (!file_exists($oldAttachmentDir . '/' . $row['encrypted']))
$row['encrypted'] = strtr($row['encrypted'], '& ', '__');

// Get the true filesize in case the old db lied!
$fileSize = filesize($oldAttachmentDir . '/' . $row['encrypted']);
if (!is_integer($fileSize))
continue;

//SillyCone hack - 22/01/2007 - add the width and height of images, so they can be viewed in the post where attached !
//first get extension of file and test if it's a jpg, a gif or a png - add any other image type in here, sizeable by php
$attachextension = strtolower(substr($row['filename'],-4));
if (($attachextension != 'jpeg') && ($attachextension != '.jpg') && ($attachextension != '.gif') && ($attachextension != '.png')) {
$attachextension = '';
}

// Frankly I don't care whether they want encrypted filenames - they're having it - too dangerous.
$newfilename = getAttachmentFilename($row['filename'], $ID_ATTACH);

if (strlen($newfilename) <= 255 && copy($sourcefile, $attachmentUploadDir.'/'.$newfilename))
{
//SillyCone hack - 22/01/2007 - get size of the image to store in attachments table
$width = 0;
$height = 0;
if ($attachextension != '') {
$imagesizearray = getimagesize($oldAttachmentDir.'/'.$row['encrypted']);
if ($imagesizearray) {
$width = $imagesizearray[0];
$height = $imagesizearray[1];
}
}
//SillyCone hack - 22/01/2007 - added width and height to the VALUES string
$attachments[] = "($ID_ATTACH, $width, $height, $fileSize, SUBSTRING('".addslashes($row['filename'])."', 1, 255), $row[ID_MSG], $row[downloads])";
$ID_ATTACH++;
}
}

if (!empty($attachments))
//SillyCone hack - 22/01/2007 - added width and height to the query
convert_query("
INSERT INTO {$to_prefix}attachments
(ID_ATTACH, width, height, size, filename, ID_MSG, downloads)
VALUES " . implode(', ', $attachments));


Cheers,
SillyCone.
Title: Re: PHPBB2 - problem with MySQL
Post by: c64glen on January 30, 2007, 03:07:25 PM
I've used a combination of Oldiesmann and prodigal's fixes on this page to get the topics and messages across but now I get the Error Message;

..
Converting moderators... Successful.
Converting avatar gallery images...
Fatal error: Call to undefined function: copy_dir() in /usr/local/psa/home/vhosts/obscureinternet.com/httpdocs/forum3/convert.php(655) : eval()'d code on line 20
Title: Re: PHPBB2 - problem with MySQL
Post by: JayBachatero on January 30, 2007, 06:31:35 PM
Try using the converter in this topic: phpBB 2.0.19+ (http://www.simplemachines.org/community/index.php?topic=142124)
Title: Re: PHPBB2 - problem with MySQL
Post by: Wizza on April 21, 2007, 11:52:17 AM
Im stuck on converting posts like mrcroft was..

I would do what he did but I have no idea on how to do it. If someone could explain and help me get all my posts converted I would be greatly appreciative.
Title: Re: PHPBB2 - problem with MySQL
Post by: Mr. Bean on April 21, 2007, 11:57:28 AM
Did you try using the converter that JayBachatero linked to?
Title: Re: PHPBB2 - problem with MySQL
Post by: strangedesign on March 19, 2008, 09:16:58 PM
I'm getting the following error converting from phpbb to smf. Anyone have any ideas of what might be causing this?

Recalculating forum statistics... Unsuccessful!
This query:
ALTER TABLE `forum`.smf_smileys
ORDER BY LENGTH(code) DESC;
Caused the error:

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'LENGTH(code) DESC' at line 2


Thanks!!!
Title: Re: PHPBB2 - problem with MySQL
Post by: strangedesign on March 19, 2008, 09:53:17 PM
Sorry! I found this thread from a google search. I downloaded the latest convert.php and sql file from the threads below, and it worked like a champ.

convert.php
http://www.simplemachines.org/community/index.php?topic=140741.0

phpbb2_to_smf.sql
http://www.simplemachines.org/community/index.php?topic=142124.0