Advertisement:

Author Topic: phpbb3.2 to SMF 2.0.15  (Read 21948 times)

Offline numand

  • Newbie
  • *
  • Posts: 7
phpbb3.2 to SMF 2.0.15
« on: April 01, 2018, 12:19:50 PM »
Hi,

I am trying to convert a phpbb3.2 forum to a SMF 1.0.15 forum. When I run the convert script[1], it prints this error:

Code: [Select]
/usr/bin/php7.0 -f convert.php -- --path_to=/var/www/smf --path_from=/var/www/phpbb --db_pass=nnn --convert_script=phpbb3_to_smf.sql

Starting Conversion

 * Converting ranks...
PHP Notice:  Undefined property: mysqli_result::$EOF in /var/www/smf/convert.php on line 2721
PHP Notice:  Undefined property: mysqli_result::$Fields in /var/www/smf/convert.php on line 2725
PHP Notice:  Trying to get property of non-object in /var/www/smf/convert.php on line 2726
PHP Fatal error:  Uncaught Error: Call to undefined method mysqli_result::MoveNext() in /var/www/smf/convert.php:2731
Stack trace:
#0 /var/www/smf/convert.php(1251): convert_fetch_assoc(Object(mysqli_result))
#1 /var/www/smf/convert.php(3038): doStep1()
#2 /var/www/smf/convert.php(31): cmdStep0()
#3 {main}
  thrown in /var/www/smf/convert.php on line 2731

Mentioned error lien (2721, 2725 and 2726) are in this function:
Code: [Select]
function convert_fetch_assoc($result)
{
global $smcFunc;

// Okay, the hardest is ADO (Windows only, by the way.)
if (!is_resource($result) && is_object($result))
{
if ($result->EOF) //-------> 2721
return false;

$row = array();
$fields = $result->Fields; //----------> 2725
for ($i = 0, $n = $fields->Count; $i < $n; $i++) //---------> 2726
{
$field = $fields[$i];
$row[$field->Name] = $field->Value;
}
$result->MoveNext(); //-------------> 2731

return $row;
}

$type = get_resource_type($result);
if ($type == 'odbc result')
return odbc_fetch_array($result);
else
return $smcFunc['db_fetch_assoc']($result);
}

But
Code: [Select]
$result->MoveNext(); statement is not only in this function but in lots of functions.

Could you help me to solve this problem?

SMF Version: 2.0.15
phpbb Version: 3.2
PHP Version:
Code: [Select]
php --version
PHP 7.0.28-0ubuntu0.16.04.1 (cli) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies
    with Zend OPcache v7.0.28-0ubuntu0.16.04.1, Copyright (c) 1999-2017, by Zend Technologies

MariaDB Version:
Code: [Select]
mysql --version
mysql  Ver 14.14 Distrib 5.7.21, for Linux (x86_64) using  EditLine wrapper

Operation System: Ubuntu 16.04.4

Offline digger

  • Sr. Member
  • ****
  • Posts: 787
  • Gender: Male
    • realdigger on GitHub
    • SMF Russian Community
Re: phpbb3.2 to SMF 2.0.15
« Reply #1 on: April 01, 2018, 12:39:58 PM »
Try to conver to SMF 1.0.13.

Offline numand

  • Newbie
  • *
  • Posts: 7
Re: phpbb3.2 to SMF 2.0.15
« Reply #2 on: April 01, 2018, 12:52:12 PM »
@digger,

Are you suggesting that first install SMF 1.0.13 and then run convert script?

Offline digger

  • Sr. Member
  • ****
  • Posts: 787
  • Gender: Male
    • realdigger on GitHub
    • SMF Russian Community
Re: phpbb3.2 to SMF 2.0.15
« Reply #3 on: April 01, 2018, 12:53:22 PM »
@digger,

Are you suggesting that first install SMF 1.0.13 and then run convert script?
Yes

Offline Illori

  • Lead Support Specialist
  • SMF Legend
  • *
  • Posts: 52,934
Re: phpbb3.2 to SMF 2.0.15
« Reply #4 on: April 01, 2018, 02:06:40 PM »
SMF 1.0 or SMF 1.1.* does not support php 7.* you might not have a lot of luck getting it to work.

