Upgrading from 5.2.1 to 5.3

Permalink
For ALL international users who wants to upgrade your site to 5.3 from 5.2.1.

====================
Short Description
====================
If you are using non-ASCII character, you need to SSH and mysqldump your database in order to upgrade 5.3. Otherwise, your text will be messed up.

You need to convert your MySQL database first, in order to upgrade 5.2.1 to 5.3. Otherwise, your site will look like this

http://www.concrete5.org/community/forums/internationalization/russ...


====================
Quick Solution - How to Upgrade from 5.2.1 to 5.3 for non-ASCII site owners
====================
0. BACK UP, BACK UP, BACK UP YOUR SITE
1. Make your c5 in maintenance mode
2. Log-in to SSH as an appropriate account
3. Use the following code to export a SQL file
mysqldump -u MYSQL_USERNAME -p --default-character-set=latin1 DATABASE_NAME > EXPORTED_SQL_FILENAME.sql
***You have to change CAPITALIZED letter to match your server config.

4. Clear the database (I recommend to have a backup)
5. Re-import the SQL file into the database
6. Update your c5 files to 5.3
7. Login to Dashboard and click "Upgrade".

I have not tested this yet, so I need somebody to test this.

ALSO if you ever upgraded 5.3 already, you need to read my long description.

====================
Long Description
====================

I've posted these two months ago,
http://www.concrete5.org/community/forums/internationalization/non-...

Prior to 5.3., ADODB (which is database IO library that concrete5 uses) was handling non-ASCII code as ASCII code.

So the UTF-8 characters were forcefully stored as ASCII code in the database.

However, ADODB was reading those non-ASCII code as ASCII code.... and back to UTF-8... so you didn't see the problem.

But this made impossible to tweak MySQL database via SQL file for advanced users. And it's not really good to keep the backup this way.

So I asked concrete5 core team, and they fixed it from 5.3.

However the following problem happened.

Upgrade to 5.3 damages some characters
http://www.concrete5.org/community/bugs/upgrade_to_5_3_damages_some...

That happened because the updated ADODB is reading ASCII code as ASCII code, and non-ASCII code as non-ASCII code.

So messed up characters in a database is now really messed up.

under /concrete/libraries/database.php... I saw that c5 core team wrote a code to ALTER table if the database charset does not match.

But this does not fix the character code. So if you ever run the 5.3 and upgrade it, you may have to ALTER back to latin1 encoding.

And the execute the following commands in SSH.
mysqldump -u MYSQL_USERNAME -p --default-character-set=latin1 DATABASE_NAME > EXPORTED_SQL_FILENAME.sql



Clear the database, or create a new database and set the new database character set to utf8-general-ci.

Re-import that SQL file back to the database via MyPHPAdmin.

And then, you can finally try to upgrade your site to 5.3



====================
Other Solutions?
====================
I've talked with synlag about this issue.

Well.. my solution is ok for the people who know and have SSH access and mysqldump.

But not so many people knows it...

So we could also write an php executing script to export the SQL as latin1, and import that into UTF8 database.

Anyway, this is already confusing enough... but hopefully, this will help to troubleshoot you guys problem

Hmmmmm.

katz515
View Replies:
Hulkd replied on at Permalink Reply
I don't have ssh access so I can't use mysqldump is there another option? Will a php script be done anytime soon to fix this problem?
katz515 replied on at Permalink Reply
katz515
Well, at this moment,

I just want to find out how many people are having this problem.

If the number is big...., and I will call for volunteers.

I can probably handle 5-10 people... but I will volunteer my time to convert it for you if you can send me SQL via email or FTP.

If your MyPHPAdmin can import and export the SQL file, and then I can do that.

Anyone else wants to volunteer?
Remo replied on at Permalink Reply
Remo
a script would be possible..

fetch the damages fields, do some utf magic and execute an update statement.

If you exactly know what tables/fields are damaged, this should be quite easy