Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #
- # PHPBB 3.0.12 TO SMF 2.0.x (Tested ON lastest 21/12/14 SMF 2.0.9)
- # Issue : WHEN converting the TABLES FROM PHPBB TO SMF, there's an issue with some NULL fields in the posts table.
- # Same happens with the private messages. This may be caused because an user's DATA may have been erased wrong.
- # While TABLES contain NULL parameters, the convertor won't be able to continue
- # HOW TO FIX
- # 1) Make a query and type this for the posts table :
- SELECT
- p.post_id AS id_msg, p.topic_id AS id_topic, p.forum_id AS id_board,
- p.post_time AS poster_time, p.poster_id AS id_member, p.post_subject AS subject,
- IFNULL(m.username, 'Guest') AS poster_name,
- IFNULL(m.user_email, 'UNKNOWN') AS poster_email,
- IFNULL(p.poster_ip, '0.0.0.0') AS poster_ip,
- p.enable_smilies AS smileys_enabled, p.post_edit_time AS modified_time,
- CASE p.post_edit_user WHEN 0 THEN 'Guest' ELSE m2.username END AS modified_name,
- p.post_text AS body
- FROM phpbb_posts AS p
- LEFT JOIN phpbb_users AS m ON (m.user_id = p.poster_id)
- LEFT JOIN phpbb_users AS m2 ON (m2.user_id = p.post_edit_user)
- ORDER BY modified_name
- # 2) Once the IDs are located, remove them manually through PHPMYADMIN.
- # 3) Make another query, this time it will look for null fields in the private messages table.
- SELECT pm.msg_id AS id_pm, pm.author_id AS id_member_from, pm.message_time AS msgtime, SUBSTRING( uf.username, 1, 255 ) AS from_name, SUBSTRING( pm.message_subject, 1, 255 ) AS subject, SUBSTRING( REPLACE( IF( pm.bbcode_uid = '', pm.message_text, REPLACE( REPLACE( pm.message_text, CONCAT( ':1:', pm.bbcode_uid ) , '' ) , CONCAT( ':', pm.bbcode_uid ) , '' ) ) , '\n', '<br />' ) , 1, 65534 ) AS body
- FROM phpbb_privmsgs AS pm
- LEFT JOIN phpbb_users AS uf ON ( uf.user_id = pm.author_id )
- ORDER BY `from_name` ASC
- LIMIT 0 , 30
- # 4) Once the IDs are located, remove them manually through PHPMYADMIN.
- # 5) Re-execute the script and the proccess should fully work.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement