• Welcome to Simple Machines Community Forum. Please login or sign up.
November 28, 2021, 03:07:19 PM

News:

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


[WIP - Converter] IPB 3.2/3.3/3.4

Started by emanuele, May 17, 2012, 03:44:15 PM

Previous topic - Next topic

emanuele

July 01, 2012, 07:17:09 AM #80 Last Edit: July 02, 2012, 07:36:44 AM by emanuele
Try the attached file, you need convert.php to run it (it works like a converter) and it should only fix the smiley.


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.

Adrek

thanks for fix, now I have another error...
Quote
Converting members... Successful.
Converting categories... Successful.
Converting boards... Successful.
Converting topics...Duplicate entry '644' for key 'PRIMARY'

I changed:
---* {$to_prefix}topics 20
to
---* {$to_prefix}topics 1

but no difference :|
Polskie wsparcie SMF na simplemachines.org

the simplest solution is most likely the right one

Adrek

There must be some error in IPB db, now works perfectly :D
Polskie wsparcie SMF na simplemachines.org

the simplest solution is most likely the right one

emanuele

Ohh...well I've seen some random things with the converted...lol

Regarding the chars encoding I can't do much because the backup you sent me last time doesn't have the chars properly encoded, for example:
'You''re almost there!', 'Już prawie!',
so it wouldn't be a meaningful test.
If you can obtain a properly encoded backup I'd be happy to test it. ;D


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.

Adrek

This is how IPB works :) I cant get proper characters in any format... :|
to fix it I have to run this:


UPDATE `smf_messages` SET body = replace(`body`, 'Ä...','ą');
UPDATE `smf_messages` SET body = replace(`body`, 'ć','ć');
UPDATE `smf_messages` SET body = replace(`body`, 'Ä™','ę');
UPDATE `smf_messages` SET body = replace(`body`, 'ó','ó');
UPDATE `smf_messages` SET body = replace(`body`, 'Å,','ł');
UPDATE `smf_messages` SET body = replace(`body`, 'Å,,','ń');
UPDATE `smf_messages` SET body = replace(`body`, 'Å›','ś');
UPDATE `smf_messages` SET body = replace(`body`, 'ź','ź');
UPDATE `smf_messages` SET body = replace(`body`, 'ż','ż');

UPDATE `smf_messages` SET body = replace(`body`, 'Ä,,','Ą');
UPDATE `smf_messages` SET body = replace(`body`, 'Ć','Ć');
UPDATE `smf_messages` SET body = replace(`body`, 'A,','Ę');
UPDATE `smf_messages` SET body = replace(`body`, 'Ã"','Ó');
UPDATE `smf_messages` SET body = replace(`body`, 'Ł','Ł');
UPDATE `smf_messages` SET body = replace(`body`, 'Ń','Ń');
UPDATE `smf_messages` SET body = replace(`body`, 'Åš','Ś');
UPDATE `smf_messages` SET body = replace(`body`, 'Ź','Ź');
UPDATE `smf_messages` SET body = replace(`body`, 'Å»','Ż');

Polskie wsparcie SMF na simplemachines.org

the simplest solution is most likely the right one

Luc-i

Hi,

i got IPB 3.2.3
and tried the converter.

i got following ERROR:

Fatal error: Call to undefined function getAttachmentFilename() in /www/***/convert.php(1251) : eval()'d code on line 18

Anyone know how to fix it ? thank you!

Adrek

Polskie wsparcie SMF na simplemachines.org

the simplest solution is most likely the right one

Luc-i

Quote from: phantomm on July 02, 2012, 07:12:07 AM
@Luc-i, http://www.simplemachines.org/community/index.php?topic=477019.msg3339519#msg3339519 :)

Thanks, that works.

But now i get instead of "ä,ü,ö,ß, etc" just things like "ü"

Anyone know how to fix it?

Thanks, my english isnt the best, sorry :)

emanuele

July 02, 2012, 07:36:23 AM #88 Last Edit: February 15, 2013, 10:17:38 AM by emanuele
Please find attached another version of the converter.

Fixes:
1) (really) added the smiley conversion code
2) recount of members' posts

Regarding the characters: what encoding are you using for SMF? (also what languages are you using)
And what encoding do you select in the dropdown of the converter?


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.

Adrek

Well,  I have the same problem with Polish characters.
Only thing that I can sugegst for you is to find out how in database is saved every character and replace it with SQL query.

If  "ä" is saved as "ü" you have to run something like this:
UPDATE `smf_messages` SET body = replace(`body`, 'ü','ä');

And the same thing for other characters. Here you have few tips http://webdesign.about.com/od/localization/l/blhtmlcodes-de.htm
Replace all characters to "Numerical Code", and if yo uwant later use in SMF UTF8 encoding, then just use Convert the database and data to UTF-8 in Administration Center » Forum Maintenance » Database

Hope you understand :E
Polskie wsparcie SMF na simplemachines.org

the simplest solution is most likely the right one

strom73

Hey,

I ran the command in the SQL query in my PhpMyAdmin. It says it changed something, but when I look at the posts, the missing characters are still there?

I'm using the Estonian language (we have Ä-s here too) and this is the command I ran:

UPDATE `smf_messages` SET body = replace(`body`, '?¤','ä');

.Vapor


.Vapor

Error -

Converting members... Unsuccessful!
This query:

    SELECT
    m.member_id AS id_member, SUBSTRING(m.name, 1, 80) AS member_name,
    SUBSTRING(m.members_display_name, 1, 255) AS real_name, m.email AS email_address,
    SUBSTRING(m.members_pass_hash, 1, 64) AS passwd, SUBSTRING(m.members_pass_salt, 1, 8) AS password_salt,
    m.title AS usertitle, m.last_visit AS last_login,
    m.joined AS date_registered, SUBSTRING(pc.field_3, 1, 255) AS website_url,
    SUBSTRING(pc.field_3, 1, 255) AS website_title,
    SUBSTRING(pc.field_4, 1, 255) AS icq, SUBSTRING(pc.field_1, 1, 16) AS aim,
    SUBSTRING(pc.field_8, 1, 32) AS yim, SUBSTRING(pc.field_2, 1, 255) AS msn,
    SUBSTRING(pp.signature, 1, 65534) AS signature, m.ip_address AS member_ip, m.ip_address AS member_ip2, '0' AS total_time_logged_in,
    IF (m.bday_year IS NULL, '0001-01-01', IF (m.bday_year = 0 AND m.bday_month != 0 AND m.bday_day != 0, CONCAT('0004-', m.bday_month, '-', m.bday_day), CONCAT_WS('-', IF(m.bday_year <= 4, '0001', m.bday_year), IF(m.bday_month = 0, '01', IF(m.bday_month < 10, CONCAT('0', m.bday_month), m.bday_month)), IF(m.bday_day = 0, '01', IF(m.bday_day < 10, CONCAT('0', m.bday_day), m.bday_day))))) AS birthdate,
    CASE
    WHEN (m.member_group_id = '4') THEN 1
    WHEN (m.member_group_id = '2') THEN -1
    WHEN (m.member_group_id = '6') THEN 2
    ELSE 0
    END AS id_group,
    CASE
    WHEN (pc.field_5 = 'm') THEN 1
    WHEN (pc.field_5 = 'f') THEN 2
    ELSE 0
    END AS gender
    FROM `versa33_fodipb334`.ipb_members AS m
    LEFT JOIN `xxxxxxxxx`.ipb_pfields_content AS pc ON (pc.member_id = m.member_id)
    LEFT JOIN `xxxxxxxxx`.ipb_profile_portal AS pp ON (pp.pp_member_id = m.member_id)
    LIMIT 0, 500;

Caused the error:

    Unknown column 'pc.field_1' in 'field list'
[\code]

emanuele



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.

.Vapor


pzoido

Converting members... Successful.
Converting categories... Successful.
Converting boards... Successful.
Converting topics... Successful.
Converting posts (this may take some time)... Successful.
Recounting post counts...


And i tried this:

Quote from: emanuele on June 27, 2012, 01:23:13 PM
Okay, I think I forgot to update the original package...
Can you try the instructions present in this post:
http://www.simplemachines.org/community/index.php?topic=477019.msg3349839#msg3349839
and see if it works?

If so I'll update the script.

No success =/

My ipb-Version ist 3.2.3

emanuele

That's a really weird error, I can't understand where it comes from... :(

I just repeated a conversion of an old database I found around and it went all good, no errors.
It could be a problem with a query, but no idea which problem. ::)


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.

Miigli


Converting posts (this may take some time)...
Successful.
Recounting post counts... Successful.
Converting polls... Successful.
Converting poll options... Successful.
Converting poll votes... Successful.
Converting personal messages (step 1)...
Fatal error: Wrong value type sent to the database. Integer expected. (id_pm)(convert.php-2636) in /home/u9747/public_html/c/Sources/Subs-Db-mysql.php on line 684


How can i pass this one ?

Ventic

Notice: Undefined index: convert_script in C:\xampp\htdocs\forum\convert.php on line 969

Warning: Invalid argument supplied for foreach() in C:\xampp\htdocs\forum\convert.php on line 972

Notice: Undefined index: convert_script in C:\xampp\htdocs\forum\convert.php on line 984

Warning: file(C:\xampp\htdocs\forum/) [function.file]: failed to open stream: No such file or directory in C:\xampp\htdocs\forum\convert.php on line 984

Warning: Invalid argument supplied for foreach() in C:\xampp\htdocs\forum\convert.php on line 996
Successful.
Recalculating forum statistics...
Notice: Undefined variable: result in C:\xampp\htdocs\forum\convert.php on line 2491

Notice: Undefined variable: result in C:\xampp\htdocs\forum\convert.php on line 2492

Notice: Undefined index: db_fetch_assoc in C:\xampp\htdocs\forum\convert.php on line 1383

Fatal error: Function name must be a string in C:\xampp\htdocs\forum\convert.php on line 1383


error -.-

emanuele

Hello Miigli and welcome to sm.org! :)

Quote from: Miigli on September 22, 2012, 09:20:32 AM

Converting posts (this may take some time)...
Successful.
Recounting post counts... Successful.
Converting polls... Successful.
Converting poll options... Successful.
Converting poll votes... Successful.
Converting personal messages (step 1)...
Fatal error: Wrong value type sent to the database. Integer expected. (id_pm)(convert.php-2636) in /home/u9747/public_html/c/Sources/Subs-Db-mysql.php on line 684


How can i pass this one ?
mmm...good question.
Some issue with the id of the PMs...though I'm not sure what the issue is, let's try a workaround, in ipb3_to_smf.sql, find this:
Code (find) Select
WHERE mt.mt_is_draft = 0;
and replace it with:
Code (replace with) Select
WHERE mt.mt_is_draft = 0
AND pm.msg_id REGEXP '^[0-9]+$'
AND pm.msg_id > 0;

then, find:
Code (find) Select
WHERE mt.mt_is_draft != 1;
and replace with:
Code (replace with) Select
WHERE mt.mt_is_draft = 0
AND pm.msg_id REGEXP '^[0-9]+$'
AND pm.msg_id > 0;

not sure if it will work, but worth a try...

@Ventic: are you sure you put both the convert.php and the ipb3_to_smf.sql files in the same directory?


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.

Advertisement: