Simple Machines Community Forum

SMF Support => Converting to SMF => YaBB/YaBB SE => Topic started by: rkleemann on September 24, 2008, 12:23:03 PM

Title: trying to convert from yabb2.1 , now can't log in as admin
Post by: rkleemann 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
Title: Re: trying to convert from yabb2, now can't log in as admin
Post by: SleePy on September 24, 2008, 02:21:56 PM
What version of Yabb 2 are you using?
Title: Re: trying to convert from yabb2, now can't log in as admin
Post by: rkleemann on September 24, 2008, 02:33:56 PM
YaBB 2.1
Title: Re: trying to convert from yabb2, now can't log in as admin
Post by: SleePy on September 24, 2008, 03:24:09 PM
Alright.

Try both of these new files
Title: Re: trying to convert from yabb2, now can't log in as admin
Post by: rkleemann on September 24, 2008, 09:37:24 PM
Alright.

Try both of these new files

Thanks, that did the trick.  ;)
Title: Re: trying to convert from yabb2, now can't log in as admin
Post by: rkleemann 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.

Title: Re: trying to convert from yabb2, now can't log in as admin
Post by: rkleemann on September 25, 2008, 10:32:57 AM
Hi,

Any tips on how I can debug this login issue?

Thanks
Ricardo
Title: Re: trying to convert from yabb2, now can't log in as admin
Post by: 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.
Title: Re: trying to convert from yabb2, now can't log in as admin
Post by: rkleemann 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?
Title: Re: trying to convert from yabb2, now can't log in as admin
Post by: SleePy 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.


Title: Re: trying to convert from yabb2, now can't log in as admin
Post by: rkleemann 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.
Title: Re: trying to convert from yabb2, now can't log in as admin
Post by: SleePy 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'],
Title: Re: trying to convert from yabb2, now can't log in as admin
Post by: rkleemann 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?
Title: Re: trying to convert from yabb2, now can't log in as admin
Post by: 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.
Title: Re: trying to convert from yabb2, now can't log in as admin
Post by: rkleemann 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

Title: Re: trying to convert from yabb2, now can't log in as admin
Post by: SleePy on September 26, 2008, 02:01:29 PM
My bad
Title: Re: trying to convert from yabb2, now can't log in as admin
Post by: rkleemann 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

Title: Re: trying to convert from yabb2, now can't log in as admin
Post by: rkleemann 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.
Title: Re: trying to convert from yabb2, now can't log in as admin
Post by: SleePy 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'],
Title: Re: trying to convert from yabb2, now can't log in as admin
Post by: rkleemann 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.
Title: Re: trying to convert from yabb2, now can't log in as admin
Post by: SleePy on September 26, 2008, 03:51:26 PM
Well, we can try this.
Go edit your account in the database. Change the password field to just be a plain text password.
See if SMF can recognize this and log you in. I wonder if there may be a issue with your SMF install not wanting to let you login because it can't detect the password right.
Title: Re: trying to convert from yabb2, now can't log in as admin
Post by: rkleemann on September 26, 2008, 04:13:22 PM
Exact same problem with the cleartext pwd.

What's most strange to me is that it doesn't even output any error.

I think I'll try to add some debug to LogInOut.php and see what happens.
Title: Re: trying to convert from yabb2, now can't log in as admin
Post by: rkleemann on September 30, 2008, 03:58:18 PM
Any more clues on this?

I don't know why the login doesn't work, but I have 981 members and need to try to make this work...

Thanks
Ricardo
Title: Re: trying to convert from yabb2, now can't log in as admin
Post by: SleePy on October 02, 2008, 06:35:41 PM
Did you debug login like you said?

I had the same issue locally, but this was due to a weird install of php I had where the md5 function was causing issues.
After I commented out the md5 compatibility functions in LogInOut.php I was able to login.

We can try that here if you want?
Title: Re: trying to convert from yabb2, now can't log in as admin
Post by: rkleemann on October 03, 2008, 12:43:56 PM
Did you debug login like you said?

I had the same issue locally, but this was due to a weird install of php I had where the md5 function was causing issues.
After I commented out the md5 compatibility functions in LogInOut.php I was able to login.

We can try that here if you want?

Thanks SleePy. I haven't had a chance to try it out again. I do know that I re-converted the members with your script even after changing the md5, and that still didn't work... so I don't know what could be wrong.
Title: Re: trying to convert from yabb2, now can't log in as admin
Post by: SleePy on October 03, 2008, 02:26:18 PM
Try this LogInOut.php
I commented out almost all md5 functions.

If this doesn't work, we can add some debug code in the login file to see where things are going wrong.
Title: Re: trying to convert from yabb2, now can't log in as admin
Post by: rkleemann on October 04, 2008, 11:29:33 AM
Try this LogInOut.php
I commented out almost all md5 functions.

If this doesn't work, we can add some debug code in the login file to see where things are going wrong.

Hi SleePy,

Here's what I did. I emptied the smf_members table and re-ran the yabb21-members_to_smf.php script which you provided a few days ago.

One strange thing about that script is that it quickly converts the users (I can see in mysql), but it actually doesn't finish, it keeps on going (doing I don't know what), it doesn't output any status and I have to click the stop button on the browser.

Anyway, after inserting the users (smf_members now has correct 981 entries), I try login with the LogInOut.php you provided. Now what I get is Password Incorrect for any member I try.

The format of the password in the table is like "5280e84f8be43fcbc874a94aa5899d2a"
Title: Re: trying to convert from yabb2, now can't log in as admin
Post by: SleePy on October 05, 2008, 01:21:06 PM
Well that is a hashed password. Do they look like that befor they go to smf? Meaning are they hashed like that in the yabbs user files?
Title: Re: trying to convert from yabb2, now can't log in as admin
Post by: rkleemann on October 05, 2008, 04:01:55 PM
Well that is a hashed password. Do they look like that befor they go to smf? Meaning are they hashed like that in the yabbs user files?

Hi,

Ok, here's the pwd in the vars file of yabb2.1:
I2rslD5dyn7O29ye51i2CA

and in mysql for SMF:
236aec943e5dca7ecedbdc9ee758b608

So looks to me like the script is still hashing the original password
Title: Re: trying to convert from yabb2, now can't log in as admin
Post by: rkleemann on October 07, 2008, 10:53:37 AM
Well that is a hashed password. Do they look like that befor they go to smf? Meaning are they hashed like that in the yabbs user files?

Hi,

Ok, here's the pwd in the vars file of yabb2.1:
I2rslD5dyn7O29ye51i2CA

and in mysql for SMF:
236aec943e5dca7ecedbdc9ee758b608

So looks to me like the script is still hashing the original password

Any more clues on this?
Title: Re: trying to convert from yabb2, now can't log in as admin
Post by: SleePy on October 07, 2008, 12:26:54 PM
Try the one I posted in the above post. It shouldn't be converting the password at all.
Title: Re: trying to convert from yabb2, now can't log in as admin
Post by: rkleemann on October 07, 2008, 12:37:11 PM
Try the one I posted in the above post. It shouldn't be converting the password at all.

I'll give it a try... but that one doesn't only convert members, it's the whole conversion, right?
Title: Re: trying to convert from yabb2, now can't log in as admin
Post by: rkleemann on October 07, 2008, 11:41:45 PM
Ok,

I used the latest script you provided.

Now the passwords are no longer hashed, but I still get incorrect password. So I'm guessing SMF is not able to match yabb 2.1 passwords.

Also, I'm having another problem now... I changed the server's IP, and my original SMF install, as I was testing locally, actually configured an IP for the URL.

Now I can't seem to get SMF to properly use the new hostname. I changed the Settings.php with the new board_url. That didn't do it. So I searched around the database and see that the IP is still referenced in the smf_smileys table. But still that didn't fix everything.

The style sheet is still referencing the old url. Isn't there one single place where the url can be changed? I have to do this manually
Title: Re: trying to convert from yabb2, now can't log in as admin
Post by: ThorstenE on October 08, 2008, 01:49:44 AM
How do I move my SMF board to a different host?  (http://docs.simplemachines.org/index.php?topic=489) should help you .. you need the repair_settings.php and then fix all pathes for themes etc.
Title: Re: trying to convert from yabb2, now can't log in as admin
Post by: rkleemann on October 08, 2008, 10:35:57 PM
How do I move my SMF board to a different host?  (http://docs.simplemachines.org/index.php?topic=489) should help you .. you need the repair_settings.php and then fix all pathes for themes etc.

Great! thanks, the repair_settings.php worked great.

Now I just need to be able to login!  ;)

SleePy, like I said in the previous reply, now the password is no longer hashed, but SMF won't work with the original yabb21 password.  :(
Title: Re: trying to convert from yabb2, now can't log in as admin
Post by: SleePy on October 09, 2008, 11:43:14 AM
Alright,

I will need to look around I guess and figure out how the passwords are being handled then in Yabb now

Edit,
I assume you know what your login password is and the hashed version of it in Yabb?
I can run some tests here to see if I have figured out the password hashing method. I think they are using a md5 then a base64 encoding hash method. Kinda hard to tell because its perl, but I have seen enough of perl to pick up the basics and know the simple stuff it is doing.

Only way to tell would be for us to try to encode it that way.

These where files I was going to have you run. Just replace the password with your regular password and run it on a server. It should generate the hashed version.
Code: [Select]
<?php echo base64(md5("password")); ?>

Code: [Select]
<?php echo md5(base64("password")); ?>
Title: Re: trying to convert from yabb2, now can't log in as admin
Post by: rkleemann on October 09, 2008, 02:53:08 PM
Alright,

I will need to look around I guess and figure out how the passwords are being handled then in Yabb now

Edit,
I assume you know what your login password is and the hashed version of it in Yabb?
I can run some tests here to see if I have figured out the password hashing method. I think they are using a md5 then a base64 encoding hash method. Kinda hard to tell because its perl, but I have seen enough of perl to pick up the basics and know the simple stuff it is doing.

Only way to tell would be for us to try to encode it that way.

These where files I was going to have you run. Just replace the password with your regular password and run it on a server. It should generate the hashed version.
Code: [Select]
<?php echo base64(md5("password")); ?>

Code: [Select]
<?php echo md5(base64("password")); ?>

I'm confused... has this conversion ever worked before?

I'm looking at the YaBB2.1 code and they use md5_base64 from Digest::MD5.

I tried both lines of code you suggested and neither of those 2 produced something equivalent to my yabb21 password.

taking the text of my password,

md5_base64 returns I2rslD5dyn7O29ye51i2CA

base64_encode(md5()) returns MjM2YWVjOTQzZTVkY2E3ZWNlZGJkYzllZTc1OGI2MDg=

I even tried php's md5 and base64_encode by themselves and none produced the perl result I2rslD5dyn7O29ye51i2CA

md5(base64_encode()) returns 823da3bb402c17d9dda3ba0e72e0306e
Title: Re: trying to convert from yabb2, now can't log in as admin
Post by: SleePy on October 09, 2008, 03:39:27 PM
Well it has worked before. But I don't think much testing was done on encrypted passwords. One of the problem with Yabb is it is all flat file. So we have to use some methods such as exploding each line by a | to seperate the data out. Then we basically have to count off each and use that as the index for which part of the array contains what. So if they keep changing that on us along with other methods, it keeps us having to work and figure it out. With the possibilities that upgrading Yabb did not change the format that they used. So we could be working with 2 or 3 different keys just to try and find something such as a password :(
The user file isn't that mean though, it has a key setup with a name. So that does help :) but not when they have different formats for us to try and play with to match.

Well that is a pain because its not returning the right encoded length.
I was asking Jay about this and he pointed out this document:
http://www.devdaily.com/scw/perl/perl-5.8.5/ext/Digest/MD5/MD5.pm.shtml

The start of the string isn't even similar even though I didn't shorten the length to 22 yet.

Are you able to pm me the plain password or generate what the yabb encoded password would be for something simple like "password"?
I will try when I get home to play with some of the hashing methods to see if I can't get the same result. Which is the issue we need to solve before we can go and alter the LogInOut.php file and have it "learn" this new hashing method.
Title: Re: trying to convert from yabb2, now can't log in as admin
Post by: SleePy on October 09, 2008, 03:44:08 PM
Code: [Select]
I wonder.
What does this produce?

<?php echo bin2hex(base64_decode("password")); ?>

Don't forget you need to change password to be your password for these snippets.
Title: Re: trying to convert from yabb2, now can't log in as admin
Post by: rkleemann on October 09, 2008, 03:53:37 PM
So, using the word "password" here are the results:

base64_encode(md5("password")) = NWY0ZGNjM2I1YWE3NjVkNjFkODMyN2RlYjg4MmNmOTk=


md5(base64_encode("password")) = 0b8b946432f1ac91f0b07bd5f8df6587


perl md5_base64("password") = X03MO1qnZdYdgyfeuILPmQ
Title: Re: trying to convert from yabb2, now can't log in as admin
Post by: SleePy on October 09, 2008, 08:07:46 PM
Alright, I figured it out. Although it only works for versions of PHP 5 or higher. I have to see how I can get it to work with older versions of php though.

If you are using a version of php5 then I can simply show you how to edit your LogInOut.php so it can understand this password method :)
Which btw this is what I got to work:
Code: [Select]
echo base64_encode(md5('password', true));
Title: Re: trying to convert from yabb2, now can't log in as admin
Post by: rkleemann on October 09, 2008, 09:06:05 PM
Alright, I figured it out. Although it only works for versions of PHP 5 or higher. I have to see how I can get it to work with older versions of php though.

If you are using a version of php5 then I can simply show you how to edit your LogInOut.php so it can understand this password method :)
Which btw this is what I got to work:
Code: [Select]
echo base64_encode(md5('password', true));

Awesome! I'll try it out since I do have PHP5. Let me know where to change it
Title: Re: trying to convert from yabb2, now can't log in as admin
Post by: SleePy on October 09, 2008, 09:17:36 PM
Alright,
well while I was waiting I found the php4 equivalent as well :P

But I will give you the php5 one as it is less complex.

Open LogInOut.php

Find:
Code: [Select]
// Maybe they are using a hash from before the password fix.
Add before that:
Code: [Select]
// Yabb 2.1 hashed password?
$other_passwords[] = base64_encode(md5($_REQUEST['passwrd']), true));

If you are using php4 that last line would be:
Code: [Select]
$other_passwords[] = base64_encode(pack('H*', md5($_REQUEST['passwrd'])));Not very fun trying to figure that out :(

Now if you enter your login details, it should let you in.
Title: Re: trying to convert from yabb2, now can't log in as admin
Post by: rkleemann on October 09, 2008, 09:24:18 PM
won't that get overwritten by the next line?

$other_passwords[] = sha1(strtolower($user_settings['memberName']) . addslashes(un_htmlspecialchars(stripslashes($_REQUEST['passwrd']))));
Title: Re: trying to convert from yabb2, now can't log in as admin
Post by: rkleemann on October 09, 2008, 10:06:29 PM
Anyway,

This is what happens... It doesn't give me the wrong password error, but it outputs this:

You can't retrieve your password, but you can set a new one by following a link sent to you by email. You also have the option of setting a new password by answering your secret question.
Title: Re: trying to convert from yabb2, now can't log in as admin
Post by: SleePy on October 10, 2008, 12:33:34 AM
No it won't be overridden. $other_passwords is an array. [] is being used to say set this as the next item in the array basically. SMF then checks to see if it found one of them in the array, If it can it knows to update the password.

How many times did you try to login? I know if you try to login to many times to soon SMF will give a fuss and try to keep you out (trying to prevent flooding).
Title: Re: trying to convert from yabb2, now can't log in as admin
Post by: rkleemann on October 10, 2008, 11:17:33 AM
No it won't be overridden. $other_passwords is an array. [] is being used to say set this as the next item in the array basically. SMF then checks to see if it found one of them in the array, If it can it knows to update the password.

How many times did you try to login? I know if you try to login to many times to soon SMF will give a fuss and try to keep you out (trying to prevent flooding).

Certainly over these past days it's been a good number of tries. Where is the number of tries info kept? Because I'm getting this behavior even if I clear out the smf_members and re-convert.
Title: Re: trying to convert from yabb2, now can't log in as admin
Post by: rkleemann on October 10, 2008, 12:30:23 PM
No it won't be overridden. $other_passwords is an array. [] is being used to say set this as the next item in the array basically. SMF then checks to see if it found one of them in the array, If it can it knows to update the password.

How many times did you try to login? I know if you try to login to many times to soon SMF will give a fuss and try to keep you out (trying to prevent flooding).

Ok, so I think that your fix still didn't quite work. I tried logging in as another user and it still gives me "Password Incorrect".

So in comparing the output of the new hashing technique with what's in the database showed some differences.

For example, one of the passwords in the database is "bfr1904" and in yabb21 it is "/f/hNRmNAHF/0EAM0nTYVQ".

However, when run through base64_encode(md5("bfr1904", true)) it yields "/f/hNRmNAHF/0EAM0nTYVQ==", so it has the extra "==" tacked on at the end.
Title: Re: trying to convert from yabb2, now can't log in as admin
Post by: SleePy on October 10, 2008, 03:22:49 PM
Try this for the code:

Code: [Select]
      $other_passwords[] = rtrim(base64_encode(md5($_REQUEST['passwrd']), true)), "=");
If we get this working. I am going to add it in the yabb file to work backwards from this so we won't need to edit the login file.
Title: Re: trying to convert from yabb2, now can't log in as admin
Post by: rkleemann on October 10, 2008, 06:54:56 PM
Well this just doesn't make sense...  :(

Now that the password checking seems to be ok, I no longer get an error, but it simply just drops me to the login page as if I were not a registered user.

I just can't seem to make this work.
Title: Re: trying to convert from yabb2, now can't log in as admin
Post by: rkleemann on October 11, 2008, 07:17:23 PM
Ok so I started adding some debug.

What's happening now is that the password is matching. However the code just drops me back onto the login.

It gets all the way through the login, even up to the redirectexit, but then drops me back to the login.

So it DOES execute this line:
redirectexit('action=login2;sa=check;member=' . $ID_MEMBER, $context['server']['needs_login_fix']);

This is supposed to push me through to the boards, but I get dropped back to login.

What would cause this?
Title: Re: trying to convert from yabb2, now can't log in as admin
Post by: SleePy on October 13, 2008, 02:56:41 PM
Are you able to view posts and such fine?

I wonder if your server is not liking the ; at all.
Title: Re: trying to convert from yabb2, now can't log in as admin
Post by: rkleemann on October 13, 2008, 03:13:47 PM
Are you able to view posts and such fine?

I wonder if your server is not liking the ; at all.

Well, how would I view posts if I can't login? Remember, I'm still trying to convert from yabb21 and have never successfully logged in.
Title: Re: trying to convert from yabb2, now can't log in as admin
Post by: SleePy on October 14, 2008, 03:01:23 PM
I was hoping there would be some public posts you could see as a guest.

Are you sure you are being redirected to ?action=login on the forum and not the index page that is throwing up a login screen?
The check url you are being redirected to is to make sure cookies and your session exist. If it doesn't you get booted to the index. There is no way with the url like that, that you would go back to the login page.
Title: Re: trying to convert from yabb2, now can't log in as admin
Post by: rkleemann on October 14, 2008, 03:18:25 PM
I was hoping there would be some public posts you could see as a guest.

Are you sure you are being redirected to ?action=login on the forum and not the index page that is throwing up a login screen?
The check url you are being redirected to is to make sure cookies and your session exist. If it doesn't you get booted to the index. There is no way with the url like that, that you would go back to the login page.

What info can I provide you to help in this matter?

I can tell you for sure this line of code gets executed:
redirectexit('action=login2;sa=check;member=' . $ID_MEMBER, $context['server']['needs_login_fix']);

maintenance is set to 0 in Settings.php, and the only place in index.php that login2 seems to matter is when we're in maintenance mode.

What else can I look at?  :(
Title: Re: trying to convert from yabb2, now can't log in as admin
Post by: SleePy on October 14, 2008, 03:22:28 PM
If you go to your board and the url has no ?action=xxx. Do you see a login page or a listing of categories and boards?

If you see a login page, then guest access is turned off on the forum. Which means it runs a kick guest function that gives you the login page.
Title: Re: trying to convert from yabb2, now can't log in as admin
Post by: rkleemann on October 14, 2008, 03:29:24 PM
If you go to your board and the url has no ?action=xxx. Do you see a login page or a listing of categories and boards?

If you see a login page, then guest access is turned off on the forum. Which means it runs a kick guest function that gives you the login page.

The original board did not have guest access, so I'm guessing this one doesn't either. I have to login to see the posts. If the password matches, why am I getting kicked back to the login?
Title: Re: trying to convert from yabb2, now can't log in as admin
Post by: SleePy on October 14, 2008, 04:03:01 PM
That would be because your session isn't being saved correctly.
Can you confirm that you are getting a cookie set in your browser?

If you are. Then I will need to get my laptop out to remember the name of the setting in the smf_settings table that tells it to use database driven sessions or not. It could be that it isn't using database driven sessions and it isn't saving that session right.
Title: Re: trying to convert from yabb2, now can't log in as admin
Post by: rkleemann on October 15, 2008, 12:24:55 AM
That would be because your session isn't being saved correctly.
Can you confirm that you are getting a cookie set in your browser?

If you are. Then I will need to get my laptop out to remember the name of the setting in the smf_settings table that tells it to use database driven sessions or not. It could be that it isn't using database driven sessions and it isn't saving that session right.

Ok, cookies are being set, but to me it doesn't look right. These are the cookies on the session:

lifetime => 0
path => /
domain =>
secure =>
httponly =>

looks like no meaningful data. There is data in the smf_sessions table, but I can't tell whether it's recent data or not.
Title: Re: trying to convert from yabb2, now can't log in as admin
Post by: SleePy on October 15, 2008, 11:55:40 AM
Go ahead and empty the smf_sessions table. This just contains information about any session. So removing it will not affect anything really.
Go to the smf_settings table. Search for "databaseSession_enable".
If this exists, make sure it is set to 1, if not, create this and set it to 1.
Title: Re: trying to convert from yabb2, now can't log in as admin
Post by: rkleemann on October 15, 2008, 12:07:56 PM
Go ahead and empty the smf_sessions table. This just contains information about any session. So removing it will not affect anything really.
Go to the smf_settings table. Search for "databaseSession_enable".
If this exists, make sure it is set to 1, if not, create this and set it to 1.

Sorry about the "bad news" but the variable exists and is already set to 1.

I emptied smf_sessions, tried to login again, and a session entry was indeed made... but still, I can't login.

I don't see any errors being logged. I never thought it would be so complicated...  ;)

What debug do you suggest I put in?
Title: Re: trying to convert from yabb2, now can't log in as admin
Post by: SleePy on October 15, 2008, 02:00:23 PM
Well lets try to set that to 0 then and let php handle sessions.

If that doesn't work. I may need to look at it myself. I am quite perplexed at why it worked before the conversion and then after it, issues :|
The only thing I can think of would be the cookieTime setting that is copied over from Yabb. But that wouldn't make sense either :(
Title: Re: trying to convert from yabb2, now can't log in as admin
Post by: rkleemann on October 15, 2008, 07:55:17 PM
Well lets try to set that to 0 then and let php handle sessions.

If that doesn't work. I may need to look at it myself. I am quite perplexed at why it worked before the conversion and then after it, issues :|
The only thing I can think of would be the cookieTime setting that is copied over from Yabb. But that wouldn't make sense either :(

Well, I've just about given up...  :(

I set the databaseSession_enable in mysql to 0.

No change whatsoever. Even more strange, the cookies are still no different. I would have excpected to see more cookies (unless you're calling them something different? In debug I'm printing out what I get back from session_get_cookie_params()) and I still get nothing meaningful. No cookies are set.

I don't see any errors. But I can't login to the converted boards no matter what I do.
Title: Re: trying to convert from yabb2, now can't log in as admin
Post by: rkleemann on October 16, 2008, 04:25:39 PM
So I've been slowly trying to debug this.

What I've found so far is that after login, I end up getting kicked out where there's the "return 'KickGuest'" in index.php.

Not only that, I figured out that $user_info['is_guest'] is set to 1!

Even though I'm a registered user in smf_members. So I noticed that dateRegistered is 0.

So I'm sure that both of these things are causing my problem... the dateRegistered and the is_guest. I don't know how to get is_guest to be false.

Also, I noticed that ALL members have both a dateRegistered of 0 and ID_MEMBER is 0!!! So certainly that's messed up, everybody has the same ID.

So lo and behold... I changed my ID_MEMBER to 1 instead of 0 and suddenly the login seems to work... except that it's taking up all of the cpu and doing something with mysql. It's been there for a couple of minutes already, I don't know what it's doing.

So, in any case... the conversion needs to make sure that the dateRegistered and ID_MEMBER are all properly populated!

My login still hasn't completed, I don't know what's going on with mysql right now.
Title: Re: trying to convert from yabb2.1 , now can't log in as admin
Post by: SleePy on October 17, 2008, 05:52:40 PM
date_registered doesn't affect logins. The guest part just says your login failed.
The id_member could be the cause though. That seems odd they all have an id of 0. Although I do remember that the yabb converter did have a lot of issues until I rewrote it for Yabb 2.2.
Do you have any processes running in mysql?

edit,
btw. I changed the topic title here. I keep forgetting what version of yabb you are on so it will help me :P
Title: Re: trying to convert from yabb2.1 , now can't log in as admin
Post by: rkleemann on October 19, 2008, 12:08:37 PM
SleePy,

Thanks for your help so far. I really haven't had much luck. After I finally got to successfully login, the board goes nuts doing something with mysql and never actually lets me into the board.

So I've wiped everything out and started from scratch.

Is it possible to have 2 convert scripts, one that converts ONLY the members, boards, categories, moderators, and then one that converts ONLY the topics and posts?

I want to FIRST be able to reproduce the whole board structure with members. Make sure members can login and their settings are all correct.

Then only after that, I would convert the topics and posts, which is what takes many hours anyway. This is a board with 20,000 topics and 350,000 posts...
Title: Re: trying to convert from yabb2.1 , now can't log in as admin
Post by: ThorstenE on October 19, 2008, 02:36:51 PM
rkleemann,
If your yabb-version is still 2.1...  I have modified SleePy's yabb22_to_smf.php a little bit so it worked for Yabb 2.1 (and successfuly converted a yabb 2.1 with 50k Posts last week)

You should re-install SMF before using this because the old yabb21_to_smf.php has modified some tables and dropped indexes..
Title: Re: trying to convert from yabb2.1 , now can't log in as admin
Post by: rkleemann on October 19, 2008, 04:42:55 PM
Thanks!

Now is it easy to change the script so that it does it in 2 parts like I described above?
Title: Re: trying to convert from yabb2.1 , now can't log in as admin
Post by: SleePy on October 19, 2008, 09:21:52 PM
We could.

TE, did all parts convert? If it did. I will just update it as the official 2.1 converter and get a 2.0 version generated.
Title: Re: trying to convert from yabb2.1 , now can't log in as admin
Post by: rkleemann on October 20, 2008, 11:09:04 AM
We could.

TE, did all parts convert? If it did. I will just update it as the official 2.1 converter and get a 2.0 version generated.

Thanks SleePy!

Now, these 2 scripts, are they based on the original 2.1 converter, or on TE's 2.2 converter above?
Title: Re: trying to convert from yabb2.1 , now can't log in as admin
Post by: rkleemann on October 21, 2008, 01:22:32 PM
Guys,

Since TE's scripts successfully converted a 2.1 board, I wanted to make sure that SleePy's 2 part scripts are based on that, before I tried them out...

Thanks for your help
Ricardo
Title: Re: trying to convert from yabb2.1 , now can't log in as admin
Post by: rkleemann on October 21, 2008, 03:48:05 PM
Is there another top-level convert script that I should be using?

I'm getting this error:
arse error: syntax error, unexpected ';', expecting ')' in /shared/www/SMF/convert.php on line 2656
Title: Re: trying to convert from yabb2.1 , now can't log in as admin
Post by: ThorstenE on October 22, 2008, 09:55:48 AM
the convert.php is attached to the topic: (scroll down)
http://www.simplemachines.org/community/index.php?topic=140741.0
Title: Re: trying to convert from yabb2.1 , now can't log in as admin
Post by: rkleemann on October 22, 2008, 02:08:54 PM
Thanks for your help guys.

So now I have another issue. I ran the "part1" conversion, but it seems that the conversion truncated almost everything for each of the boards because they were in another language.

Basically each text (title, description, etc) gets truncated where the first accented character would be found.

Even selecting UTF8 during conversion didn't fix this...

For example, all of the board titles begin with the word "Fórum", however all boards come out with the title "F".
Title: Re: trying to convert from yabb2.1 , now can't log in as admin
Post by: ThorstenE on October 22, 2008, 02:48:03 PM
is your forum installation UTF-8 or another charset? the source (yabb) is a text based forum so SMF should be installed in a localized charset (latin1 for example)..
Title: Re: trying to convert from yabb2.1 , now can't log in as admin
Post by: rkleemann on October 22, 2008, 02:57:32 PM
In mysql, the tables are utf8 collation

All I know is I have a bunch of boards all named just "F" ;-)
Title: Re: trying to convert from yabb2.1 , now can't log in as admin
Post by: SleePy on October 23, 2008, 12:35:59 AM
Well that is odd. Did it work before we split it up into parts?

I just did a lot of simple returns on TEs script for each of the sections we where going to skip. Noting fancy really.
Title: Re: trying to convert from yabb2.1 , now can't log in as admin
Post by: rkleemann on October 23, 2008, 12:44:46 AM
I never got a full conversion to work so I'm not sure whether it worked before.

The master board/forum description has no problems with foreign characters. It's only the converted boards and their descriptions that don't like foreign characters.

All board names and descriptions are truncated.
Title: Re: trying to convert from yabb2.1 , now can't log in as admin
Post by: rkleemann on October 23, 2008, 01:41:48 AM
I figured it out.

I think when I installed, I selected UTF8.

So I wiped out the entire installation and re-installed with default latin-1 encoding. Now the boards convert correctly.

I'm not quite ready yet to convert the posts... but all the boards and members are there!  :D

Thanks guys for all your help!
Title: Re: trying to convert from yabb2.1 , now can't log in as admin
Post by: rkleemann on October 30, 2008, 12:01:29 PM
guys, the registration date for the yabb2.1 users didn't convert over...

I have almost 1000 users in a board, and wanted to make sure their register date also converted...

Now, a question unrelated to conversion, but I'm trying to figure out, how does one select which smileys to use when posting? I configured the board so the user can select the smileys, but when posting I don't see an option to select.
Title: Re: trying to convert from yabb2.1 , now can't log in as admin
Post by: SleePy on October 31, 2008, 06:08:02 PM
Open the Yabb21_to_smf.php

Find:
Code: [Select]
$field = trim(str_replace(array(' um ', ' de ', ' en ', ' la ', ' om '), ' at ', $field));
Replace:
Code: [Select]
$field = trim(str_replace(array(' um', ' de', ' en', ' la', ' om', ' at'), '', $field));
Title: Re: trying to convert from yabb2.1 , now can't log in as admin
Post by: rkleemann on December 02, 2008, 03:45:16 PM
Guys,

It's been a few weeks since I initially tried the conversion. I got everything setup and I only ran the part1, all users, boards and personal messages converted.

Now, I wanted to convert the topics and messages. Shortly after converting, I start getting this error:

Converting topics (part 1)... Unsuccessful!
This query:

    INSERT INTO `smf`.smf_topics
    (ID_BOARD, isSticky, locked, numViews, ID_LAST_MSG, ID_FIRST_MSG)
    VALUES ('6', '0', '0', '82', '1217894870', '1217894870');

Caused the error:

    Duplicate entry '1217894870-6' for key 2

This is using the yabb21-part2_to_smf.php script.

I even tried going into the database and deleting the offending topic, but it doesn't matter, it keeps coming back, it will complain about other duplicates and even come back and complain about the original one.

I have a pretty big YaBB2.1 board I'm trying to convert. The convert script got as far as converting 16,945 topics but now it just keeps on complaining about duplicate entries.

 :-[
Title: Re: trying to convert from yabb2.1 , now can't log in as admin
Post by: rkleemann on December 02, 2008, 06:54:43 PM
Please help guys...

I went as far as removing all the topics and restarting the conversion but I still get the same error once I get to around 16,895 topics converted...

It starts complaining about duplicate topics. Could the script not halt and just skip over the duplicates?

Converting topics (part 1)... Unsuccessful!
This query:

    INSERT INTO `smf`.smf_topics
    (ID_BOARD, isSticky, locked, numViews, ID_LAST_MSG, ID_FIRST_MSG)
    VALUES ('6', '0', '0', '199', '1218580945', '1218580945');

Caused the error:

    Duplicate entry '1218580945-6' for key 2
Title: Re: trying to convert from yabb2.1 , now can't log in as admin
Post by: ThorstenE on December 05, 2008, 01:58:21 AM
replied here:
http://www.simplemachines.org/community/index.php?topic=278569.0

please do not start more than one topic for the same issues please. Thank you..