News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

upgrade from 1 something to 2.0.11 hebrew

Started by guyc, January 07, 2016, 06:56:39 AM

Previous topic - Next topic

guyc

We're trying to upgrade the forum, the upgrade succeed however the hebrew fonts on the forums names and all the topics have turned into question marks. Some hebrew is seen like usernames (some of them) and threads content and we can manaly recreate the forums names but the threads topic are not possible to replace.

We need a solution to this.

Please advise.

Kindred

Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

guyc


margarett

Were you using the UTF8 language pack? If so, you need to load the equivalent for 2.0.x ;)
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

guyc

yes, we were using hebrew-utf8 and we've updated the fonts package also.

The problem is that inside the database the fonts trun to question marks.

margarett

Do you have a backup of the 1.1.x database? If so you should restore your 1.1.x forum and try the conversion again (in a test forum). The upgrade tool is not supposed to mess with the database content so I have no idea why that happened to you :(
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

guyc

Yeah, I tried that like 3 times. One of the times I changed the database tables charset to utf8 from latin1, before running the upgrade, but no help there.
at the moment we are back to 1.1.x but we'd realy like to be able to upgrade, specialy becuase our host upgraded to php5.5 and we get error deprecated on preg that prevent the forum to load. For some reason the forum is loading now 1.1.x I don't know how, maybe the host downgraded php, didn't check.

margarett

At this point I can only offer to look at it for you. If you provide me access to your cPanel (or other control panel you might be using) I can try to check it for you...
(basically duplicating your forum and working in that duplicate)
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

guyc


margarett

Thank you for the data. I tested in my computer and (surprisingly) I got your same result. Posts body, members signature, etc, are converted correctly. Posts subject, boards name and member names, are messed. Dang :o

I'll investigate further, but I don't have an immediate solution for you.
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

margarett

So, I was able to understand and fix the issue ;)

What happens is that, despite your text COLUMNS have "utf8_general_ci" collation, most TABLES had their default collation to "latin1_swedish_ci".
In certain steps of the upgrade tool, columns are changed for several reasons. Eg:
'boards' => array(
'name' => 'name name varchar(255) NOT NULL default \'\'',

What happens is that the upgrade doesn't specify the collation in the query (as it is supposed to match the table) so MySQL applies the the table default collation, thus changing not only the desired value (in this case, tinytext to varchar(255) but also the collation, messing your UTF8 characters along the way...

What I did was to get and adapt a small script which you should run *before* the upgrade and that will change your tables default collation to "utf8_general_ci".
This was the outcome in my localhost


This is the script, make sure you adapt the values to your database ;)
<?php

// Make sure you set proper login credentials!
// Syntax is: mysqli_connect('server_name','db_user','db_user_password');
$db mysqli_connect('localhost','root','');
if(!
$db// Failed? Bummer...
{
echo "Cannot connect to the database - incorrect details";
die;
}
// Make sure you define the database name (replace "smf" with your DB)
mysqli_select_db($db'smf');
$result mysqli_query($db'show tables');
$counter 0;
while(
$tables mysqli_fetch_array($result))
{
foreach ($tables as $key => $value)
{
mysqli_query($db"ALTER TABLE $value COLLATE utf8_general_ci");
$counter++;
}
}
mysqli_free_result($result);

echo 
"The default collation of your tables has been successfully changed!. $counter tables were changed";
?>

Define the mentioned variables in the script, load it to your forum's root and run it via browser.
Finally delete it and run the upgrade.

Just a note: as you have *lots* of excessive files, MODs and themes (which will *not* work in 2.0), I advise you to delete the following content before you load the large upgrade package:
* Packages folder
* Sources folder
* mobiquo folder (Tapatalk is available for 2.0 but you need to reinstall it and the files are different so just delete this
* Themes folder
* EVERY file in the forum folder, except Settings.php and Settings_bak.php

Then run the large upgrade package and run upgrade.php. Finally you should have your forum properly converted ;)

edit: another note: before you start all of this, make sure you set everyone to use the default theme as it helps ;)
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

guyc

Your script worked beutifuly. Thanks so much for you help.

Advertisement: