Simpleboard to SMF 1.0.x Conversion Script

Started by Kirby, September 21, 2005, 07:14:12 PM

Previous topic - Next topic

peacemake

Quote from: spiros on September 01, 2006, 03:36:00 PM
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 'SUBSTRING(m.subject, 1, 255), ID_MEMBER, posterName, posterEmail, posterIP, ID_B' at line 2

I got the same error  :-\

Panache Web

well it would be nice to have a working solution to this problem..


mrgima

I need to convert from Joomlaboard 1.1 to SMF 1.1 RC3. Anybody has any idea please? Is the script of this post good for me?

Thanks.

Giuseppe

maxigas

Quote from: peacemake on September 09, 2006, 07:03:51 PM
Quote from: spiros on September 01, 2006, 03:36:00 PM
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 'SUBSTRING(m.subject, 1, 255), ID_MEMBER, posterName, posterEmail, posterIP, ID_B' at line 2

I got the same error  :-\

And I got the same error... HELP US!

scorpion79

Quote from: mrgima on September 17, 2006, 04:59:47 AM
I need to convert from Joomlaboard 1.1 to SMF 1.1 RC3. Anybody has any idea please? Is the script of this post good for me?

Thanks.

Giuseppe

me to is the script ok?

Vera

Quote from: peacemake on September 09, 2006, 07:03:51 PM
Quote from: spiros on September 01, 2006, 03:36:00 PM
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 'SUBSTRING(m.subject, 1, 255), ID_MEMBER, posterName, posterEmail, posterIP, ID_B' at line 2

I got the same error  :-\

I also got the same error... converting the posts= unsuccessful! Has anyone found a solution to this yet??

tweetor

I got exactly the same error with the posts not being taken over. As this topic is open for some time, I tend to choose the most valueable posts from my Simpleboard installation and "convert them manually" - copy&paste. At least the rest comes across alright.

sdubs

#47
I try to migrate a simpleboard forum (Simpleboard Forum Component 1.1 RC1) to SMF with the conversion script (smf_1-1-rc3_simpleboard_converter).

I made a correction on the table "messages" request. after the migration had be done, i decide to test
and i had this problem :
Quote
img width=]o[img width=]l[img width=][img width=][img width=]f[img width=]ll[img width=][img width=],
vo[img width=]là [img width=]un[img width=]photo[img width=]onta[img width=][img width=][img width=]qu[img width=][img width=]va[img width=]vou[img width=][img width=]pla[img width=]r[img width=],[img width=]l[img width=][img width=]procha[img width=]n[img width=]j[img width=][img width=]l[img width=][img width=]fa[img width=]t[img width=]av[img width=]c[img width=]du[img width=]lon[img width=]board,vou[img width=][img width=]av[img width=][img width=][img width=]b[img width=][img width=]o[img width=]n[img width=]d[img width=]avo[img width=]r[img width=]qu[img width=]ckt[img width=][img width=][img width=][img width=]pour[img width=]l[img width=][img width=]vo[img width=]r:
http://b[img width=]ta.wooloo[img width=]ooloo-[img width=]all[img width=]ry.co[img width=]/[img width=]nd[img width=]x.php?opt[img width=]on[img width=]co[img width=]_cont[img width=]nt&a[img width=]p;ta[img width=]k[img width=]v[img width=][img width=]w&a[img width=]p;[img width=]d[img width=][img width=][img width=]
Qu[img width=][img width=][img width=]t[img width=]c[img width=][img width=]qu[img width=][img width=]vou[img width=][img width=][img width=]n[img width=]p[img width=]n[img width=][img width=][img width=]?
B[img width=][img width=]B[img width=][img width=]B[img width=][img width=]B[img width=][img width=]B[img width=][img width=]B[img width=]

There are two lines :
Quote
$row['body'] = preg_replace('~[file name=.+?]http.+?[/file]~i', '', $row['body']);
$row['body'] = preg_replace('~[img size=(\d+)]~i', '[img width=$1]', $row['body']);

Can you help me

thanks.

Edit 22.11.2006 21:43
I just find that my problem of img is from this code:
Quote$row['body'] = preg_replace('~[img size=(\d+)]~i', '[img width=$1]', $row['body']);

is anyone has found a correction, thanks ?

Edit 23.11.2006 21:39
It's ok i found it :
Quote$row['body'] = preg_replace('~\[img size=(\d+)\]~i', '[img width=$1]', $row['body']);

sdubs

#48
to correct the error
Quote from: Vera on November 07, 2006, 04:01:12 PM
Quote from: peacemake on September 09, 2006, 07:03:51 PM
Quote from: spiros on September 01, 2006, 03:36:00 PM
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 'SUBSTRING(m.subject, 1, 255), ID_MEMBER, posterName, posterEmail, posterIP, ID_B' at line 2

I got the same error  :-\

I also got the same error... converting the posts= unsuccessful! Has anyone found a solution to this yet??


add the red text

SUBSTRING(m.subject, 1, 255) AS subject, m.userid AS ID_MEMBER,

gn0stik

#49
OK, so I got it all working via the various hacks to the script that people have supplied, Some attachments did not come over, I got copy errors for some reason.


However That's not my issue.

My issue is people's real names are being displayed instead of their usernames, on all the posts.




Anyone have a fix for this? Is this something I can fix in the admin backend?

Rich

I used the jsimpleboard_to_smf.php, with simpleboard_to_smf.sql


Final version of the SQL file that I used below:


/* ATTENTION: You don't need to run or use this file!  The convert.php script does everything for you! */

/******************************************************************************/
---~ name: "Simpleboard 1.0 and 1.1"
/******************************************************************************/
---~ version: "SMF 1.1"
---~ settings: "/configuration.php", "../../configuration.php", "../../../configuration.php"
---~ from_prefix: "`$mosConfig_db`.$mosConfig_dbprefix"
---~ table_test: "{$from_prefix}users"

/******************************************************************************/
--- Converting members...
/******************************************************************************/

TRUNCATE {$to_prefix}members;

---* {$to_prefix}members
SELECT
/* // !!! We could use m.name for the realName? */
m.id AS ID_MEMBER, SUBSTRING(m.username, 1, 80) AS memberName,
SUBSTRING(m.username, 1, 255) AS realName,
SUBSTRING(sb.signature, 1, 65534) AS signature, sb.posts,
sb.karma AS karmaGood, SUBSTRING(m.password, 1, 64) AS passwd,
SUBSTRING(m.email, 1, 255) AS emailAddress,
SUBSTRING(cd.country, 1, 255) AS location,
IF(m.activation = 1, 0, 1) AS is_activated,
UNIX_TIMESTAMP(m.registerDate) AS dateRegistered,
UNIX_TIMESTAMP(m.lastvisitDate) AS lastLogin,
IF(cd.params LIKE '%email=0%', 1, 0) AS hideEmail,
IF(m.usertype = 'superadministrator' OR m.usertype = 'administrator', 1, 0) AS ID_GROUP,
'' AS lngfile, '' AS buddy_list, '' AS pm_ignore_list, '' AS messageLabels,
'' AS personalText, '' AS websiteTitle, '' AS websiteUrl, '' AS ICQ,
'' AS AIM, '' AS YIM, '' AS MSN, '' AS timeFormat, '' AS avatar,
'' AS usertitle, '' AS memberIP, '' AS secretQuestion, '' AS secretAnswer,
'' AS validation_code, '' AS additionalGroups, '' AS smileySet,
'' AS passwordSalt, '' AS memberIP2
FROM {$from_prefix}users AS m
LEFT JOIN {$from_prefix}sb_users AS sb ON (sb.userid = m.id)
LEFT JOIN {$from_prefix}contact_details AS cd ON (cd.user_id = m.id);
---*

/******************************************************************************/
--- Converting categories...
/******************************************************************************/

TRUNCATE {$to_prefix}categories;

---* {$to_prefix}categories
SELECT id AS ID_CAT, SUBSTRING(name, 1, 255) AS name, ordering AS catOrder
FROM {$from_prefix}sb_categories
WHERE parent = 0;
---*

/******************************************************************************/
--- Converting boards...
/******************************************************************************/

TRUNCATE {$to_prefix}boards;

DELETE FROM {$to_prefix}board_permissions
WHERE ID_BOARD != 0;

---* {$to_prefix}boards
SELECT
id AS ID_BOARD, parent AS ID_CAT, ordering AS boardOrder,
SUBSTRING(name, 1, 255) AS name,
SUBSTRING(description, 1, 65534) AS description, '-1,0' AS memberGroups
FROM {$from_prefix}sb_categories
WHERE parent != 0;
---*

/******************************************************************************/
--- Converting topics...
/******************************************************************************/

TRUNCATE {$to_prefix}topics;
TRUNCATE {$to_prefix}log_topics;
TRUNCATE {$to_prefix}log_boards;
TRUNCATE {$to_prefix}log_mark_read;

---* {$to_prefix}topics
SELECT
t.id AS ID_TOPIC, t.catid AS ID_BOARD, t.ordering AS isSticky, t.locked,
t.hits AS numViews, t.userid AS ID_MEMBER_STARTED,
MIN(m.id) AS ID_FIRST_MSG, MAX(m.id) AS ID_LAST_MSG
FROM ({$from_prefix}sb_messages AS t, {$from_prefix}sb_messages AS m)
WHERE t.parent = 0
AND m.thread = t.id
GROUP BY t.id
HAVING ID_FIRST_MSG != 0
AND ID_LAST_MSG != 0;
---*

---* {$to_prefix}topics (update ID_TOPIC)
SELECT t.ID_TOPIC, m.userid AS ID_MEMBER_UPDATED
FROM ({$to_prefix}topics AS t, {$from_prefix}sb_messages AS m)
WHERE m.thread = t.ID_LAST_MSG;
---*

/******************************************************************************/
--- Converting posts (this may take some time)...
/******************************************************************************/

TRUNCATE {$to_prefix}messages;
TRUNCATE {$to_prefix}attachments;

---* {$to_prefix}messages 200
---{
$row['body'] = preg_replace('~[file name=.+?]http.+?[/file]~i', '', $row['body']);
$row['body'] = preg_replace('~\[img size=(\d+)\]~i', '[img width=$1]', $row['body']);
---}
SELECT
m.id AS ID_MSG, m.thread AS ID_TOPIC, m.time AS posterTime,
SUBSTRING(m.subject, 1, 255) AS subject, m.userid AS ID_MEMBER,
SUBSTRING(m.name, 1, 255) AS posterName,
SUBSTRING(m.email, 1, 255) AS posterEmail,
SUBSTRING(m.ip, 1, 255) AS posterIP, m.catid AS ID_BOARD,
SUBSTRING(mt.message, 1, 65534) AS body, '' AS modifiedName, 'xx' AS icon
FROM ({$from_prefix}sb_messages AS m, {$from_prefix}sb_messages_text AS mt)
WHERE mt.mesid = m.id;
---*

/******************************************************************************/
--- Converting topic notifications...
/******************************************************************************/

TRUNCATE {$to_prefix}log_notify;

---* {$to_prefix}log_notify
SELECT DISTINCTROW userid AS ID_MEMBER, thread AS ID_TOPIC
FROM {$from_prefix}sb_subscriptions;
---*

/******************************************************************************/
--- Converting moderators...
/******************************************************************************/

TRUNCATE {$to_prefix}moderators;

---* {$to_prefix}moderators
SELECT catid AS ID_BOARD, userid AS ID_MEMBER
FROM {$from_prefix}sb_moderation;
---*

/******************************************************************************/
--- Clearing unused tables...
/******************************************************************************/

TRUNCATE {$to_prefix}personal_messages;
TRUNCATE {$to_prefix}pm_recipients;
TRUNCATE {$to_prefix}polls;
TRUNCATE {$to_prefix}poll_choices;
TRUNCATE {$to_prefix}log_polls;

/******************************************************************************/
--- Converting smileys...
/******************************************************************************/

UPDATE {$to_prefix}smileys
SET hidden = 1;

---{
$specificSmileys = array(
':cool:' => 'cool',
':(' => 'sad',
':confused:' => 'huh',
':mad:' => 'angry',
':rolleyes:' => 'rolleyes',
':eek:' => 'shocked',
':p' => 'tongue',
':redface:' => 'embarassed',
':wink:' => 'wink',
':biggrin:' => 'grin',
':smilie:' => 'smiley',
);

$request = convert_query("
SELECT MAX(smileyOrder)
FROM {$to_prefix}smileys");
list ($count) = mysql_fetch_row($request);
mysql_free_result($request);

$request = convert_query("
SELECT code
FROM {$to_prefix}smileys");
$currentCodes = array();
while ($row = mysql_fetch_assoc($request))
$currentCodes[] = $row['code'];
mysql_free_result($request);

$rows = array();
foreach ($specificSmileys as $code => $name)
{
if (in_array($code, $currentCodes))
continue;

$count++;
$rows[] = "'$code', '{$name}.gif', '$name', $count";
}

if (!empty($rows))
convert_query("
REPLACE INTO {$to_prefix}smileys
(code, filename, description, smileyOrder)
VALUES (" . implode("),
(", $rows) . ")");
---}

ALTER TABLE {$to_prefix}smileys
ORDER BY LENGTH(code) DESC;

/******************************************************************************/
--- Converting attachments...
/******************************************************************************/

---* {$to_prefix}attachments
---{
$no_add = true;
$keys = array('ID_ATTACH', 'size', 'filename', 'ID_MSG', 'downloads');

$newfilename = getAttachmentFilename(basename($row['filelocation']), $ID_ATTACH);
if (strlen($newfilename) <= 255 && copy($row['filelocation'], $attachmentUploadDir . '/' . $newfilename))
{
@touch($attachmentUploadDir . '/' . $newfilename, filemtime($row['filelocation']));
$rows[] = "$ID_ATTACH, " . filesize($attachmentUploadDir . '/' . $newfilename) . ", '" . addslashes(basename($row['filelocation'])) . "', $row[ID_MSG], 0";
$ID_ATTACH++;
}
---}
SELECT mesid AS ID_MSG, filelocation
FROM {$from_prefix}sb_attachments;
---*

/******************************************************************************/
--- Converting avatars...
/******************************************************************************/

---* {$to_prefix}attachments
---{
$no_add = true;
$keys = array('ID_ATTACH', 'size', 'filename', 'ID_MEMBER');

$newfilename = 'avatar_' . $row['ID_MEMBER'] . strrchr($row['filename'], '.');
if (strlen($newfilename) <= 255 && copy($_POST['path_from'] . '/components/com_simpleboard/avatars/, $attachmentUploadDir . '/' . $newfilename))
{
$rows[] = "$ID_ATTACH, " . filesize($attachmentUploadDir . '/' . $newfilename) . ", '" . addslashes($newfilename) . "', $row[ID_MEMBER]";
$ID_ATTACH++;
}
---}
SELECT userid AS ID_MEMBER, avatar AS filename
FROM {$from_prefix}sb_users
WHERE avatar != ''
AND LOCATE('/', avatar) = 0;
---*


warrdesign


Got this error

It copied everything except the messages

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 'SUBSTRING(m.subject, 1, 255), ID_MEMBER, posterName, posterEmail, posterIP, ID_B' at line 2

dogood

well, kirby, this was the smoothest conversion I had ever!!

Congratulations, and thanks for your work, great!!

I'm running a fresh Joomla 1.0.11 and smf 1.1.1 install, few members and posts, and everything is now in smf, just like I thought It had to be!

Bravo et Bonne Année from France!!

:D
Dogood, singer/writer/linuxian of Godon, free french rock band.

My works on <internet>:

http://www.godon.org => Freedom in Music
http://www.charte-zone-libre.org => La Voie Est Libre!
http://www.godon.org/wiki => UnisSon, wiki for free live music!!

T-Spark

I have problems converting Joomlaboard 1.3 to SMF 1.1.1. I'm using conversion script for Simpleboard forum from SMF downloads.

Members were converted OK, but categories failed:

Converting categories... Unsuccessful!
This query:

    INSERT INTO `alfaklubasnew`.smf_categories
    (ID_CAT, name, catOrder)
    VALUES ('502', 'Perku - parduodu', '1'),
    ('510', 'Konsultacijos', '2'),
    ('506', 'Meetai, renginiai, ?vairenyb?s', '3'),
    ('508', 'International Alfisti', '5'),
    ('509', 'Auto sportas', '6'),
    ('503', 'Blevyzgos apie bet ka', '7'),
    ('505', 'Admino kampelis', '8'),
    ('513', 'Klubo kampelis', '4');

Caused the error:

    Duplicate entry '255' for key 1


Any idea? It seams I'm the first having problems with categories after searching this forum. I have deleted smf_categories entry from DB and ran the script again, but the problem remains.

Has somebody produced a working script for Joomlaboard -> SMF ?

babylon

well ive tried every sql file available and best results came from the posted script :

but a few things are not right...
everything shows except...the replies on a topic....
they say all   0

Any help on this ?

/* ATTENTION: You don't need to run or use this file!  The convert.php script does everything for you! */

/******************************************************************************/
---~ name: "Simpleboard 1.0 and 1.1"
/******************************************************************************/
---~ version: "SMF 1.1"
---~ settings: "/configuration.php", "../../configuration.php", "../../../configuration.php"
---~ from_prefix: "`$mosConfig_db`.$mosConfig_dbprefix"
---~ table_test: "{$from_prefix}users"

/******************************************************************************/
--- Converting members...
/******************************************************************************/

TRUNCATE {$to_prefix}members;

---* {$to_prefix}members
SELECT
/* // !!! We could use m.name for the realName? */
m.id AS ID_MEMBER, SUBSTRING(m.username, 1, 80) AS memberName,
SUBSTRING(m.username, 1, 255) AS realName,
SUBSTRING(sb.signature, 1, 65534) AS signature, sb.posts,
sb.karma AS karmaGood, SUBSTRING(m.password, 1, 64) AS passwd,
SUBSTRING(m.email, 1, 255) AS emailAddress,
SUBSTRING(cd.country, 1, 255) AS location,
IF(m.activation = 1, 0, 1) AS is_activated,
UNIX_TIMESTAMP(m.registerDate) AS dateRegistered,
UNIX_TIMESTAMP(m.lastvisitDate) AS lastLogin,
IF(cd.params LIKE '%email=0%', 1, 0) AS hideEmail,
IF(m.usertype = 'superadministrator' OR m.usertype = 'administrator', 1, 0) AS ID_GROUP,
'' AS lngfile, '' AS buddy_list, '' AS pm_ignore_list, '' AS messageLabels,
'' AS personalText, '' AS websiteTitle, '' AS websiteUrl, '' AS ICQ,
'' AS AIM, '' AS YIM, '' AS MSN, '' AS timeFormat, '' AS avatar,
'' AS usertitle, '' AS memberIP, '' AS secretQuestion, '' AS secretAnswer,
'' AS validation_code, '' AS additionalGroups, '' AS smileySet,
'' AS passwordSalt, '' AS memberIP2
FROM {$from_prefix}users AS m
LEFT JOIN {$from_prefix}sb_users AS sb ON (sb.userid = m.id)
LEFT JOIN {$from_prefix}contact_details AS cd ON (cd.user_id = m.id);
---*

/******************************************************************************/
--- Converting categories...
/******************************************************************************/

TRUNCATE {$to_prefix}categories;

---* {$to_prefix}categories
SELECT id AS ID_CAT, SUBSTRING(name, 1, 255) AS name, ordering AS catOrder
FROM {$from_prefix}sb_categories
WHERE parent = 0;
---*

/******************************************************************************/
--- Converting boards...
/******************************************************************************/

TRUNCATE {$to_prefix}boards;

DELETE FROM {$to_prefix}board_permissions
WHERE ID_BOARD != 0;

---* {$to_prefix}boards
SELECT
id AS ID_BOARD, parent AS ID_CAT, ordering AS boardOrder,
SUBSTRING(name, 1, 255) AS name,
SUBSTRING(description, 1, 65534) AS description, '-1,0' AS memberGroups
FROM {$from_prefix}sb_categories
WHERE parent != 0;
---*

/******************************************************************************/
--- Converting topics...
/******************************************************************************/

TRUNCATE {$to_prefix}topics;
TRUNCATE {$to_prefix}log_topics;
TRUNCATE {$to_prefix}log_boards;
TRUNCATE {$to_prefix}log_mark_read;

---* {$to_prefix}topics
SELECT
t.id AS ID_TOPIC, t.catid AS ID_BOARD, t.ordering AS isSticky, t.locked,
t.hits AS numViews, t.userid AS ID_MEMBER_STARTED,
MIN(m.id) AS ID_FIRST_MSG, MAX(m.id) AS ID_LAST_MSG
FROM ({$from_prefix}sb_messages AS t, {$from_prefix}sb_messages AS m)
WHERE t.parent = 0
AND m.thread = t.id
GROUP BY t.id
HAVING ID_FIRST_MSG != 0
AND ID_LAST_MSG != 0;
---*

---* {$to_prefix}topics (update ID_TOPIC)
SELECT t.ID_TOPIC, m.userid AS ID_MEMBER_UPDATED
FROM ({$to_prefix}topics AS t, {$from_prefix}sb_messages AS m)
WHERE m.thread = t.ID_LAST_MSG;
---*

/******************************************************************************/
--- Converting posts (this may take some time)...
/******************************************************************************/

TRUNCATE {$to_prefix}messages;
TRUNCATE {$to_prefix}attachments;

---* {$to_prefix}messages 200
---{
$row['body'] = preg_replace('~[file name=.+?]http.+?[/file]~i', '', $row['body']);
$row['body'] = preg_replace('~\[img size=(\d+)\]~i', '[img width=$1]', $row['body']);
---}
SELECT
m.id AS ID_MSG, m.thread AS ID_TOPIC, m.time AS posterTime,
SUBSTRING(m.subject, 1, 255) AS subject, m.userid AS ID_MEMBER,
SUBSTRING(m.name, 1, 255) AS posterName,
SUBSTRING(m.email, 1, 255) AS posterEmail,
SUBSTRING(m.ip, 1, 255) AS posterIP, m.catid AS ID_BOARD,
SUBSTRING(mt.message, 1, 65534) AS body, '' AS modifiedName, 'xx' AS icon
FROM ({$from_prefix}sb_messages AS m, {$from_prefix}sb_messages_text AS mt)
WHERE mt.mesid = m.id;
---*

/******************************************************************************/
--- Converting topic notifications...
/******************************************************************************/

TRUNCATE {$to_prefix}log_notify;

---* {$to_prefix}log_notify
SELECT DISTINCTROW userid AS ID_MEMBER, thread AS ID_TOPIC
FROM {$from_prefix}sb_subscriptions;
---*

/******************************************************************************/
--- Converting moderators...
/******************************************************************************/

TRUNCATE {$to_prefix}moderators;

---* {$to_prefix}moderators
SELECT catid AS ID_BOARD, userid AS ID_MEMBER
FROM {$from_prefix}sb_moderation;
---*

/******************************************************************************/
--- Clearing unused tables...
/******************************************************************************/

TRUNCATE {$to_prefix}personal_messages;
TRUNCATE {$to_prefix}pm_recipients;
TRUNCATE {$to_prefix}polls;
TRUNCATE {$to_prefix}poll_choices;
TRUNCATE {$to_prefix}log_polls;

/******************************************************************************/
--- Converting smileys...
/******************************************************************************/

UPDATE {$to_prefix}smileys
SET hidden = 1;

---{
$specificSmileys = array(
':cool:' => 'cool',
':(' => 'sad',
':confused:' => 'huh',
':mad:' => 'angry',
':rolleyes:' => 'rolleyes',
':eek:' => 'shocked',
':p' => 'tongue',
':redface:' => 'embarassed',
':wink:' => 'wink',
':biggrin:' => 'grin',
':smilie:' => 'smiley',
);

$request = convert_query("
SELECT MAX(smileyOrder)
FROM {$to_prefix}smileys");
list ($count) = mysql_fetch_row($request);
mysql_free_result($request);

$request = convert_query("
SELECT code
FROM {$to_prefix}smileys");
$currentCodes = array();
while ($row = mysql_fetch_assoc($request))
$currentCodes[] = $row['code'];
mysql_free_result($request);

$rows = array();
foreach ($specificSmileys as $code => $name)
{
if (in_array($code, $currentCodes))
continue;

$count++;
$rows[] = "'$code', '{$name}.gif', '$name', $count";
}

if (!empty($rows))
convert_query("
REPLACE INTO {$to_prefix}smileys
(code, filename, description, smileyOrder)
VALUES (" . implode("),
(", $rows) . ")");
---}

ALTER TABLE {$to_prefix}smileys
ORDER BY LENGTH(code) DESC;

/******************************************************************************/
--- Converting attachments...
/******************************************************************************/

---* {$to_prefix}attachments
---{
$no_add = true;
$keys = array('ID_ATTACH', 'size', 'filename', 'ID_MSG', 'downloads');

$newfilename = getAttachmentFilename(basename($row['filelocation']), $ID_ATTACH);
if (strlen($newfilename) <= 255 && copy($row['filelocation'], $attachmentUploadDir . '/' . $newfilename))
{
@touch($attachmentUploadDir . '/' . $newfilename, filemtime($row['filelocation']));
$rows[] = "$ID_ATTACH, " . filesize($attachmentUploadDir . '/' . $newfilename) . ", '" . addslashes(basename($row['filelocation'])) . "', $row[ID_MSG], 0";
$ID_ATTACH++;
}
---}
SELECT mesid AS ID_MSG, filelocation
FROM {$from_prefix}sb_attachments;
---*

/******************************************************************************/
--- Converting avatars...
/******************************************************************************/

---* {$to_prefix}attachments
---{
$no_add = true;
$keys = array('ID_ATTACH', 'size', 'filename', 'ID_MEMBER');

$newfilename = 'avatar_' . $row['ID_MEMBER'] . strrchr($row['filename'], '.');
if (strlen($newfilename) <= 255 && copy($_POST['path_from'] . '/components/com_simpleboard/avatars/, $attachmentUploadDir . '/' . $newfilename))
{
$rows[] = "$ID_ATTACH, " . filesize($attachmentUploadDir . '/' . $newfilename) . ", '" . addslashes($newfilename) . "', $row[ID_MEMBER]";
$ID_ATTACH++;
}
---}
SELECT userid AS ID_MEMBER, avatar AS filename
FROM {$from_prefix}sb_users
WHERE avatar != ''
AND LOCATE('/', avatar) = 0;
---*
[code]

[/code]

JayBachatero

Follow me on Twitter

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

lugovsa

Apologizings in advance if smth's stupid - I am a complete newbie in SMF and even "newbier" (C) in SQL.

I tried to convert joomlaboard1.1.15 --> SMF1.1.2 using smf_1-1-2_simpleboard_converter. There were some minor problems which I solved by myself, but then I got stuck with the conversion of the posts. All looks like in the posts above:
QuoteYou have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SUBSTRING(m.subject, 1, 255), ID_MEMBER, posterName, posterEmail, posterIP, ID_B' at line 2
I did what sdubs proposed that is changed a line in the SQL file as follows:

QuoteSUBSTRING(m.subject, 1, 255) AS subject, m.userid AS ID_MEMBER,
.

After it what I receive is:
QuoteConverting...
Converting posts (this may take some time)... Unsuccessful!
This query:
SELECT
m.id AS ID_MSG, m.thread AS ID_TOPIC, m.time AS posterTime,
SUBSTRING(m.subject, 1, 255), AS subject m.userid AS ID_MEMBER,
SUBSTRING(m.name, 1, 255) AS posterName,
SUBSTRING(m.email, 1, 255) AS posterEmail,
SUBSTRING(m.ip, 1, 255) AS posterIP, m.catid AS ID_BOARD,
SUBSTRING(mt.message, 1, 65534) AS body, '' AS modifiedName, 'xx' AS icon
FROM (`MYBASE`.jos_sb_messages AS m, `MYBASE`.jos_sb_messages_text AS mt)
WHERE mt.mesid = hxxp:m.id [nonactive]
LIMIT 0, 200;
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 'AS subject m.userid AS ID_MEMBER,
SUBSTRING(m.name, 1, 255) A
I tried some silly tricks with these lines, but as I am too far from being a SQL-man, I couldn't cope with this.

Can I get some help please?

sdubs

Hi,

I found the problem here
QuoteSUBSTRING(m.subject, 1, 255),AS subject"no ,"m.userid AS ID_MEMBER,

juste change the position of the comma like this :
QuoteSUBSTRING(m.subject, 1, 255)AS subject,m.userid AS ID_MEMBER,

It will be better

arvi pô

lugovsa

Yes!!! It works.
Lots of thanks! Muito obrigado!!

Advertisement: