• Welcome to Simple Machines Community Forum. Please login or sign up.
December 02, 2021, 06:56:02 PM

News:

SMF 2.1 RC4 has been released! Try it out and help us test! :) Read more.


[SMF Converter] Fireboard 1.0.x

Started by SleePy, March 17, 2008, 12:28:51 AM

Previous topic - Next topic

shumisha

Hi Sleepy,

I just tried again. I had upgraded my source Joomla site from 1.0.13 to 1.0.15 before this second trial.

+ : I don't get any errors any more during the conversion process
- : I can't login with any of the users converted. User is recognized, but password is invalid
- : quotes are still escaped in posts and title

I'll try have smf send me a new password, that should work, but is not really a good solution ! I'll take a look at the sql for the conversion in that field

Thanks anyway, and best regards

JazzMega

I edit the fireboard_to_smf.sql file at lines 10:

---~ from_prefix: "`$mosConfig_db`.$mosConfig_dbprefix"

I edit:

$mosConfig_db = database name

$mosConfig_dbprefix = prefix(jos_)

And it convert successfully but with some errors:

The passwords dont work
Converting attachments with errors
Converting avatars  with errors.

The attachaments and avatars aren´t very important but the passwords...

Can you help me?

Thanksss!!

SleePy

March 19, 2008, 10:44:01 PM #22 Last Edit: March 19, 2008, 10:45:40 PM by SleePy
shumisha,
Did you apply the password mod fix?

I was able to get joomla 1.5 installed and worked around the password issue on it. It appears to use even a bigger salt.. So I had to expand the SMF salt field again.. I gave it more than enough room for the salt this time.
To convert with joomla 1.5, you will need to create a configuration.php with this:

$mosConfig_db = 'database_name';
$mosConfig_dbprefix = 'prefix_';

And edit those variables to equal your database name and prefix. You can find this information in your joomla admin panel. The way Joomla 1.5 does its configuration file changed so this is the only work around for it at the moment.

Can I have the original contents of one of these posts? Use Fireboard to get these contents. I need to have a test post that these issues are occurring in so I can figure out where it is going wrong.

I thank you guys for the testing these out :) Its hard to get converters to convert everything just right when you have software that does things in their own little ways.
Jeremy D — Site Team / SMF Developer
Support the SMF Support team!
Profiles:GitHub
Join us on IRC Libera.chat/#smf

ChrisFBBS

Quote from: SleePy on March 19, 2008, 10:44:01 PM


I thank you guys for the testing these out :) Its hard to get converters to convert everything just right when you have software that does things in their own little ways.
We appreciate all that you are doing as well!!

This latest file doesn't/can't find my SMF directory now.

This converter was unable to find SMF in the path you specified.

Please double check the path, and that it is already installed there.
www.freeblackberrystuff.com Blackberry neews plus... free blackberry themes free blackberry apps and free blackberry games

SleePy

sheik28,

Are you sure the path to the SMF forum is correct?
Jeremy D — Site Team / SMF Developer
Support the SMF Support team!
Profiles:GitHub
Join us on IRC Libera.chat/#smf

shumisha

Hi Sleepy,

Yes, I did apply the changes in your past post. And I am still on the 1.0.x branch. I upgraded to 1.0.15, not 1.5. Converter don't have any problem finding about the db name and prefix.

RE: passwords no tworking : i looked up the DB content. It seems the transfer is done correctly. For a given user, in jos_users if the password field contains xxxxxxxxxx:yyyyyyyyy, then the smf_members table contains xxxxxxxxx in the password column and yyyyyyyyy in the passwordSalt column. So it seems somehow it is smf that is not happy with these when verifying the password. Does that make sense ?

Re: post content : I have looked that up as well. Here is a sample from an sql dump:

(43, 'Hi Ptx_soccer,\r\n\r\nAre you familiar with phpMyadmin. I\\''d like to check something in your database. Can you give me access, or look yourself ?'),

It seems  in FB database, quotes are double-escaped, which surely prevents your converter to do its job properly. I am going to try simply do a text replace on the db table for now.

Regards

shumisha

Hi,

I was able to go past this single/double quote issue by modifying fireboard_to_smf.sql like so :

/******************************************************************************/
--- 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']);
$row['body'] = str_replace('\\\'', '\'', $row['body']);
$row['subject'] = str_replace('\\\'', '\'', $row['subject']);
$row['body'] = str_replace('\\"', '"', $row['body']);
$row['subject'] = str_replace('\\"', '"', $row['subject']);
---}
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}fb_messages AS m, {$from_prefix}fb_messages_text AS mt)
WHERE mt.mesid = m.id;
---*

I am not sure if this will apply to all fireboards, or if it is specific to FB 1.0.0 that I am using. Does anyone have this quote problem with another version of FB ?

Now I just have the password issue to solve before being able to make the switch !

Regards

shumisha

Hi,

I got it now. I checked the login procedure in Joomla, and it only takes a small change to Sources/LogInOut.php to make it work.

// Maybe they are using a hash from before the password fix.
                $other_passwords[] = md5($_POST['passwrd']);  // Joomla pre-1.0.13 passwords style
                $other_passwords[] = md5($_POST['passwrd'].$user_settings['passwordSalt']); // Joomla 1.0.13 and up (in the 1.0.x branch)

As you can see, J! from 1.0.13 on simply does md5(password+salt);

I was able to login using my J! password as soon as I did that.

Don't know how it can be easily integrated though, this will still require a hack to work !

Regards

shumisha

Hi again,

Last fix : to retain admin or super admin status while converting, fireboard_to_smf.sql should be change as follow (this is line 33) :
from IF(m.usertype = 'superadministrator' OR m.usertype = 'administrator', 1, 0) AS ID_GROUP,
toIF(m.usertype = 'Super Administrator' OR m.usertype = 'Administrator', 1, 0) AS ID_GROUP,
Strange enough, there is a table to define user types, but the jos_users table does not use them for its usertype field. Instead, there is a litteral in that field

Regards

JazzMega

March 20, 2008, 08:03:32 AM #29 Last Edit: March 20, 2008, 08:11:07 AM by JazzMega
Yeaaaah!!!

Its work on joomla 1.5, the passwords and all!! oooooohh!!

Thanks you a lot.... thanks!! gracias tiooo!!


The best community.... SMF

forepro

Hi folks,

I just tried the converter on my host server. Seems like I am getting another problem..

Unable to find the settings for Fireboard 1.0. Please double check the path and try again.


Path to SMF:
/home/myid/domains/mysite.org/public_html/testsite/smf

Path to Fireboard 1.0:
/home/myid/domains/mysite.org/public_html/components/com_fireboard

Pretty strange to me since I can run this conversion on my local server without seeing this error.. Any ideas?

Good Job, guys!


JazzMega

forepro, change:

Path to Fireboard 1.0:
/home/myid/domains/mysite.org/public_html/components/com_fireboard

for:

Path to Fireboard 1.0:
/home/myid/domains/mysite.org/public_html/

forepro

Yes! That did the trick. Thanks a lot JazzMega!  :D

There are still other glitches (like: category arrangement, avatars/attachments not transferred) but I am very happy now.  ;D

Just to post the warning I had:
Quote
Warning: copy(/home/myid/domains/mysite.org/public_html/components/com_fireboard/uploaded/images/Picture1.jpg)

[function.copy]: failed to open stream: No such file or directory in

/home/myid/domains/mysite.org/public_html/testsite/smf/convert.php(1075) : eval()'d code on line 4


As for FB 1.0.4 I think they change the path to
/public_html/images/fbfiles/images/
Just FYI.

The utf-8 conversion was not successful. i couldn't read the posts. But I will looking into another UTF-8 thread and do some research. BTW the single/double quote become \' and \". I can live with that though.

SMF is a great community! Thanks for the support!

forepro

SleePy

March 20, 2008, 05:06:47 PM #33 Last Edit: March 20, 2008, 05:08:20 PM by SleePy
Quote from: shumisha on March 20, 2008, 06:12:59 AM
Hi,

I got it now. I checked the login procedure in Joomla, and it only takes a small change to Sources/LogInOut.php to make it work.

// Maybe they are using a hash from before the password fix.
                $other_passwords[] = md5($_POST['passwrd']);  // Joomla pre-1.0.13 passwords style
                $other_passwords[] = md5($_POST['passwrd'].$user_settings['passwordSalt']); // Joomla 1.0.13 and up (in the 1.0.x branch)

As you can see, J! from 1.0.13 on simply does md5(password+salt);

I was able to login using my J! password as soon as I did that.

Don't know how it can be easily integrated though, this will still require a hack to work !

Regards

yea, but those who have not logged in since the upgrade will need the old login method. I updated the package to include both fixes last night.
Thanks for the post, I was able to get that straighten out and fixed the   issue that was occurring. I will update the main post when forepro tests this converter to see how things go :)

forepro,
Try the attached one. I did the wrong path to avatars.

edit,
As well read this on UTF-8 Conversions http://www.simplemachines.org/community/index.php?topic=140917.0
Jeremy D — Site Team / SMF Developer
Support the SMF Support team!
Profiles:GitHub
Join us on IRC Libera.chat/#smf

shumisha

Hi,

Quoteyea, but those who have not logged in since the upgrade will need the old login method.
Yes, I thought that is taken care of by $other_passwords[] = md5($_POST['passwrd']);  // Joomla pre-1.0.13 passwords style
But actually I think that is not even needed, because in that case, there will be no salt in the Joomla users table, and the LogInOut.php code will be in another branch (there is a test on whether the salt is empty or not). In that other branch, there is already a
$other_passwords[] = md5($_POST['passwrd']);
Untested yet, though

Regards

SleePy

I use both now in the mod package:

        // New Joomla login method?
        $other_passwords[] = md5($_REQUEST['passwrd'] . $user_settings['passwordSalt']);
        // The old Joomla login method?
        $other_passwords[] = md5($_REQUEST['passwrd']);
Jeremy D — Site Team / SMF Developer
Support the SMF Support team!
Profiles:GitHub
Join us on IRC Libera.chat/#smf

ChrisFBBS

I am obviously missing something so just to confirm the steps that are needed to do this.
1. Upload convert.php, fireboard to smf file  and configuration.php (Joomla 1.5 users only need configuration.php) to your SMF directory.
2. Run convert.php.
That is all that is needed to get convert to work correct?
www.freeblackberrystuff.com Blackberry neews plus... free blackberry themes free blackberry apps and free blackberry games

SleePy

March 21, 2008, 12:23:11 AM #37 Last Edit: March 21, 2008, 12:31:53 AM by SleePy
make sure the configuration file has the database and database prefix correctly in it.

Edit,
Actually. This would work as well. Using your joomla 1.5 configuration.php. Open the file up. Just after the <?php add a return then these lines of code:

$config = new JConfig();
$mosConfig_db = $config->db;
$mosConfig_dbprefix = $config->dbprefix;


That will have it emulate the old joomla settings that the converter script needs.
Jeremy D — Site Team / SMF Developer
Support the SMF Support team!
Profiles:GitHub
Join us on IRC Libera.chat/#smf

ChrisFBBS

Still get this error
Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /homepages/10/d116192141/htdocs/fbb/f/convert.php on line 780

Notice: Undefined property: db186974532 in /homepages/10/d116192141/htdocs/fbb/configuration.php on line 3

Notice: Undefined property: jos_ in /homepages/10/d116192141/htdocs/fbb/configuration.php on line 4
No Database Selected


www.freeblackberrystuff.com Blackberry neews plus... free blackberry themes free blackberry apps and free blackberry games

forepro

Hello folks,

Many thanks to your help. Now things are almost there.

I followed the flow of this is the post except that I used the convert.php of this FB thread rather than UTF-8 Converter
http://www.simplemachines.org/community/index.php?topic=140917.msg1348511#msg1348511

Here is what I did,

1. fresh install SMF with default settings (Do not select UTF-8 on the install page)

2. use covert.php for FB and latest fireboard_to_smf.sql from SleePY to convert FB 1.0.4 to SMF 1.1.4. use default option: Set SMF's default character set to ISO 8859-1)

3. After this conversion, all my Chinese topics and messages became alien language but I can fix them by switching the character encoding of browser from Western(ISO 8859-1) to Unicode(UTF-8).

4. Downloaded SMF Chinese language pack UTF-8, uploaded it to the server, and set it as default through admin -> "server setting".

Up to this point, I was able to read all Chinese posts without any issues on two testing servers. But on one of them I observed that the search results by using Chinese was very poor. I tried to search certain Chinese keywords, and I can see many articles containing those keywords have escaped from search.

5. Therefore, I went to "Forum Maintenance" -> "Convert the database and data to UTF-8", use default settings to run the conversion. After that, the search results of the poor one improves dramatically! I couldn't be happier.  :D

My system info:
Joomla 1.0.12
FB 1.0.4 (upgraded from 1.0.1)
MySQL 5.0.41
PHP 4.4.8

Hope this would help some others who also have the same problems.

The only issue left is that: attachments(both img and file) and avatars are not transferred. No error messages for avatars but for attachments:

Warning: copy(/home/mysite.org/public_html/components/com_fireboard/uploaded/images/Picture1.jpg) [function.copy]: failed

to open stream: No such file or directory in /home/mysite.org/public_html/smf/convert.php(1075) : eval()'d code on line 4

Warning: copy(/home/mysite.org/public_html/components/com_fireboard/uploaded/files/Notes.pdf) [function.copy]: failed to

open stream: No such file or directory in /home/mysite.org/public_html/smf/convert.php(1075) : eval()'d code on line 4

Warning: copy(/home/mysite.org/public_html/images/fbfiles/files/Muss.jpg) [function.copy]: failed to open stream: No such

file or directory in /home/mysite.org/public_html/smf/convert.php (1075) : eval()'d code on line 4



For those files, although it seems like they should be placed in components/com_fireboard/_fbfiles_dist/avatars, or files, or images.
But I can see in FB 1.0.4 the actual avatars user uploaded are stored in joomla image folder: public_html/images/fbfiles/avatars/
and same as attachments -> public_html/images/fbfiles/files or images

Hope this helps!

cheers,
forepro

Advertisement: