Simpleboard to SMF 1.0.x Conversion Script

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

Previous topic - Next topic

Kirby

Because the other topic got kind of messy, I decided to make a new topic for this.
The following SMF 1.0.x style conversion script will convert you from a Mambo + Simpleboard installation (this script will also convert attachments). Install SMF first, upload it to your SMF directory, then run the script and provide it with the proper settings.

Please report any bugs or share experiences here.

RSM

#1
G'day Kirby ...

I get these two problems (apart from a stats conversion one);

Converting members...
Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /var/www/html/forum/simpleboard_to_smf.php on line 291

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /var/www/html/forum/simpleboard_to_smf.php on line 301

Would appreciate any input. The users are not ported over.

Sorry; should have mentioned: Joomla 1.0.3 and Simpleboard/Joomlaboard 1.1. SMF 1.1RC1.




Kirby

#2
Hi, this isn't working because of Joomla vs. Mambo issues. Please try the attached.

chisler

#3
Hi Kirby,

I tried running your attachment and got the following (Joomlaboard 1.1.1 and SMF 1.1 RC1):

QuoteConverting...
Converting members...
Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /home/gook/public_html/forums/jsimpleboard_to_smf.php on line 291

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/gook/public_html/forums/jsimpleboard_to_smf.php on line 301
successful.
Converting categories... successful.
Converting boards... successful.
Converting topics... successful.
Converting messages... (this may take some time) successful.
Converting topic notifications... successful.
Converting board access... successful.
Converting smileys... successful.
Converting attachments...
Warning: copy(/home/gook/public_html/components/com_joomlaboard/uploaded/files/Inferno.gaming_vs_Gook_avalanche_allies.jpg) [function.copy]: failed to open stream: No such file or directory in /home/gook/public_html/forums/jsimpleboard_to_smf.php on line 1096
Error: Could not copy Inferno.gaming_vs_Gook_avalanche_allies.jpg

Warning: copy(/home/gook/public_html/components/com_joomlaboard/uploaded/images/screenshots.zip) [function.copy]: failed to open stream: No such file or directory in /home/gook/public_html/forums/jsimpleboard_to_smf.php on line 1096
Error: Could not copy hxxp:screenshots.zip [nonactive]
successful.
Recalculating forum statistics...
Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /home/gook/public_html/forums/jsimpleboard_to_smf.php on line 1201

Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in /home/gook/public_html/forums/jsimpleboard_to_smf.php on line 1206
successful.

No users are copied to SMF but the forums/messages are OK (without attachments)

Thanks
Chisler

kcdude

#4
I ran the jsimpleboard_to_smf.php on my Joomla 1.0.3 / Joomlaboard 1.1 and SMF 1.1RC1 installation.  I received similar errors.  My SMF members table was empty after this.  It looks like the forum messages are in the SMF tables.  How can I fix the script?


Converting members...
Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /www/a/ahlersnet/ratsnest/htdocs/smf/jsimpleboard_to_smf.php on line 581

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /www/a/ahlersnet/ratsnest/htdocs/smf/jsimpleboard_to_smf.php on line 601
successful.
Converting categories... successful.
Converting boards... successful.
Converting topics... successful.
Converting messages... (this may take some time) successful.
Converting topic notifications... successful.
Converting board access... successful.
Converting smileys... successful.
Converting attachments...
Warning: copy(/www/a/ahlersnet/ratsnest/htdocs/components/com_simpleboard/uploaded/images/26272.jpg): failed to open stream: No such file or directory in /www/a/ahlersnet/ratsnest/htdocs/smf/jsimpleboard_to_smf.php on line 2191
Error: Could not copy 26272.jpg
successful.
Recalculating forum statistics...
Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /www/a/ahlersnet/ratsnest/htdocs/smf/jsimpleboard_to_smf.php on line 2401

Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in /www/a/ahlersnet/ratsnest/htdocs/smf/jsimpleboard_to_smf.php on line 2411
successful.

Kirby

I will investigate this once again, sorry for the inconvinience.

Kirby


kcdude

Hi Kirby,
I used the new script and it looks like the member table got filled.  I'm going to check that things work.  I still got an error in the statistics part, but maybe there's a way to regenerate them manually.  Thanks for your help and the translation script!

(Joomla 1.0.3/Joomlaboard 1.1/SMF 1.1RC1)

Converting members... successful.
Converting categories... successful.
Converting boards... successful.
Converting topics... successful.
Converting messages... (this may take some time) successful.
Converting topic notifications... successful.
Converting board access... successful.
Converting smileys... successful.
Converting attachments...
Error: Could not copy 26272.jpg
successful.
Recalculating forum statistics...
Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /www/a/ahlersnet/ratsnest/htdocs/smf/jsimpleboard_to_smf.php on line 2401

Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in /www/a/ahlersnet/ratsnest/htdocs/smf/jsimpleboard_to_smf.php on line 2411
successful.

Kirby

You can always rebuild the statistics from the admin panel. For attachment stats, go to the Attachments and Avatars area, click File Maintenence, and click Recount. For all other stats, go to the Forum Maintenence area, and click Find and repair any errors followed by Recount all forum totals and statistics. At that point you can also optimize your tables for maximum performance.

chanh

Kirby,

When I tried to convert from Simpleboard 1.1.0stable with Mambo 4.5.2.3 using simpleboard_to_smf.php I got the following message after it finishs the conversion.

Is the error none fatal?  Thanks

Converting...
Converting members... successful.
Converting categories... successful.
Converting boards... successful.
Converting topics... successful.
Converting messages... (this may take some time) successful.
Converting topic notifications... successful.
Converting board access... successful.
Converting smileys... successful.
Converting attachments... successful.
Recalculating forum statistics...
Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /home/opencms/public_html/chanh/mos4522/simpleboard_to_smf.php on line 1201

Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in /home/opencms/public_html/chanh/mos4522/simpleboard_to_smf.php on line 1206
successful.
Conversion Complete
Congratulations, the conversion has completed sucessfully. If you have or had any problems with this converter, or need help using SMF, please feel free to look to us for support.
Now that everything is converted over, your SMF installation should have all the posts, boards, and members from the Mambo - Simpleboard installation.

We hope you had a smooth transition,
Simple Machines

Kirby

The error is not fatal :). You can do what that function is supposed to do through the Maintenence section in your admin panel.

thangcodon

Hello,

I am using the "jsimpleboard_to_smf.php" file, and after I execute the php file in my SMF forums dir, I get this messsage:

"Unable to find the settings for Mambo - Simpleboard. Please double check the path and try again."

However, I specified the right location of the joomlaboard dir, and the SMF.  I tried executing the php file from the joomlaboard dir, root, and SMF forums folder with the same result.  CHMODing didn't help.  Can someone help me out?

-thangcodon

Kirby

Copy over Joomla's configuration.php to SMF's directory. Then run the converter and make both paths SMF's directory.

thangcodon

Quote from: Kirby on February 07, 2006, 12:17:16 AM
Copy over Joomla's configuration.php to SMF's directory. Then run the converter and make both paths SMF's directory.

Thank you Kirby!  This solution worked great!  I'm wondering if this might have been the problem for me when trying to convert phpnuke phpbb straight to SMF.  I used a phpNuke to Joomlaboard script, then I used yours.

-thangcodon

turkbee

#14
ı'recieving error message while i'm trying to convert mambo to smf. error message is below;

Sorry, the database connection information used in the specified installation of SMF cannot access the installation of Mambo - Simpleboard. This may either mean that the installation doesn't exist, or that the MySQL account used does not have permissions to access it.

Path to SMF :   /home/yenisehi/public_html/smf
Path to Mambo - Simpleboard :  /home/yenisehi/public_html/index
SMF Database password: edited out

I uploaded simpleboard_to_smf.php  to   mambo root directory "index"

But i already recieve error message.

Could you please try it for me?

Mambo root:  hxxp:www.yenisehir.com/index [nonactive]
SMF root: hxxp:www.yenisehir.com/smf [nonactive]


Waiting for your reply.


Kirby

Is your Joomla/Mambo database user still there? Are the database settings in the configuration file for Joomla/Mambo correct?

turkbee

My mambo is installed on hxxp:yenisehir.com/index [nonactive] and database is still there. I think there was an error yesterday about mysql but there is no problem now.
I installed smf again and mysql password changed now.

Both mambo and smf paths are as below;
Path to SMF :   /home/yenisehi/public_html/smf
Path to Mambo - Simpleboard :  /home/yenisehi/public_html/index
Password: I sent password by personnal message to you.


and converter's way is hxxp:www.yenisehir.com/index/jsimpleboard_to_smf.php [nonactive]



Kirby

Hi,

Did you try moving configuration.php to the SMF folder and then giving both paths as the SMF folder's path?

turkbee

Yes I moved configuration.php of mambo to SMF folder then I gave both paths as /home/yenisehi/public_html/smf but result is same.

Kirby


turkbee

I can not understand.
I uploaded jsimpleboard_to_smf.php to mambo directory
I moved mambo configuration file to smf directory then chmoded to 777
I gave both path to smf folder's path
I entered smf database password same as in settings.php

But I'm still getting error;
"Sorry, the database connection information used in the specified installation of SMF cannot access the installation of Mambo - Simpleboard....."....

jeff41

#21
I've installed SMF with my Joomla site and I successfully integrated the two and also successfully converted from joomlaboard to smf.

My problem now is my Users Online isn't displaying the members when they logon (USING FIREFOX ONLY) in the forum at the bottom of the page.  It just shows us all as guests.  I ran all the forum maintenance links and everything else is fine.  If you login with Internet Explorer it works.  Can you help me?

Thanks,
Jeff

Kirby

Quote from: jeff41 on February 21, 2006, 01:47:27 AM
I've installed SMF with my Joomla site and I successfully integrated the two and also successfully converted from joomlaboard to smf.

My problem now is my Users Online isn't displaying the members when they logon (USING FIREFOX ONLY) in the forum at the bottom of the page.  It just shows us all as guests.  I ran all the forum maintenance links and everything else is fine.  If you login with Internet Explorer it works.  Can you help me?

Thanks,
Jeff
It could be a theme or mod issue, it shouldnt be a conversion issue.

Quote from: turkbee on February 17, 2006, 12:33:21 AM
I can not understand.
I uploaded jsimpleboard_to_smf.php to mambo directory
I moved mambo configuration file to smf directory then chmoded to 777
I gave both path to smf folder's path
I entered smf database password same as in settings.php

But I'm still getting error;
"Sorry, the database connection information used in the specified installation of SMF cannot access the installation of Mambo - Simpleboard....."....
I do not know what is causing this anymore. Maybe I can take a look.

gsbe

Thanks for posting this jsimpleboard_to_smf.php file. We converted a board with 5 forums, 180 topics and 500 replies. The only errors generated were related to 3 attachments (2 images and one .zip file).

Cheers!

Kirby


Jelte

My members are not converted... Using SMF 1.0.5, Joomla 1.0.6. Is there a way to manually convert the members?

:MrClean:

#26
Quote from: turkbee on February 13, 2006, 05:03:47 AM
ı'recieving error message while i'm trying to convert mambo to smf. error message is below;

Sorry, the database connection information used in the specified installation of SMF cannot access the installation of Mambo - Simpleboard. This may either mean that the installation doesn't exist, or that the MySQL account used does not have permissions to access it.


I'm having the same problem. I think I know why, but I don't know much about programming to fix it.  From browsing through the conversion script I "think" that the script assumes that the same user name and password for SMF can be used on the Joomla database.  This isn't true for me, but it could be an easy fix seeings how the username and password for the Joomla database are in the configuration.php as $mosConfig_user and $mosConfig_password respectively.  It's very likely that I'm wrong, but I thought I would try to help. Hopefully you can give it a shot.. Thanks!

Severe

The script is great and works (all messages and users get imported) but the problem I'm having is that the userrights don't get copied (i.e.: Administrator is just a normal user and cannot do administrative tasks. There is no admin button so to say)

Using: joomla 1.0.8 and SMF 1.1RC2 (copied from joomlaboard 1.1.2)

Thanks for reading

wb

very nice, worked on the first try, thanks a bunch!

Lamer_Astral

Anyone know where I can get my hands on this script? Dowloading the attatchment doesent seams to work :(

darkchild

#30
Many thanks for the wonderful convertor. I have just converted from simpleboard 1.1 to smf. Everything went well except for the users. Is there are another way of importing users from joomla 1.0.8 to smf 1.1RC2 (?

Just in case anyone is interested here is the result that i got:
QuoteConverting...
Converting members... successful.
Converting categories... successful.
Converting boards... successful.
Converting topics... successful.
Converting messages... (this may take some time) successful.
Converting topic notifications... successful.
Converting board access... successful.
Converting smileys... successful.
Converting attachments... successful.
Recalculating forum statistics...
Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /home/zim/public_html/talk/jsimpleboard_to_smf.php on line 1201

Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in /home/zim/public_html/talk/jsimpleboard_to_smf.php on line 1206
successful.

Mavke

I have used the simpleboard_to_smf.php and jsimpleboard_to_smf.php scripts to convert from Simpleboard to SMF but I am stuck at the coversion of the members. I am using Mambo 4.5 (1.0.9) and Simpleboard 1.1.0 to go to SMF 1.1 RC2. All works except the members conversion, so I have all posts, threads, categories but no users on SMF... So it is quite useless. Who can help on this as I have quite an extensive site to convert. ;)

scrax

i can't download the file, when i do it i've a file of 0 bit...

pcjunkie

#33
Forgive me if this is real easy to fix but I keep getting this evry time I try the script.

Using Joomla 1.10 and Joomla board 1.1.2..




Fatal error: Call to undefined function create_button() in D:\Program Files\wamp\www\smf\Sources\Load.php(1040) : eval()'d code on line 238

NM It was the template!

jmedina

I try to run this thing and I get a blank screen. No error no anything I am running it from a firefox browser.

hxxp:www.warzoneministries.com/forum/jsimpleboard_to_smf.php [nonactive]

Any Ideas?

Moonray

#35
If anyone has problems converting simpleboard/ joomlaboard to SMF, contact me by PM.

pcjunkie

#36
I have only Just noticed, but the user name and the display name are back to front.....

IE user registers as

User name John
Display name is Killer

Now I have user name as Killer,
Display Name as John...

In Joomla it's the correct way around, So now that is done with, How do I change that in SMF...

I can't find anywhere in the settings that switches what is displayed......

I can change that in the bridge but it does nothing to what is displayed in SMF post registration...

I can't beleive there is no tab for what gets displayed in Admin....

spiros

I tried it and now not only boards appear as ????? (had a UTF Joomla + Forum) but I also cannot log in. I got this error:

Converting members... Successful.
Converting categories... Successful.
Converting boards... Successful.
Converting topics... Successful.
Converting posts (this may take some time)... Unsuccessful!
This query:

INSERT INTO `free_joomla`.smf_messages
(ID_MSG, ID_TOPIC, posterTime, SUBSTRING(m.subject, 1, 255), ID_MEMBER, posterName, posterEmail, posterIP, ID_BOARD, body, modifiedName, icon)
VALUES ('9', '9', '1138761649', '???????? ??? ?????? ??????? ??????????', '0', 'gademis', '[email protected]', '212.251.110.216', '2', '?????[img width=]???[img width=]????[img width=]?????[img width=]???[img width=]??[img width=]???????[img width=]?????????[img width=]????[img width=]??????[img width=]??[img width=]?????????[img width=]??[img width=]????????;[img width=]??[img width=]?????[img width=]??????????[img width=]?[img width=]?????????[img width=]????[img width=]???[img width=]?????[img width=]?????[img width=]??[img width=]?????[img wid

..........


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

happy_noodle_boy


locutusweb

#39
Got the same error as the messages above, tried the script in this tread and conversion went fine  :D

But where did my administrator go? for mambo and the "test" setup of smf i used the same login and password.....

Edit:

Somehow it works again....

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: