News:

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

Main Menu

vBulletin 3.5 converter errors

Started by B3aker, August 18, 2013, 05:16:15 PM

Previous topic - Next topic

B3aker

Hi. I'm working on converting a vBulletin 3.5.4 forum to SMF 2.0. I did run into a couple errors during the conversion process but the past topics here have helped me fix the situation. However, I came across this error to converting the posts and I didn't see anything that might help. Any help is appreciated  :)

QuoteConverting polls...Wrong value type sent to the database. Integer expected. (id_member)
PSX4Central Since 1999, quite possibly the oldest PlayStation Community on the net

kat

In the converter script, is there a block of code, like this? (Sorry, I'm not terribly familiar with the converters and you don't say which converter you're using)

$week = date("W",$now);
$year = date("Y",$now);


If there is, try changing it to this:

$week = (int) date("W",$now);
$year = (int) date("Y",$now);

B3aker

Hi. Sorry. Forgot to mention I'm using the vbulletin 3.5 to smf 2.0.5 converter. I searched in the included scripts and didn't see that line of code anywhere.
PSX4Central Since 1999, quite possibly the oldest PlayStation Community on the net

kat

I got the converter and the only bit of code, doing polls, is this:

if (!isset($indexes['poll']))
$smcFunc['db_add_index']($to_prefix . 'topics', array(
'type' => 'UNIQUE',
'name' => 'poll',
'columns' => array('id_poll', 'id_topic')),
array('no_prefix' => true));


The only part that seems similar, to me, is the $smcFunc thing. As you can tell, I'm WAY in over my head, here. But, I'm wondering making:

$smcFunc['db_add_index']($to_prefix . 'topics', array(


into:

$smcFunc (int) ['db_add_index']($to_prefix . 'topics', array(

would sort that?

(I really don't have a clue, though) :(

B3aker

Got this when I typed in mydomain.com/forum/convert.php

QuoteParse error: syntax error, unexpected T_INT_CAST in /home/content/79/11133879/html/forum/convert.php on line 2014
PSX4Central Since 1999, quite possibly the oldest PlayStation Community on the net

kat

That kinda proves my point, then.

I'll flag this up and see if anyone else can help-out.

B3aker

I appreciate you giving it a shot. Thank you  :)
PSX4Central Since 1999, quite possibly the oldest PlayStation Community on the net

emanuele

I'd try with:
Code (find) Select
t.postuserid AS id_member
FROM {$from_prefix}poll AS p


Code (replace with) Select
IFNULL(t.postuserid, 0) AS id_member
FROM {$from_prefix}poll AS p


Take a peek at what I'm doing! ;D




Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

kat

OO! I was almost kinda on the right track, there!

Ta, Manny!

B3aker

Went a little farther this time. This is what it says now.

QuoteConverting posts (this may take some time)...
Successful.
Converting polls...Wrong value type sent to the database. Integer expected. (expire_time)
PSX4Central Since 1999, quite possibly the oldest PlayStation Community on the net

emanuele

mmm...this is odd on multiple levels...

expire_time is the result of an arithmetic operation:
IF(p.timeout = 0, 0, p.dateline + p.timeout * 86400) AS expire_time
how it could result in something different than an integer is not clear to me.

As a workaround you may set all the polls as without expiration or all expired.
For the first:
0 AS expire_time
for the latter:
UNIX_TIMESTAMP() AS expire_time


Take a peek at what I'm doing! ;D




Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

B3aker

Quote from: emanuele on August 20, 2013, 06:58:30 PM
mmm...this is odd on multiple levels...

Been my thoughts exactly since I took over this message board, lol. I changed it to the first one and I'm running the converter now. I'll let you know how it plays out :)
PSX4Central Since 1999, quite possibly the oldest PlayStation Community on the net

B3aker

Quote from: emanuele on August 20, 2013, 06:58:30 PM
mmm...this is odd on multiple levels...

expire_time is the result of an arithmetic operation:
IF(p.timeout = 0, 0, p.dateline + p.timeout * 86400) AS expire_time
how it could result in something different than an integer is not clear to me.

As a workaround you may set all the polls as without expiration or all expired.
For the first:
0 AS expire_time
for the latter:
UNIX_TIMESTAMP() AS expire_time

I tried the first code. It didn't work. Got this

QuoteConverting posts (this may take some time)...
Successful.
Converting polls... Unsuccessful!
This query:

    SELECT
    p.pollid AS id_poll, SUBSTRING(p.question, 1, 255) AS question,
    IF(p.active = 0, 1, 0) AS voting_locked, p.multiple AS max_votes,
    SUBSTRING(IFNULL(t.postusername, 'Guest'), 1, 255) AS poster_name,
    IF(p.timeout = 0, 0, p.dateline + p.timeout * 86400) 0 AS expire_time,
    IFNULL(t.postuserid, 0) AS id_member
    FROM `PSX4CentralSMF`.poll AS p
    LEFT JOIN `PSX4CentralSMF`.thread AS t ON (t.pollid = p.pollid)
    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 '0 AS expire_time,
    IFNULL(t.postuserid, 0) AS id_member
    FROM `PSX4CentralSMF`.po' at line 5

I typed this in as the code

IF(p.timeout = 0, 0, p.dateline + p.timeout * 86400) 0 AS expire_time,

Was that right? If that was, I'm confused on where to put the full code with your second method (not very good at PHP). Does it go like this?

UNIX_TIMESTAMP() AS expire_time
PSX4Central Since 1999, quite possibly the oldest PlayStation Community on the net

emanuele

You left there the old piece of the code. ;)

IF(p.timeout = 0, 0, p.dateline + p.timeout * 86400) 0 AS expire_time,
should be only:
0 AS expire_time,


Take a peek at what I'm doing! ;D




Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

B3aker

Quote from: emanuele on August 22, 2013, 03:59:53 AM
You left there the old piece of the code. ;)

IF(p.timeout = 0, 0, p.dateline + p.timeout * 86400) 0 AS expire_time,
should be only:
0 AS expire_time,

Haha. Ok. I'll fix that and run it again and let you know how it works. I'm new to this PHP stuff. I know HTML much better. Since I took over this message board, PHP and SQL coding is all new to me.
PSX4Central Since 1999, quite possibly the oldest PlayStation Community on the net

B3aker

Sweet. I got past the polls. Now I got a new error.

QuoteConverting personal messages (step 1)...
Successful.
Converting personal messages (step 2)...Error in convert script - line 222!
Error in convert script - line 225!
Successful.
Converting topic notifications... Unsuccessful!
This query:

    SELECT
    pm.pmid AS id_pm, pm.touserid AS id_member, pm.readtime != 0 AS is_read,
    '-1' AS labels
    FROM `PSX4CentralSMF`.pm AS pm
    TRUNCATE `PSX4CentralSMF`.smf_log_notify;

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 'TRUNCATE `PSX4CentralSMF`.smf_log_notify' at line 5
PSX4Central Since 1999, quite possibly the oldest PlayStation Community on the net

emanuele

This is really a but in the converter, in the .sql file, change:
FROM {$from_prefix}pm AS pm
to:
FROM {$from_prefix}pm AS pm;


Take a peek at what I'm doing! ;D




Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

B3aker

Went a bit further but got this error

QuoteConverting posts (this may take some time)...
Successful.
Converting polls... Successful.
Converting poll options... Successful.
Converting poll votes... Successful.
Converting personal messages (step 1)... Successful.
Converting personal messages (step 2)... Unsuccessful!
This query:

    SELECT
    pm.pmid AS id_pm, pm.touserid AS id_member, pm.readtime != 0 AS is_read,
    '-1' AS labels
    FROM `PSX4CentralSMF`.pm AS pm
    LIMIT 0, 500;

Caused the error:

    Unknown column 'pm.touserid' in 'field list'
PSX4Central Since 1999, quite possibly the oldest PlayStation Community on the net

emanuele

...are you sure you are using vB 3.5? Asking because it seems strange there are so many (unnoticed before) errors.

TBH I have no idea how to fix that one without looking *at least* at the table schema.


Take a peek at what I'm doing! ;D




Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

B3aker

Quote from: emanuele on August 25, 2013, 09:53:17 AM
...are you sure you are using vB 3.5? Asking because it seems strange there are so many (unnoticed before) errors.

TBH I have no idea how to fix that one without looking *at least* at the table schema.

Yeah. Its the vB3.5 converter. Not surprised there's a lot of errors to be honest. When I took over the website, it took 2 months to just get the vBulletin to work on my server. It also wasn't really maintained within the last 7 years.

What do you need to see the table schema? A screenshot of my tables in phpmyadmin? Let me know what you need :)
PSX4Central Since 1999, quite possibly the oldest PlayStation Community on the net

Advertisement: