trying to convert from yabb2.1 , now can't log in as admin

Started by rkleemann, September 24, 2008, 12:23:03 PM

Previous topic - Next topic

rkleemann

Hi,

I downloaded the latest converter.php and proceeded to do the conversion.

I got a number of Undefined index errors and then tried running the conversion from command line, and I get CAN'T DROP PRIMARY error.

I tried doing the conversion via the browser again, and I get this:

Converting membergroups... Successful.
Converting members... Unsuccessful!
This query:

    ALTER TABLE `smf`.smf_members
    DROP PRIMARY KEY,
    CHANGE COLUMN ID_MEMBER ID_MEMBER mediumint(8) unsigned NOT NULL default 0;

Caused the error:

    Can't DROP 'PRIMARY'; check that column/key exists

And now if I try to login to SMF via the admin account that I created during installation, it says the username does not exist, and sure enough, the smf_members table is empty.

How do I get out of this mess...?  :D

SleePy

Jeremy D ~ Site Team / SMF Developer ~ GitHub Profile ~ Join us on IRC @ Libera.chat/#smf ~ Support the SMF Support team!


SleePy

Jeremy D ~ Site Team / SMF Developer ~ GitHub Profile ~ Join us on IRC @ Libera.chat/#smf ~ Support the SMF Support team!


rkleemann

Ok,

So looking at mysql I see all the data there. However, I can't login to the forum.

I tried my own login, as well as admin. In both cases, the first attempt got me this message:

Password security has recently been upgraded. Please enter your password again.

Then on second attempt it just comes back with the user has to be registered.

If I look in mysql I see my username in smf_members. But SMF won't let me log in.


rkleemann

Hi,

Any tips on how I can debug this login issue?

Thanks
Ricardo

SleePy

That is odd.

Are you using the login at the top?
Try the actual login page. The one at the top has a prehashing method that will fail sometimes when passwords needs to be upgraded.
Jeremy D ~ Site Team / SMF Developer ~ GitHub Profile ~ Join us on IRC @ Libera.chat/#smf ~ Support the SMF Support team!

rkleemann

Quote from: SleePy on September 25, 2008, 02:19:32 PM
That is odd.

Are you using the login at the top?
Try the actual login page. The one at the top has a prehashing method that will fail sometimes when passwords needs to be upgraded.

This is the actual login page. Just to double check I was using the correct info, I went to the old forum (YaBB 2.1), logged out and logged back in, no problems.

Then I tried SMF with the exact same login info, and I get the errors. The user I'm attempting to login is in the smf_members table.

What else do I need to look at? Can I get additional debug from SMF to see what the problem is?

SleePy

Hmmm.

Open /Sources/LogInOut.php

Find:
    if (isset($_REQUEST['hash_passwrd']) && strlen($_REQUEST['hash_passwrd']) == 40)

Replace with:
    if (false && isset($_REQUEST['hash_passwrd']) && strlen($_REQUEST['hash_passwrd']) == 40)

This will force this to always be false and it won't accept password prehashing.


Jeremy D ~ Site Team / SMF Developer ~ GitHub Profile ~ Join us on IRC @ Libera.chat/#smf ~ Support the SMF Support team!

rkleemann

Quote from: SleePy on September 25, 2008, 07:34:54 PM
Hmmm.

Open /Sources/LogInOut.php

Find:
    if (isset($_REQUEST['hash_passwrd']) && strlen($_REQUEST['hash_passwrd']) == 40)

Replace with:
    if (false && isset($_REQUEST['hash_passwrd']) && strlen($_REQUEST['hash_passwrd']) == 40)

This will force this to always be false and it won't accept password prehashing.

Thanks. I'm guessing the conversion didn't quite convert the passwords properly. With the above change, now when I attempt to login I just get a Password incorrect error.

After 3 tries it then sends me to a password reminder page.

SleePy

Yea it loos like it

Open the yabb converter.
Find:
                'passwd' => strlen($data['password']) == 22 ? bin2hex(base64_decode($data['password'])) : md5($data['password']),

Replace:
                'passwd' => strlen($data['password']) == 22 ? bin2hex(base64_decode($data['password'])) : $data['password'],
Jeremy D ~ Site Team / SMF Developer ~ GitHub Profile ~ Join us on IRC @ Libera.chat/#smf ~ Support the SMF Support team!

rkleemann

But do I have to re-run the conversion? I took many hours!

Is there a way to convert the members only?

SleePy

Well we should be able to alter it so we can just redo the members conversion.
The attached file only converts members.

Although you could just click the password reset button if you wish to do it that way.
Jeremy D ~ Site Team / SMF Developer ~ GitHub Profile ~ Join us on IRC @ Libera.chat/#smf ~ Support the SMF Support team!

rkleemann

Quote from: SleePy on September 26, 2008, 11:52:36 AM
Well we should be able to alter it so we can just redo the members conversion.
The attached file only converts members.

Although you could just click the password reset button if you wish to do it that way.

Thanks.

But this script is for 2.2 or 2.1? I'm converting from 2.1 yet the script name says yabb22


SleePy

Jeremy D ~ Site Team / SMF Developer ~ GitHub Profile ~ Join us on IRC @ Libera.chat/#smf ~ Support the SMF Support team!

rkleemann

Hi,

Thanks for the script.

So something very weird is happening now. First I ran the script and got the errors below. I had not selected to remove members because I was afraid of losing all the posts as well. Even though there were errors I attempted to login, and still was not able to.

So then I manually deleted all the members from smf_members and tried to re-run the script. But now, when I access the yabb21-members_to_smf.php, the browser just hangs, doesn't show anything. I tried several times, opening a new browser window. Still just nothing. Very strange.

Anyway the initial output I got from the first time:


Converting members...
Notice: Undefined offset: 0 in /shared/www/SMF/yabb21-members_to_smf.php on line 386

Warning: array_keys() [function.array-keys]: The first argument should be an array in /shared/www/SMF/yabb21-members_to_smf.php on line 386

Warning: implode() [function.implode]: Bad arguments. in /shared/www/SMF/yabb21-members_to_smf.php on line 386
Unsuccessful!
This query:

    INSERT INTO `smf`.smf_members
    ()
    VALUES ('VIRGILIO', '31b71c89e585f5f78c7eecbc250d460f', 'VIRGILIO', '[email protected]', '', '', '', '3022', '0', '', '', '', '', '1', 'Virgilio de Oliveira - Fortaleza/CE - 06/04/70', 'http://lh6.ggpht.com/virgilio37/SA-Q1dJJC6I/AAAAAAAAAEI/dgnHj9E_SKA/s144/DSC03981.JPG';, '0', 'Fortaleza/CE', '1970-04-06', '0', '1222202550', '0', '0', '0', '', '', '', '', '', '', '', '', '', '', '', '', '', '');

Caused the error:

    Column count doesn't match value count at row 1


rkleemann

Well I'm not having much luck...  :(

Aside from the weirdness in my last post, I did get the members to be supposedly converted.

I emptied smf_members, I was able to run the script, and now the table is fully populated with all members.

But a login attempt still fails, but this time it doesn't complain about incorrect password. It doesn't complain at all. It simply returns to the login page as if my account was not registered.

In YaBB2.1 I had a "ricardo" login, and this login also exists in the smf_members table. But again, logging in, just immediately brings me back to the login page, without any errors.

???

Thanks for your patience.

SleePy

Oh sorry, I have been doing this from school during college classes. Been trying to pay attention to the professor and do this :P

Looks like I forgot to make the previous change.
You could edit that file or download the attached.

Quote from: SleePy on September 25, 2008, 07:58:14 PM
Yea it loos like it

Open the yabb converter.
Find:
                'passwd' => strlen($data['password']) == 22 ? bin2hex(base64_decode($data['password'])) : md5($data['password']),

Replace:
                'passwd' => strlen($data['password']) == 22 ? bin2hex(base64_decode($data['password'])) : $data['password'],
Jeremy D ~ Site Team / SMF Developer ~ GitHub Profile ~ Join us on IRC @ Libera.chat/#smf ~ Support the SMF Support team!

rkleemann

wow, you should get back to your class...  ;)

anyway, I emptied the members table again, ran the conversion, yet still won't log me in...

Doesn't complain about incorrect password or anything. I would have expected if the problem was the bad conversion of the password, then the login page would say incorrect password or something like that.

Advertisement: