Page 1 of 1

Convert your database to UTF-8

Posted: Mon 2. Mar 2015, 19:27
by Oliver Georgi
Hey Guys,

I have developed a database upgrade script which allows to bring older installations of phpwcms to UTF-8. It's in an early stage but it seems to work as expected for ISO-8859-1 (tested a lot with it, other charsets should work too).

It keeps serialised arrays intact and is also able to fix broken serialised arrays (as far I can tell).

It's a one time process taking the old tables and duplicates it with a new table prefix and changes charset to UTF-8 and collation to utf8_unicode_ci — utf8_unicode_ci is more precise compared to utf8_general_ci. Then all rows from the old tables are selected and copied into the new tables. During this step a parser sanitizes all text/binary field values and convert serialised values too.

When finished all you have to do is change phpwcms' config and hope all went well :D

If you like to get your DB converted let me know.

Cheers,
Oliver