Advertisement:

Author Topic: trying to convert from yabb2.1 , now can't log in as admin  (Read 68983 times)

Offline rkleemann

  • Jr. Member
  • **
  • Posts: 113
trying to convert from yabb2.1 , now can't log in as admin
« on: September 24, 2008, 12:23:03 PM »
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
« Last Edit: October 17, 2008, 05:53:08 PM by SleePy »

Offline SleePy

  • Site Team Lead
  • SMF Master
  • *
  • Posts: 30,341
  • Gender: Male
  • Thats his happy face.
    • jdarwood007 on GitHub
    • @jdarwood on Twitter
    • SleePy Code - My personal site
Re: trying to convert from yabb2, now can't log in as admin
« Reply #1 on: September 24, 2008, 02:21:56 PM »
What version of Yabb 2 are you using?
Jeremy D — Site Team / SMF Developer
Support the SMF Support team!
Profiles:
GitHub

Offline rkleemann

  • Jr. Member
  • **
  • Posts: 113
Re: trying to convert from yabb2, now can't log in as admin
« Reply #2 on: September 24, 2008, 02:33:56 PM »
YaBB 2.1

Offline SleePy

  • Site Team Lead
  • SMF Master
  • *
  • Posts: 30,341
  • Gender: Male
  • Thats his happy face.
    • jdarwood007 on GitHub
    • @jdarwood on Twitter
    • SleePy Code - My personal site
Re: trying to convert from yabb2, now can't log in as admin
« Reply #3 on: September 24, 2008, 03:24:09 PM »
Alright.

Try both of these new files
Jeremy D — Site Team / SMF Developer
Support the SMF Support team!
Profiles:
GitHub

Offline rkleemann

  • Jr. Member
  • **
  • Posts: 113
Re: trying to convert from yabb2, now can't log in as admin
« Reply #4 on: September 24, 2008, 09:37:24 PM »
Alright.

Try both of these new files

Thanks, that did the trick.  ;)

Offline rkleemann

  • Jr. Member
  • **
  • Posts: 113
Re: trying to convert from yabb2, now can't log in as admin
« Reply #5 on: September 24, 2008, 09:42:18 PM »
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.


Offline rkleemann

  • Jr. Member
  • **
  • Posts: 113
Re: trying to convert from yabb2, now can't log in as admin
« Reply #6 on: September 25, 2008, 10:32:57 AM »
Hi,

Any tips on how I can debug this login issue?

Thanks
Ricardo

Offline SleePy

  • Site Team Lead
  • SMF Master
  • *
  • Posts: 30,341
  • Gender: Male
  • Thats his happy face.
    • jdarwood007 on GitHub
    • @jdarwood on Twitter
    • SleePy Code - My personal site
Re: trying to convert from yabb2, now can't log in as admin
« Reply #7 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.
Jeremy D — Site Team / SMF Developer
Support the SMF Support team!
Profiles:
GitHub

Offline rkleemann

  • Jr. Member
  • **
  • Posts: 113
Re: trying to convert from yabb2, now can't log in as admin
« Reply #8 on: September 25, 2008, 03:38:50 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?

Offline SleePy

  • Site Team Lead
  • SMF Master
  • *
  • Posts: 30,341
  • Gender: Male
  • Thats his happy face.
    • jdarwood007 on GitHub
    • @jdarwood on Twitter
    • SleePy Code - My personal site
Re: trying to convert from yabb2, now can't log in as admin
« Reply #9 on: September 25, 2008, 07:34:54 PM »
Hmmm.

Open /Sources/LogInOut.php

Find:
Code: [Select]
    if (isset($_REQUEST['hash_passwrd']) && strlen($_REQUEST['hash_passwrd']) == 40)
Replace with:
Code: [Select]
    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
Support the SMF Support team!
Profiles:
GitHub

Offline rkleemann

  • Jr. Member
  • **
  • Posts: 113
Re: trying to convert from yabb2, now can't log in as admin
« Reply #10 on: September 25, 2008, 07:54:58 PM »
Hmmm.

Open /Sources/LogInOut.php

Find:
Code: [Select]
    if (isset($_REQUEST['hash_passwrd']) && strlen($_REQUEST['hash_passwrd']) == 40)
Replace with:
Code: [Select]
    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.

Offline SleePy

  • Site Team Lead
  • SMF Master
  • *
  • Posts: 30,341
  • Gender: Male
  • Thats his happy face.
    • jdarwood007 on GitHub
    • @jdarwood on Twitter
    • SleePy Code - My personal site
Re: trying to convert from yabb2, now can't log in as admin
« Reply #11 on: September 25, 2008, 07:58:14 PM »
Yea it loos like it

Open the yabb converter.
Find:
Code: [Select]
                'passwd' => strlen($data['password']) == 22 ? bin2hex(base64_decode($data['password'])) : md5($data['password']),
Replace:
Code: [Select]
                'passwd' => strlen($data['password']) == 22 ? bin2hex(base64_decode($data['password'])) : $data['password'],
Jeremy D — Site Team / SMF Developer
Support the SMF Support team!
Profiles:
GitHub

Offline rkleemann

  • Jr. Member
  • **
  • Posts: 113
Re: trying to convert from yabb2, now can't log in as admin
« Reply #12 on: September 25, 2008, 08:05:50 PM »
But do I have to re-run the conversion? I took many hours!

Is there a way to convert the members only?

Offline SleePy

  • Site Team Lead
  • SMF Master
  • *
  • Posts: 30,341
  • Gender: Male
  • Thats his happy face.
    • jdarwood007 on GitHub
    • @jdarwood on Twitter
    • SleePy Code - My personal site
Re: trying to convert from yabb2, now can't log in as admin
« Reply #13 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.
Jeremy D — Site Team / SMF Developer
Support the SMF Support team!
Profiles:
GitHub

Offline rkleemann

  • Jr. Member
  • **
  • Posts: 113
Re: trying to convert from yabb2, now can't log in as admin
« Reply #14 on: September 26, 2008, 12:28:42 PM »
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


Offline SleePy

  • Site Team Lead
  • SMF Master
  • *
  • Posts: 30,341
  • Gender: Male
  • Thats his happy face.
    • jdarwood007 on GitHub
    • @jdarwood on Twitter
    • SleePy Code - My personal site
Re: trying to convert from yabb2, now can't log in as admin
« Reply #15 on: September 26, 2008, 02:01:29 PM »
My bad
Jeremy D — Site Team / SMF Developer
Support the SMF Support team!
Profiles:
GitHub

Offline rkleemann

  • Jr. Member
  • **
  • Posts: 113
Re: trying to convert from yabb2, now can't log in as admin
« Reply #16 on: September 26, 2008, 02:42:12 PM »
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', 'virgilio@tj.ce.gov.br', '', '', '', '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


Offline rkleemann

  • Jr. Member
  • **
  • Posts: 113
Re: trying to convert from yabb2, now can't log in as admin
« Reply #17 on: September 26, 2008, 03:02:50 PM »
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.

Offline SleePy

  • Site Team Lead
  • SMF Master
  • *
  • Posts: 30,341
  • Gender: Male
  • Thats his happy face.
    • jdarwood007 on GitHub
    • @jdarwood on Twitter
    • SleePy Code - My personal site
Re: trying to convert from yabb2, now can't log in as admin
« Reply #18 on: September 26, 2008, 03:28:54 PM »
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.

Yea it loos like it

Open the yabb converter.
Find:
Code: [Select]
                'passwd' => strlen($data['password']) == 22 ? bin2hex(base64_decode($data['password'])) : md5($data['password']),
Replace:
Code: [Select]
                'passwd' => strlen($data['password']) == 22 ? bin2hex(base64_decode($data['password'])) : $data['password'],
Jeremy D — Site Team / SMF Developer
Support the SMF Support team!
Profiles:
GitHub

Offline rkleemann

  • Jr. Member
  • **
  • Posts: 113
Re: trying to convert from yabb2, now can't log in as admin
« Reply #19 on: September 26, 2008, 03:42:59 PM »
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.