Offline digger

  • Sr. Member
  • ****
  • Posts: 787
  • Gender: Male
    • realdigger on GitHub
    • SMF Russian Community
Re: phpbb3.2 to SMF 2.0.15
« Reply #5 on: April 01, 2018, 02:08:36 PM »
@digger,

Are you suggesting that first install SMF 1.0.13 and then run convert script?
I mean 2.0.13. Sorry.

Offline numand

  • Newbie
  • *
  • Posts: 7
Re: phpbb3.2 to SMF 2.0.15
« Reply #6 on: April 06, 2018, 03:11:41 PM »
@digger,

Are you suggesting that first install SMF 1.0.13 and then run convert script?
I mean 2.0.13. Sorry.

Thank you for advise @digger but I got the same error. This is from SMF 2.0.13:
Code: [Select]
/usr/bin/php7.0 -f convert.php -- --path_to=/var/www/smf --path_from=/var/www/phpbb --db_pass=nnn --convert_script=phpbb3_to_smf.sql

Starting Conversion

 * Converting ranks...
PHP Notice:  Undefined property: mysqli_result::$EOF in /var/www/smf/convert.php on line 2721
PHP Notice:  Undefined property: mysqli_result::$Fields in /var/www/smf/convert.php on line 2725
PHP Notice:  Trying to get property of non-object in /var/www/smf/convert.php on line 2726
PHP Fatal error:  Uncaught Error: Call to undefined method mysqli_result::MoveNext() in /var/www/smf/convert.php:2731
Stack trace:
#0 /var/www/smf/convert.php(1251): convert_fetch_assoc(Object(mysqli_result))
#1 /var/www/smf/convert.php(3038): doStep1()
#2 /var/www/smf/convert.php(31): cmdStep0()
#3 {main}
  thrown in /var/www/smf/convert.php on line 2731
[code]

Offline digger

  • Sr. Member
  • ****
  • Posts: 787
  • Gender: Male
    • realdigger on GitHub
    • SMF Russian Community
Re: phpbb3.2 to SMF 2.0.15
« Reply #7 on: April 06, 2018, 03:16:08 PM »
Did you try to downgrade php version?
Some time ago I converted old phpBB forum and encountered the same error, but successfully converted to SMF 2.0.13 with php 5.4 finally.

Offline numand

  • Newbie
  • *
  • Posts: 7
Re: phpbb3.2 to SMF 2.0.15
« Reply #8 on: April 06, 2018, 03:40:57 PM »
@digger,

No, I did not try to downgrade PHP version to 5.4. According to this[1] answer, the minimum version of PHP that can be installed is 5.6. I will try this in my local computer in order to not to mess server.

[1] hxxp:askubuntu.com/questions/109404/how-do-i-install-different-upgrade-or-downgrade-php-version-in-still-supported [nonactive]

Offline digger

  • Sr. Member
  • ****
  • Posts: 787
  • Gender: Male
    • realdigger on GitHub
    • SMF Russian Community
Re: phpbb3.2 to SMF 2.0.15
« Reply #9 on: April 06, 2018, 03:58:03 PM »
@digger,

No, I did not try to downgrade PHP version to 5.4. According to this[1] answer, the minimum version of PHP that can be installed is 5.6. I will try this in my local computer in order to not to mess server.

[1] https://askubuntu.com/questions/109404/how-do-i-install-different-upgrade-or-downgrade-php-version-in-still-supported
You can try with php 5.6. I think this converter needs php version with old mysql extension support and smf version without php 7.0 support.

Offline numand

  • Newbie
  • *
  • Posts: 7
Re: phpbb3.2 to SMF 2.0.15
« Reply #10 on: April 07, 2018, 09:30:46 AM »
@digger,

As you said, PHP 5.6 with old MySQL/MariaDB extension partially works. Even so the converter did not do its job completely.

This is what I did so far:
1. Comment out functions that contains SQL_MAX_JOIN_SIZE in convert.php
Code: [Select]
diff -u original_convert.php changed_convert.php
  // Attempt to allow big selects, only for mysql so far though.
- if ($smcFunc['db_title'] == 'MySQL')
- {
- $results = $smcFunc['db_query']('', "SELECT @@SQL_BIG_SELECTS, @@SQL_MAX_JOIN_SIZE", 'security_override');
- list($big_selects, $sql_max_join) = $smcFunc['db_fetch_row']($results);
+ //if ($smcFunc['db_title'] == 'MySQL')
+ //{
+ // $results = $smcFunc['db_query']('', "SELECT @@SQL_BIG_SELECTS, @@SQL_MAX_JOIN_SIZE", 'security_override');
+ // list($big_selects, $sql_max_join) = $smcFunc['db_fetch_row']($results);
 
  // Only waste a query if its worth it.
- if (empty($big_selects) || ($big_selects != 1 && $big_selects != '1'))
- $smcFunc['db_query']('', "SET @@SQL_BIG_SELECTS = 1", 'security_override');
+ // if (empty($big_selects) || ($big_selects != 1 && $big_selects != '1'))
+ // $smcFunc['db_query']('', "SET @@SQL_BIG_SELECTS = 1", 'security_override');
 
  // Lets set MAX_JOIN_SIZE to something we should
- if (empty($sql_max_join) || ($sql_max_join == '18446744073709551615' && $sql_max_join == '18446744073709551615'))
- $smcFunc['db_query']('', "SET @@SQL_MAX_JOIN_SIZE = 18446744073709551615", 'security_override');
- }
+ // if (empty($sql_max_join) || ($sql_max_join == '18446744073709551615' && $sql_max_join == '18446744073709551615'))
+ // $smcFunc['db_query']('', "SET @@SQL_MAX_JOIN_SIZE = 18446744073709551615", 'security_override');
+ //}
 
  // Attempt to allow big selects, only for mysql so far though.
- if ($smcFunc['db_title'] == 'MySQL' && (trim($db_errno) == 1104 || strpos($db_error, 'use SET SQL_BIG_SELECTS=1') !== false))
- {
- $results = $smcFunc['db_query']('', "SELECT @@SQL_BIG_SELECTS, @SQL_MAX_JOIN_SIZE", 'security_override');
- list($big_selects, $sql_max_join) = $smcFunc['db_fetch_row']($results);
+ //if ($smcFunc['db_title'] == 'MySQL' && (trim($db_errno) == 1104 || strpos($db_error, 'use SET SQL_BIG_SELECTS=1') !== false))
+ //{
+ // $results = $smcFunc['db_query']('', "SELECT @@SQL_BIG_SELECTS, @SQL_MAX_JOIN_SIZE", 'security_override');
+ // list($big_selects, $sql_max_join) = $smcFunc['db_fetch_row']($results);
 
  // Only waste a query if its worth it.
- if (empty($big_selects) || ($big_selects != 1 && $big_selects != '1'))
- $smcFunc['db_query']('', "SET @@SQL_BIG_SELECTS = 1", 'security_override');
+ // if (empty($big_selects) || ($big_selects != 1 && $big_selects != '1'))
+ // $smcFunc['db_query']('', "SET @@SQL_BIG_SELECTS = 1", 'security_override');
 
  // Lets set MAX_JOIN_SIZE to something we should
- if (empty($sql_max_join) || ($sql_max_join == '18446744073709551615' && sql_max_join == '18446744073709551615'))
- $smcFunc['db_query']('', "SET @@SQL_MAX_JOIN_SIZE = 18446744073709551615", 'security_override');
+ // if (empty($sql_max_join) || ($sql_max_join == '18446744073709551615' && sql_max_join == '18446744073709551615'))
+ // $smcFunc['db_query']('', "SET @@SQL_MAX_JOIN_SIZE = 18446744073709551615", 'security_override');
 
  // Try again.
- $result = $smcFunc['db_query']('', $string, 'security_override');
+ // $result = $smcFunc['db_query']('', $string, 'security_override');
 
- if ($result !== false)
- return $result;
- }
+ // if ($result !== false)
+ // return $result;
+ //}


2. Remove some parameters(?) form phpbb3_to_smf.sql file
Code: [Select]
diff -u original_phpbb3_to_smf.sql changed_phpbb3_to_smf.sql
- SUBSTRING(u.user_from, 1, 255) AS location,
+ '' AS location,
- 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 website_title,
- SUBSTRING(u.user_website, 1, 255) AS website_url,
+ '' AS msn,
+ '' AS aim,
+ '' AS icq,
+ '' AS yim,
+ '' AS website_title,
+ '' AS website_url,
- f.forum_id AS id_board, CASE WHEN f.parent_id = c.temp_id THEN 0 ELSE f.parent_id END AS id_parent, f.left_id AS board_order, f.forum_posts AS num_posts,
+ f.forum_id AS id_board, CASE WHEN f.parent_id = c.temp_id THEN 0 ELSE f.parent_id END AS id_parent, f.left_id AS board_order, '' AS num_posts,
- SUBSTRING(f.forum_desc, 1, 65534) AS description, f.forum_topics AS num_topics, f.forum_last_post_id AS id_last_msg
+ SUBSTRING(f.forum_desc, 1, 65534) AS description, '' AS num_topics, f.forum_last_post_id AS id_last_msg

u.user_{msnm, aim, icq, yim, website}, u.user_from is not important but f.forum_posts and f.forum_topics are important datas. These are errors I get if I do not change phpbb3_to_smf.sql file:
Code: [Select]
Unsuccessful! Database error message:
Unknown column 'u.user_from' in 'field list'

Unsuccessful! Database error message:
Unknown column 'u.user_msnm' in 'field list' # and friends

 * Converting boards...
Unsuccessful! Database error message:
Unknown column 'f.forum_posts' in 'field list

 * Converting boards...
Unsuccessful! Database error message:
Unknown column 'f.forum_topics' in 'field list'

And this is whre I am stuck:
Code: [Select]
Starting Conversion

 * Converting ranks...
 Successful.

 * Converting groups...
 Successful.

 * Converting members...
 Successful.

 * Converting additional member groups...
 Successful.

 * Preparing for categories conversion...
 Successful.

 * Converting categories...
 Successful.

 * Converting boards...
Wrong value type sent to the database. Integer expected. (num_posts)

Offline numand

  • Newbie
  • *
  • Posts: 7
Re: phpbb3.2 to SMF 2.0.15
« Reply #11 on: April 07, 2018, 09:41:11 AM »
OK, I changed phpbb3_to_smf.sql file according to this[1] post but instead of changing t.topic_replies to t.topic_posts, I changed to t.topic_posts_approved. And converting phpbb3 to SMF ended successfully!

Thank you for your guidance @digger!

[1] https://www.simplemachines.org/community/index.php?topic=557174.msg3948846#msg3948846

Offline vbgamer45

  • Customizer
  • SMF Super Hero
  • *
  • Posts: 23,600
    • smfhacks on Facebook
    • VBGAMER45 on GitHub
    • @createaforum on Twitter
    • SMF For Free
Re: phpbb3.2 to SMF 2.0.15
« Reply #12 on: April 07, 2018, 09:49:53 AM »
Can you post your final file here.
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

Offline numand

  • Newbie
  • *
  • Posts: 7
Re: phpbb3.2 to SMF 2.0.15
« Reply #13 on: April 07, 2018, 10:09:36 AM »
@vbgamer45,

I attached both convert.php and phpbb3_to_smf.sql files.
My working environment:
Code: [Select]
lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 16.04.4 LTS
Release: 16.04
Codename: xenial
Code: [Select]
php -v
PHP 5.6.35-1+ubuntu16.04.1+deb.sury.org+1 (cli)
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
    with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2016, by Zend Technologies
Code: [Select]
dpkg -l | grep php5.6
ii  libapache2-mod-php5.6                      5.6.35-1+ubuntu16.04.1+deb.sury.org+1                    amd64        server-side, HTML-embedded scripting language (Apache 2 module)
ii  php5.6                                     5.6.35-1+ubuntu16.04.1+deb.sury.org+1                    all          server-side, HTML-embedded scripting language (metapackage)
ii  php5.6-cli                                 5.6.35-1+ubuntu16.04.1+deb.sury.org+1                    amd64        command-line interpreter for the PHP scripting language
ii  php5.6-common                              5.6.35-1+ubuntu16.04.1+deb.sury.org+1                    amd64        documentation, examples and common module for PHP
ii  php5.6-fpm                                 5.6.35-1+ubuntu16.04.1+deb.sury.org+1                    amd64        server-side, HTML-embedded scripting language (FPM-CGI binary)
ii  php5.6-json                                5.6.35-1+ubuntu16.04.1+deb.sury.org+1                    amd64        JSON module for PHP
ii  php5.6-mysql                               5.6.35-1+ubuntu16.04.1+deb.sury.org+1                    amd64        MySQL module for PHP
ii  php5.6-opcache                             5.6.35-1+ubuntu16.04.1+deb.sury.org+1                    amd64        Zend OpCache module for PHP
ii  php5.6-readline                            5.6.35-1+ubuntu16.04.1+deb.sury.org+1                    amd64        readline module for PHP
Code: [Select]
mysql --version
mysql  Ver 15.1 Distrib 10.0.34-MariaDB, for debian-linux-gnu (x86_64) using readline 5.2
Code: [Select]
nginx -v
nginx version: nginx/1.10.3 (Ubuntu)
Code: [Select]
server {
listen 80;
listen [::]:80;

root /var/www/smf;

index index.php index.html index.htm;

server_name _;

location / {
try_files $uri $uri/ =404;
}

location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php5.6-fpm.sock;
}
}

Offline vbgamer45

  • Customizer
  • SMF Super Hero
  • *
  • Posts: 23,600
    • smfhacks on Facebook
    • VBGAMER45 on GitHub
    • @createaforum on Twitter
    • SMF For Free
Re: phpbb3.2 to SMF 2.0.15
« Reply #14 on: April 07, 2018, 09:41:36 PM »
thanks
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

Offline AOKP

  • Newbie
  • *
  • Posts: 1
Re: phpbb3.2 to SMF 2.0.15
« Reply #15 on: July 07, 2018, 06:51:07 PM »
For some reason I cannot get this running with PHP5.6.
Error is the same as in the first post.

Offline GigaWatt

  • The Smiley Guy
  • SMF Friend
  • SMF Hero
  • *
  • Posts: 2,346
  • Gender: Male
    • MechDR on GitHub
    • Macedonian electronics forum
Re: phpbb3.2 to SMF 2.0.15
« Reply #16 on: July 07, 2018, 06:59:46 PM »
Did you use the attached files from this post?
"This is really a generic concept about human thinking - when faced with large tasks we're naturally inclined to try to break them down into a bunch of smaller tasks that together make up the whole."

"A 500 error loosely translates to the webserver saying, "WTF?"..."

Offline CrimeS

  • Jr. Member
  • **
  • Posts: 220
  • Gender: Male
    • jellyio.com
Re: phpbb3.2 to SMF 2.0.15
« Reply #17 on: May 25, 2020, 04:28:51 PM »
Hello, while converting from phpBB3.2 -> SMF 2.0.19 I noticed that the topics have lots of html in their content:
Code: [Select]
<B><s>[b]</s><I><s>[i]</s><U><s>[u]</s>Biografia:<e>[/u]</e></U><e>[/i]</e></I><e>[/b]</e></B><br/>
Is this an artefact caused by conversion, or should I be able to get around this?

Offline vbgamer45

  • Customizer
  • SMF Super Hero
  • *
  • Posts: 23,600
    • smfhacks on Facebook
    • VBGAMER45 on GitHub
    • @createaforum on Twitter
    • SMF For Free
Re: phpbb3.2 to SMF 2.0.15
« Reply #18 on: May 25, 2020, 07:32:04 PM »
It's a known issue at this point. Still working on a fix.
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

Offline CrimeS

  • Jr. Member
  • **
  • Posts: 220
  • Gender: Male
    • jellyio.com
Re: phpbb3.2 to SMF 2.0.15
« Reply #19 on: May 26, 2020, 02:32:56 PM »
Thanks, I thought so!