News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Converting from YaBB 2.2

Started by unpossible, January 03, 2008, 11:15:44 PM

Previous topic - Next topic

JayBachatero

Try changing this line.

'dateRegistered' => parse_time($data['regdate']),

to

'dateRegistered' => (int) $data['regtime'],
Follow me on Twitter

"HELP!!! I've fallen and I can't get up"
This moment has been brought to you by LifeAlert

Gilrod

That chucked up a MySQL error...

ALTER TABLE `tnmsv3`.smf_members
ORDER BY ID_MEMBER = 0, dateRegistered;


Does one remove the = 0 from the convert.php in that query?

JayBachatero

Follow me on Twitter

"HELP!!! I've fallen and I can't get up"
This moment has been brought to you by LifeAlert

Gilrod

Ok sorted that one out, next .... :)

Incorrect date value: '' for column 'birthdate' at row 1

JayBachatero

Change

'birthdate' => isset($data['bday']) ? ($data['bday'] == '' || strtotime($data['bday']) == 0 ? '0001-01-01' : strftime('%Y-%m-%d', strtotime($data['bday']))) : '',

to

'birthdate' => isset($data['bday']) ? ($data['bday'] == '' || strtotime($data['bday']) == 0 ? '0001-01-01' : strftime('%Y-%m-%d', strtotime($data['bday']))) : '0001-01-01',
Follow me on Twitter

"HELP!!! I've fallen and I can't get up"
This moment has been brought to you by LifeAlert

Gilrod

Then now this is an issue too..

'lastLogin' => isset($data['lastonline']) ? $data['lastonline'] : '',

giving this error...

Incorrect integer value: '' for column 'lastLogin' at row 1

SleePy

MySQL must be running in strict mode for all these errors to occur..

That line can be changed to:
'lastLogin' => isset($data['lastonline']) ? $data['lastonline'] : '0',

But if mysql is in strict mode I think we will just see more errors occur..
I don't think the YaBB 2.1 converter was wrote for MySQL Strict mode..
Jeremy D ~ Site Team / SMF Developer ~ GitHub Profile ~ Join us on IRC @ Libera.chat/#smf ~ Support the SMF Support team!

Gilrod

Yeah, Jay and I realised it's a strict mode issue :-)

Typical... the next issue I'm having is this ...

Incorrect integer value: '' for column 'msgtime' at row

During step 4...

Converting personal messages... Unsuccessful!


JayBachatero

Yea I talked to him via IM and MySQL is running in strict mode.  The converter needs to be updated to support strict mode.
Follow me on Twitter

"HELP!!! I've fallen and I can't get up"
This moment has been brought to you by LifeAlert

SleePy

Gilrod,

I hope you don't mind testing :)

Let me know how this one works out. I made changes and hopefully found all columns that need specified correctly
Jeremy D ~ Site Team / SMF Developer ~ GitHub Profile ~ Join us on IRC @ Libera.chat/#smf ~ Support the SMF Support team!

Gilrod

No problems man, am just sat on my sofa watching sh!t TV ;-)


Gilrod

That script doesn't give any output, you did something wrong I think :)

Would it be quicker to do this via IM ?

SleePy

oops,
I didn't even check for syntax errors.

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

Gilrod

Morning Gents,
Sleepy, here's the latest error :)

Converting notifications... Successful.
Unsuccessful!
This query:

    ALTER TABLE `tnmsv3`.smf_messages
    CHANGE COLUMN ID_MSG ID_MSG int(10) unsigned NOT NULL default 0,
    DROP PRIMARY KEY,
    DROP INDEX topic,
    DROP INDEX ID_BOARD,
    DROP INDEX ID_TOPIC,
    DROP INDEX ID_MEMBER,
    ADD COLUMN temp_filename tinytext NOT NULL default '';

Caused the error:

    BLOB/TEXT column 'temp_filename' can't have a default value

SleePy

Ah dang.

Find:
                    'temp_filename' => "ADD COLUMN temp_filename tinytext NOT NULL default ''",

Replace:
                    'temp_filename' => "ADD COLUMN temp_filename tinytext(6) NOT NULL default ''",

A 6 should do it for tinytext.

That part of the query only happens though when the uploads directory exists.

The sad thing is that was step 10 and it took a while to get there.
We could cheat a little I believe and after the start of all the other steps before step 10. We just have it do a return.
It would mean we modify the file in 9 places previous to this so we just skip over the rest of the converter sections.
Jeremy D ~ Site Team / SMF Developer ~ GitHub Profile ~ Join us on IRC @ Libera.chat/#smf ~ Support the SMF Support team!

Gilrod

Got another for you ...

Unsuccessful!
This query:

    ALTER TABLE `tnmsv3`.smf_messages
    CHANGE COLUMN ID_MSG ID_MSG int(10) unsigned NOT NULL default 0,
    DROP PRIMARY KEY,
    DROP INDEX topic,
    DROP INDEX ID_BOARD,
    DROP INDEX ID_TOPIC,
    DROP INDEX ID_MEMBER,
    ADD COLUMN temp_filename tinytext(6) NOT NULL;

Caused the error:

    You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '(6) NOT NULL' at line 8

SleePy

Did the changes we made over MSN get you any further since I last seen you?
Jeremy D ~ Site Team / SMF Developer ~ GitHub Profile ~ Join us on IRC @ Libera.chat/#smf ~ Support the SMF Support team!

Gilrod

#57
That is what happened after the fix... I did send it back to you in msn, however you never came back to me, so I assumed you were busy.

Just so I know I'm not fooking this up...

We wanted to change this ...
'temp_filename' => "ADD COLUMN temp_filename tinytext(6) NOT NULL default ''",

to this ...

'temp_filename' => "ADD COLUMN temp_filename tinytext(6) NOT NULL",

Stew.

JayBachatero

tinytext fields have a predefined size.  You can't specify a size for it unless it's a varchar column.


'temp_filename' => "ADD COLUMN temp_filename tinytext NOT NULL",
Follow me on Twitter

"HELP!!! I've fallen and I can't get up"
This moment has been brought to you by LifeAlert

Gilrod

And the next step ...

Converting posts (part 1 - this may take some time)... Unsuccessful!
This query:

    INSERT INTO `tnmsv3`.smf_messages
    (ID_TOPIC, ID_BOARD, subject, posterName, posterEmail, posterTime, icon, posterIP, body, smileysEnabled, modifiedTime, modifiedName, temp_filename)
    VALUES ('3166', '5', 'Rush - what are they like?', 'Matt_Callow', **************', '1071598776', 'xx', '217.206.177.18', 'There\'s a bit of a discussion going on over here...<br>http://www.melodicrock.com/phorum33/list.php?f=1<br><br>Enjoy!', '', '0', '', ''),
    ('3166', '5', 'Re: Rush - what are they like?', 'Slim', '**************', ', '1071599686', 'xx', '62.253.32.5', 'I see some poor soul has described [i]Counterparts[/i] as a \'true masterpiece\' lmao<br><br>Very sad .. ;D<br><br>', '1', '0', '', ''),
    ('3166', '5', 'Re: Rush - what are they like?', 'Reg_Sweeting-Jones', '**************', ', '1071610023', 'xx', '81.86.90.146', '[quote]I see some poor soul has described [i]Counterparts[/i] as a \'true masterpiece\' lmao<br /><br />Very sad .. ;D<br /><br />[/quote]<br>Truly deranged.', '1', '0', '', ''),
    ('3166', '5', 'Re: Rush - what are they like?', 'Neil_Pudney', '**************', ', '1071615333', 'xx', '80.46.152.4', '[quote]I see some poor soul has described [i]Counterparts[/i] as a \'true masterpiece\' lmao<br /><br />Very sad .. ;D<br /><br />[/quote]<br> Glad to see you\'ve put them right :-)', '1', '0', '', ''),
    ('3166', '5', 'Re: Rush - what are they like?', 'Jon_M', 'j**************', , '1071634845', 'xx', '62.6.139.12', 'Well, they\'re like a little rabbit really...', '1', '0', '', ''),
    ('3166', '5', 'Re: Rush - what are they like?', 'Dave_Lack', '**************', ', '1071797572', 'xx', '81.101.68.134', 'Can\'t wait for the Counterparts debate..... ;)', '1', '0', '', '');

Caused the error:

    Incorrect integer value: '' for column 'smileysEnabled' at row 1

Advertisement: