1 jibberjab Apr 29, 2013 02:34
3 jibberjab Apr 29, 2013 05:14
Ugh, ok, will continue this testing with 4.1.7 in that case :)
I just checked the bare 4.1.6 I had installed earlier this evening, and the tables are all utf8_general_ci. Is that what a default b2evolution install is supposed to be now? I ran a php script and updated all the tables on the imported 1.10.2 database, converting it all to utf8_general_ci, and then ran the 4.1.6 upgrade and it completed, after telling me that a lot of the database schema had been changed and needed to be altered (or something to that effect). It then read out a page full of changes similar to this:
Altering table «evo_items__item»...
Changed type of evo_items__item.post_content from longtext to post_content MEDIUMTEXT NULL
Changed type of evo_items__item.post_excerpt from mediumtext to post_excerpt text NULL
Changed type of evo_items__item.post_title from mediumtext to post_title text NOT NULL
Changed type of evo_items__item.post_renderers from mediumtext to post_renderers TEXT NOT NULL
And finally finished with: Upgrade completed successfully!
The site does appear to have upgraded properly. It's my girlfriend's site, so I'll need to have her look over all the accents and special characters tomorrow to confirm that it's all ok, but do the 4.x versions of b2evolution need to be utf8_general_ci, whereas the older versions (1.x) installed as latin1_swedish_ci by default? I guess I don't fully understand how the collation settings come into play and if there is a "right" vs "wrong" setting.
4 fplanque Apr 29, 2013 17:07
The db changes at the end of the procedure is b2evo changing back the charsets of your fields to what it wants. Check what it did and use that charset before running the upgrade.
There is no right or wrong. It just should be the same charset all the time.
I don't have access to the code right now. I'm not sure what determines the charset b2evo uses for the db. Prolly the default locale.
Also it should never have changed. Your db might have been screwed up during a backup restore operation which did not include charset/collation info.
Finally can you post your script? We should prolly include something like that at the beginning of the upgrade procedure.
5 jibberjab Apr 29, 2013 19:09
Ok, I'll do some more test exports and imports today to try to figure out where the changes are being introduced which it ends up changing back, but I feel like I've made some progress at least.
The script isn't exactly "mine", it's something I found many copies of on several different websites when searching for php scripts to change collation across an entire mysql database. Here is the one I ended up using for my testing:
<?php
// your connection
mysql_connect("localhost","db_username","db_userpass");
mysql_select_db("db_name");
// convert code
$res = mysql_query("SHOW TABLES");
while ($row = mysql_fetch_array($res))
{
foreach ($row as $key => $table)
{
mysql_query("ALTER TABLE " . $table . " CONVERT TO CHARACTER SET db_charset COLLATE db_collation");
echo $key . " => " . $table . " CONVERTED<br />";
}
}
?>
The 5 fields which need to be customized are:
db_name
db_username
db_userpass
db_charset
db_collation
Then I simply ran it locally from a web browser and it outputs a list of changes it makes. Hope this helps.
6 slamp May 01, 2013 11:59
I did some upgrade too: http://forums.b2evolution.net/error-during-update
I had to doo the collation change too.
Use MyPHPAdmin to check your mysql tables. Look at the charset/collation for each table (and possibly each varchar row). You may have different charsets/collations in use, which is not good. The whole database should use the same charset/collation.
Your problem here is (latin1_swedish_ci,IMPLICIT) vs (utf8_general_ci,COERCIBLE).
Btw, version 4.1.7 is out ;)