Simple Machines Community Forum

SMF Support => Converting to SMF => IPB => Topic started by: Craw on August 21, 2013, 06:30:09 AM

Title: Re: Converting members...Wrong value type sent to the database. Date expected
Post by: Craw on August 21, 2013, 06:30:09 AM
Hi,

Sorry for reviving a very old topic but I just encountered this problem.

If I'm going to do ThorstenE's suggestion, where should I put it?

Thanks.
Title: Re: [SMF Converter] IPB 2.3.x
Post by: Craw on August 21, 2013, 02:21:26 PM
Hi all,

I need help. I'm getting this error:

Converting posts (this may take some time)...Wrong value type sent to the database. Integer expected. (modified_time)
Title: Re: Re: Converting members...Wrong value type sent to the database. Date expected
Post by: emanuele on August 22, 2013, 03:56:21 AM
In the .sql file, where you see:
---* {$to_prefix}members
---{
if (empty($INFO['admin_group']))
$INFO['admin_group'] = 1;


Add after it like this:
---* {$to_prefix}members
---{
if (empty($INFO['admin_group']))
$INFO['admin_group'] = 1;

/* fix invalid birthdates */
if(!preg_match('/\d{4}-\d{2}-\d{2}/', $row['birthdate']))
$row['birthdate'] = '0001-01-01';
Title: Re: Re: Converting members...Wrong value type sent to the database. Date expected
Post by: Craw on August 22, 2013, 10:41:48 AM
Thanks, Emanuele.

Now I hope you can help me out with another problem:
http://www.simplemachines.org/community/index.php?topic=238557.msg3597033#msg3597033
Title: Re: Re: [SMF Converter] IPB 2.3.x
Post by: emanuele on August 22, 2013, 11:05:19 AM
I thought I posted here before, but apparently I just wrote the message and forgot it somewhere in some tab on some computer...

As a suggestion: next time if you have problems with conversion, open a new topic and put all of them together in one place, it's easier to track.

If you don't mind, later I'll split all your posts and put them together into one.

Back to your problem, try replacing:
p.edit_time AS modified_time
with:
IFNULL(p.edit_time, 0) AS modified_time
Title: Re: Re: [SMF Converter] IPB 2.3.x
Post by: Craw on August 22, 2013, 11:58:48 AM
Quote from: emanuele on August 22, 2013, 11:05:19 AM
As a suggestion: next time if you have problems with conversion, open a new topic and put all of them together in one place, it's easier to track.

Sorry about that. I was just so used to people saying "That has already been asked and answered," etc... Not here, though.

Quote from: emanuele on August 22, 2013, 11:05:19 AM
If you don't mind, later I'll split all your posts and put them together into one.

Sure, no problem :)

Quote from: emanuele on August 22, 2013, 11:05:19 AM
Back to your problem, try replacing:
p.edit_time AS modified_time
with:
IFNULL(p.edit_time, 0) AS modified_time

Trying now.
Title: ERRORS, need help: Converting IPB 2.3.x to SMF 2.0.2
Post by: Craw on August 22, 2013, 07:15:48 PM
(Emanuele, you can move my posts to this topic, specifically this (http://www.simplemachines.org/community/index.php?topic=474965.msg3596821#msg3596821) and this (http://www.simplemachines.org/community/index.php?topic=238557.msg3597033#msg3597033), and the corresponding replies :) Thanks!)

OK, I encountered a new error. Please help :( :

Converting topics...
Duplicate entry '141824' for key 'PRIMARY'
Title: Re: Re: Converting members...Wrong value type sent to the database. Date expected
Post by: emanuele on August 23, 2013, 03:04:15 PM
I think the solution is:
Code (find) Select
---* {$to_prefix}topics 250

Code (replace with) Select
---* {$to_prefix}topics 250
{
$ignore = true;
}
Title: Re: Re: Converting members...Wrong value type sent to the database. Date expected
Post by: Craw on August 23, 2013, 10:17:24 PM
New error from that new snippet of code, I think:

Converting topics... Unsuccessful!
This query:

    {
    $ignore = true
    LIMIT 0, 250;

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 '{
    $ignore = true
    LIMIT 0, 250' at line 1
Title: Re: Re: Converting members...Wrong value type sent to the database. Date expected
Post by: Craw on August 23, 2013, 10:24:07 PM
Oh, and thanks for putting all my posts in one topic, Emanuele.
Title: Re: Re: Converting members...Wrong value type sent to the database. Date expected
Post by: emanuele on August 24, 2013, 04:03:56 PM
Oh darn...sorry, it was meant to be:
---* {$to_prefix}topics 250
---{
$ignore = true;
---}
Title: Re: Re: Converting members...Wrong value type sent to the database. Date expected
Post by: Craw on August 25, 2013, 07:14:37 AM
Similar problem encountered:
Converting posts (this may take some time)...
Duplicate entry '321477' for key 'PRIMARY'
Title: Re: Re: Converting members...Wrong value type sent to the database. Date expected
Post by: emanuele on August 25, 2013, 09:51:31 AM
Similar solution...
If you search the piece "converting posts" you will find the place the code should be added.

Though it's strange that returns so many duplicate entries... :-\
Title: Re: Re: Converting members...Wrong value type sent to the database. Date expected
Post by: Craw on August 25, 2013, 11:49:48 AM
Quote from: emanuele on August 25, 2013, 09:51:31 AM
Similar solution...
If you search the piece "converting posts" you will find the place the code should be added.
Oh, OK. Trying now.
Title: Re: Re: Converting members...Wrong value type sent to the database. Date expected
Post by: Craw on August 26, 2013, 08:24:57 PM
Last one worked. Thanks! We're progressing.

But there are new errors:

Converting calendar events...Error in convert script - line 568!
Error in convert script - line 569!
Wrong value type sent to the database. Date expected. (start_date)
Title: Re: Re: Converting members...Wrong value type sent to the database. Date expected
Post by: Craw on September 01, 2013, 11:59:43 PM
Quote from: Craw on August 26, 2013, 08:24:57 PM
Last one worked. Thanks! We're progressing.

But there are new errors:

Converting calendar events...Error in convert script - line 568!
Error in convert script - line 569!
Wrong value type sent to the database. Date expected. (start_date)

Still having this problem :(
Title: Re: Re: Converting members...Wrong value type sent to the database. Date expected
Post by: emanuele on September 02, 2013, 04:26:27 AM
I'm sorry, I completely lost these in the unread replies... :-[

This is tricky, because the converter should already take care of converting the timestamp to a string, see:
---{
$row['start_date'] = date('Y-m-d', $row['start_date']);
$row['end_date'] = date('Y-m-d', $row['end_date']);
---}


Did you fill in the past any "custom" event or date?
Because the easy option is to just remove that part of the conversion, SMF already has some events in the database (well, in your case "had", but they can be resotred), so if you didn't do changes or if you didn't use it, you can just ignore that part of conversion and remove its code.
Title: Re: Re: Converting members...Wrong value type sent to the database. Date expected
Post by: Craw on September 06, 2013, 02:59:43 AM
Thanks Emanuele. No worries. I'll try to just remove the code as I don't think I have any real important dates in the calendar.

I'll let you know how it goes.
Title: Re: Re: Converting members...Wrong value type sent to the database. Date expected
Post by: Craw on September 06, 2013, 05:41:43 AM
OK, I removed that snippet of code. But then this error appeared:

Converting calendar events...Error in convert script - line 568!
Unsuccessful!
This query:

    TRUNCATE `travels4_ivbd2`.smf4x4ph_calendar
    SELECT
    event_id AS id_event,
    event_unixstamp AS start_date, event_unixstamp AS end_date,
    '0' AS id_board, '0' AS id_topic, SUBSTRING(event_title, 1, 60) AS title, event_member_id AS id_member
    FROM `travels4_ivbd1`.ibf_cal_events
    LIMIT 0, 500;

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 'SELECT
    event_id AS id_event,
    event_unixstamp AS start_date, event_unixstamp AS' at line 2


Is this because I need to remove more code aside from what you last posted above?
Title: Re: Converting members...Wrong value type sent to the database. Date expected
Post by: emanuele on September 06, 2013, 07:06:47 AM
Yeah, remove things from that kind of files may be tricky.

Try the one attached. ;)