Problem with phpbb upgrade

Started by simetra, October 11, 2005, 08:07:16 PM

Previous topic - Next topic

simetra

INSERT INTO `smf`.smf_messages
(ID_MSG, ID_TOPIC, posterTime, ID_MEMBER, posterEmail, subject, posterName, smileysEnabled, modifiedTime, posterIP, body, ID_BOARD)
VALUES ('104097', '11052', '1096996257', '449', etc.. (Dont want to post anyones private info)

Caused the error:

Duplicate entry '104097' for key 1


I cant find any duplicate files.

I can even delete the post then I get it again on a different id.

Kirby

Did you run the upgrade before and cancel it prematurely? Try installing a fresh copy of SMF (no need to reupload everything just install.php and the install-<x>.sql files) and running it again.

simetra

Yup, I've tried clean installations. Still get the same thing. I figure its prolly an issue with the php db, everything converts fine except for the posts.

Compuart

#3
Very odd. As far as I can see, there shouldn't be any duplicate message rows in the selection. Can you confirm, the phpBB tables posts, topics, posts_text, and users have post_id, topic_id, post_id, and user_id respectively as their primary key?

Also, can you try replacing (phpbb2_to_smf.sql):
---}
SELECT
p.post_id AS ID_MSG, p.topic_id AS ID_TOPIC, p.post_time AS posterTime,
p.poster_id AS ID_MEMBER, IFNULL(u.user_email, '') AS posterEmail,
IF(IFNULL(pt.post_subject, '') = '', t.topic_title, pt.post_subject) AS subject,
IF(IFNULL(p.post_username, '') = '', u.username, p.post_username) 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,
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 />'), '"', '"') AS body,
p.forum_id AS ID_BOARD
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;
---*


by
---}
SELECT
p.post_id AS ID_MSG, p.topic_id AS ID_TOPIC, p.post_time AS posterTime,
p.poster_id AS ID_MEMBER, IFNULL(u.user_email, '') AS posterEmail,
IF(IFNULL(pt.post_subject, '') = '', t.topic_title, pt.post_subject) AS subject,
IF(IFNULL(p.post_username, '') = '', u.username, p.post_username) 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,
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 />'), '"', '"') AS body,
p.forum_id AS ID_BOARD
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
AND p.post_id > 0;
---*
Hendrik Jan Visser
Former Lead Developer & Co-founder www.simplemachines.org
Personal Signature:
Realitynet.nl -> ExpeditieRobinson.net / PekingExpress.org / WieIsDeMol.Com

Advertisement: