Advertisement
rekt_1

PHPBB 3.0.12 to SMF conversion FIX.

Dec 20th, 2014
209
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SQL 1.98 KB | None | 0 0
  1. #
  2. # PHPBB 3.0.12 TO SMF 2.0.x (Tested ON lastest 21/12/14 SMF 2.0.9)
  3. # Issue : WHEN converting the TABLES FROM PHPBB TO SMF, there's an issue with some NULL fields in the posts table.
  4. # Same happens with the private messages. This may be caused because an user's DATA may have been erased wrong.
  5. # While TABLES contain NULL parameters, the convertor won't be able to continue
  6. # HOW TO FIX
  7. # 1) Make a query and type this for the posts table :
  8.  
  9. SELECT
  10.        p.post_id AS id_msg, p.topic_id AS id_topic, p.forum_id AS id_board,
  11.        p.post_time AS poster_time, p.poster_id AS id_member, p.post_subject AS subject,
  12.        IFNULL(m.username, 'Guest') AS poster_name,
  13.        IFNULL(m.user_email, 'UNKNOWN') AS poster_email,
  14.        IFNULL(p.poster_ip, '0.0.0.0') AS poster_ip,
  15.        p.enable_smilies AS smileys_enabled, p.post_edit_time AS modified_time,
  16.        CASE p.post_edit_user WHEN 0 THEN 'Guest' ELSE m2.username END AS modified_name,
  17.        p.post_text AS body
  18. FROM phpbb_posts AS p
  19.        LEFT JOIN phpbb_users AS m ON (m.user_id = p.poster_id)
  20.        LEFT JOIN phpbb_users AS m2 ON (m2.user_id = p.post_edit_user)
  21. ORDER BY modified_name
  22.  
  23. # 2) Once the IDs are located, remove them manually through PHPMYADMIN.
  24.  
  25. # 3) Make another query, this time it will look for null fields in the private messages table.
  26.  
  27. 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
  28. FROM phpbb_privmsgs AS pm
  29. LEFT JOIN phpbb_users AS uf ON ( uf.user_id = pm.author_id )
  30. ORDER BY `from_name` ASC
  31. LIMIT 0 , 30
  32.  
  33. # 4) Once the IDs are located, remove them manually through PHPMYADMIN.
  34.  
  35. # 5) Re-execute the script and the proccess should fully work.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement