juju2143 / smf2-phpbb-convertor

SMF 2.x to phpBB 3.2 convertor
GNU General Public License v3.0
4 stars 4 forks source link

Several issues with this convertor #1

Open BlackTiger63 opened 6 years ago

BlackTiger63 commented 6 years ago

At first there is an issue converting quotes. The original convertor had this too. &" needs to be changed to " in convert_smf20.php which will fix this issue.

Conversion looks to work fine until the conversion of users and passwords and then everything goes wrong. I masked some fields like user and part of the password:

`Error while processing INSERT query.

In /home/customer/domains/mydomain.org/public_html/board/install/convert/convertor.php on line 778

SQL: INSERT IGNORE INTO phpbb_users (user_id, user_type, group_id, user_ip, user_regdate, username, username_clean, login_name, user_password, user_passchg, user_passwd_salt, user_posts, user_email, user_email_hash, user_birthday, user_lastvisit, user_lastmark, user_lang, user_timezone, user_dateformat, user_inactive_reason, user_inactive_time, user_sig, user_sig_bbcode_uid, user_sig_bbcode_bitfield, user_jabber, user_rank, user_permissions, user_avatar, user_avatar_type, user_avatar_width, user_avatar_height, user_new_privmsg, user_unread_privmsg, user_last_privmsg, user_notify, user_notify_pm, user_notify_type, user_allow_viewemail, user_actkey, user_newpasswd, user_style, user_options, user_pass_convert) VALUES (26, 0, 12, '94.227.149.152', '981595501', 'someuser', 'someuser', 'someuser', 'c38c20037bf6ebbff4a8xxxxxxxxxxxxxxxx', 1, 'EfOsX', '236', 'someuser@yahoo.com', '119363699718', '24- 8-1965', '1471564999', '981595501', 'en', '0', 'D M d, Y g:i a', 0, 0, '', '', 0, '', 0, '', '', 0, 0, 0, '0', '0', 0, 1, 1, 0, '0', '', '', '1', 230207, 1)

Array ( [message] => Unknown column 'user_pass_convert' in 'field list' [code] => 1054 ) `

After that a lot of errors ofcourse inserting the users profile fields, like this: `Error while processing INSERT query.

In /home/customer/domains/mydomain.org/public_html/board/install/convert/convertor.php on line 778

SQL: INSERT IGNORE INTO phpbb_profile_fields_data (user_id, pf_phpbb_interests, pf_phpbb_occupation, pf_phpbb_website, pf_phpbb_yim, pf_phpbb_aim, pf_phpbb_icq, pf_phpbb_location) VALUES (29888, '', '', '', '', '', '', '')

Array ( [message] => Unknown column 'pf_phpbb_yim' in 'field list' [code] => 1054 ) `

After the users conversion seems do to 1 thing fine just before you have to click the "Process final step" button and "Continue last statements" etc. all 9 steps seem to work fine. Also the rest until the end seems to work fine, but login is impossible due to the incorrect conversion. SQL ERROR [ mysqli ] Unknown column 'user_pass_convert' in 'field list' [1054]

The table phpbb_users only contain the bots, no users. Thousends of posts are missing and loads of posts are set to january 1st 1970.

juju2143 commented 6 years ago

This convertor should work on a clean, freshly installed phpBB 3.2.1, make sure you have that. Last time I checked, I was able to login and everything seemed to work fine, so I can't seem to reproduce your bug.

And yeah, there's some issues with the ", gotta check this out.

BlackTiger63 commented 6 years ago

When was the last time you checked? Because I wouldn't have put this here if I did not had used a freshly installed phpBB 3.2.1. Freshly installed by hand from official download, not from an installer like Softaculous or something. Only PhpBB 3.2.1. install, move install directory, install your extension, move install directory back and convert, no single change made. So there is a problem, unless you can point me out what I'm doing wrong? SMF=v2.0.14 php=v5.6.32 mysql=v5.5.58 Centos 6.9

The " might have to do with php versions, the change I mentioned worked on php 5.6 if changed like I said, the problem is gone. Checked with conversion to php 3.0.14 with the old script and to 3.2.1 with your script.

I still like to convert, so I can help you fix things as I can setup a fresh phpbb 3.2.1 as often as I want. If it does not take weeks, because with the old convertor I only loose 18 non important posts. ;)

juju2143 commented 6 years ago

I checked last month or so, when I last worked on it. I'm still in the process of converting my own forum, I should check this further soon. Help will definitely be welcome.

For info, I have SMF 2.0.14 (heavily modded), PHP 7.1.8, MariaDB 10.1.26, Debian 9.0, phpBB 3.2.1. Don't think anything changed since then.

BlackTiger63 commented 6 years ago

I als have some mods, but the old convertor has no issues, so it should not be any problem with postings. So I don't know why it put lots of postings to january 1st 1970 and lost a couple of thousend. The error notices start when the convertor starts converting the users and passwords. Maybe the loss of postings has something to do with that. Strange thing is on the old convertor, I get an error that postings have to less characters, which costs me those 18 posts. Probably postings which only had a smilie as answer, no problem there. On your convertor I don't get that error notice. Don't know why.

I tried 2 times and both times the same problem at the same moment (on user conversion) so I can reproduce it easily. Indeed odd that if you also have 2.0.14 you don't have that problem. But I don't have it with the old convertor.

As said, I will be glad to be of help to investigate and/or fix. Just tell me what you need.

Balls0fSteel commented 6 years ago

Same issue here with a few year old SMF engine as source. It's running the latest 2.0.15 SMF that is, but it's been installed way before. Anyhow, the converter comes up with the same errors. I also receive another error regarding pf_phpbb_yim.

You can still open the forum nevertheless, but logins will not work (you have to delete the install folder for this of course).

The different pf_phpbb_yim error I got:

Error while processing INSERT query.
In /var/www/asdasd/install/convert/convertor.php on line 832

SQL: INSERT IGNORE INTO pb_profile_fields_data (user_id, pf_phpbb_interests, pf_phpbb_occupation, pf_phpbb_website, pf_phpbb_yim, pf_phpbb_aim, pf_phpbb_icq, pf_phpbb_location) VALUES (000000, '', '', '', '', '', '', '')

Array ( [message] => Unknown column 'pf_phpbb_yim' in 'field list' [code] => 0000)

Same error as OP's during conversion:
Error while processing INSERT query.

In /var/www/asdasd/install/convert/convertor.php on line 832

SQL: INSERT IGNORE INTO pb_users (user_id, user_type, group_id, user_ip, user_regdate, username, username_clean, login_name, user_password, user_passchg, user_passwd_salt, user_posts, user_email, user_email_hash, user_birthday, user_lastvisit, user_lastmark, user_lang, user_timezone, user_dateformat, user_inactive_reason, user_inactive_time, user_sig, user_sig_bbcode_uid, user_sig_bbcode_bitfield, user_jabber, user_rank, user_permissions, user_avatar, user_avatar_type, user_avatar_width, user_avatar_height, user_new_privmsg, user_unread_privmsg, user_last_privmsg, user_notify, user_notify_pm, user_notify_type, user_allow_viewemail, user_actkey, user_newpasswd, user_style, user_options, user_pass_convert) VALUES (1231231, 1, 11, '123.123.123.132', '234234234324', 'Someone', 'user', 'User', 'abawerawerawer', 1, '52a8', '1', 'yahoo@nope', '2342342342', '', '234234', '123123123', 'en', '0', 'D M d, Y g:i a', 0, 0, '', '', 0, '', 0, '', '', 0, 0, 0, '0', '0', 0, 1, 1, 0, '0', '', '', '1', 343242342, 1)

Array ( [message] => Unknown column 'user_pass_convert' in 'field list' [code] => 0000 )  

^ I modified the details so it does not reflect the real user's data. But yeah, the salted PW is there, but the "user_pass_convert" field does not get created/does not exist IMO.

The message you get when you try to log in:

SQL ERROR [ mysqli ]

Unknown column 'user_pass_convert' in 'field list' [0000]

An SQL error occurred while fetching this page. Please contact the Board Administrator if this problem persists.

Debug info (if it helps):
SMF: 2.0.1 or something - upgraded with smaller and larger patches all along to 2.0.15
phpBB: Latest (3.2.1)
PHP: 7.1
OS: Ubuntu 17.10

But I think it's more, that our SQL basically lacks this "converted" and "pf_phpbb_yim". Or rather, it misses converted, and misses a field where that _yim thing would be. IMO. But it would be great what data the script wants, like I know I should have something there....

Balls0fSteel commented 6 years ago

Okay I found this:

https://www.phpbb.com/community/viewtopic.php?f=46&t=586069

https://github.com/phpbb/phpbb/pull/2955/files

So I think one should create the field? I will play around, but yeah, feels pretty risky. Kinda sad the devs cannot support conversion.

BlackTiger63 commented 6 years ago

I don't think so. The thread on phpbb.com you're referring to was for converstion to 3.0.x not to 3.2.x which this new script is for. The second is for a version 2.x of phpbb, even older.

There is an older script to convert to phpBB 3.0.14 and this works correctly, all users and passwords are converted. Only issues are quote issue mentioned above, easy to fix. And you'll loose empty posts or post where the reply only consist out of 1 smiley. After that it's possible to upgrade from 3.0.14 to 3.2.1 without issues.

However, it would be much nicer if this script would work and you can upgrade SMF 2.0.15 to phpBB 3.2.1 at once, without having to convert to the old version first. I doubt if adding a field from an old conversion will fix this. And indeed pity de devs won't (because they can) support conversion.

boka003 commented 5 years ago

Hello,

Did anyone find solution for this?

I have same error:

Error while processing INSERT query. In /home/incredi3/public_html/forums/install/convert/convertor.php on line 778

Array ( [message] => Unknown column 'user_pass_convert' in 'field list' [code] => 1054 )

packman2008 commented 4 years ago

I think the problem is that the user_pass_convert column is added to the phpbb_users table in the early stages of the conversion. The 'ALTER TABLE' SQL that creates the column includes "IF NOT EXISTS" which isn't supported in older versions of MySQL so the SQL fails and the column doesn't get created.

A quick fix is to edit the functions_smf20.php file and change the line that creates the column (in function smf_add_login_field) to...

    $create_convert_sql =  'ALTER TABLE ' . USERS_TABLE . ' ADD COLUMN user_pass_convert TINYINT(1) UNSIGNED COLLATE utf8_bin

If the colum already exists you'll get an error but it doesn't appear to display or stop the conversion. You were getting an error about the incorrect SQL command previously so you've replaced one error with another, but at least in the new case you're getting a correctly modified table.

I'm sure there's a neater way to achieve this, but I don't have time to investigate that at the moment.

packman2008 commented 4 years ago

Another fix - "pf_phpbb_yim" in convert_smf20.php should be "pf_phpbb_yahoo" to match the DB schema.

Sorry I'm not making these changes to the code...I'm not really proficient enough with Github yet to be sure I'd get it right!

Balls0fSteel commented 4 years ago

Well since then I successfully migrated a large SMF installation to phpBB without any hassle.

So luckily the conversion script still works fine...

kodiultimate commented 4 years ago

Well since then I successfully migrated a large SMF installation to phpBB without any hassle.

  • lowered php version with multiphp in cpanel
  • installed an old phpBB (whatever was said to be compatible with script)
  • installed the conversion script
  • followed the conversion instructions
  • it converted fine
  • updated phpbb per official instructions
  • everything is perfect
  • put back php to 7. something...

So luckily the conversion script still works fine...

Hi,

Would you be able to provide step by step guide please? I don't even know how to run it

sirlobo commented 3 years ago

Well since then I successfully migrated a large SMF installation to phpBB without any hassle.

  • lowered php version with multiphp in cpanel
  • installed an old phpBB (whatever was said to be compatible with script)
  • installed the conversion script
  • followed the conversion instructions
  • it converted fine
  • updated phpbb per official instructions
  • everything is perfect
  • put back php to 7. something...

So luckily the conversion script still works fine...

Hi,

Would you be able to provide step by step guide please? I don't even know how to run it

I too...