Job with no name: Day 2: We’re changing

As expected upgrading Moodle from version 1.6 to 1.8 was not entirely problem free!

A technical bit

Moodle has been slowing changing the character set of it’s database from Latin to UTF8. This has been happening in parts of versions 1.6 & 1.7, but not all parts of Moodle (especially not some third party modules) have been using it. As a result although the majority of the database was correctly encoded, not all of the tables were. Here is the solution (for any technically minded people who stumble upon this).

To convert many MySQL tables to UTF8 from a different encoding.

Dump the database (I used phpMyAdmin, and added a drop tables command) and download

Use iconv to convert the content of the tables to UTF8 (this is easy on *nix systems, for Windows you may want to use this online version of iconv)

Now for possibly the tricky part, the collation of each table needs to be set to UTF8. It is easy to set the collation for the entire database to UTF8, but you usually need to do this for each individual table, in my case 49 if them.

What I couldn’t find was the syntax to convert all tables in a MySQL database. I could have followed a sequence if umpteen clicks x 49, but more usefully I sed a find and replace command in a text editor to take a list of tables and apply the alter table charset command to each table through an SQL command. For example: ALTER TABLE `tablename` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci

So what next?

Now we have a wonderfully improved VLE – how should we use it to:

  • Support learning
  • Equip staff
  • Communicate better with parents

Any suggestions gratefully received either by Email or through the comments system on this page. One small thing I will do is ask people! So if you bump into my over the next couple of weeks don’t be surprised to be canvassed on your opinions!

Logo wonderfully simply created from the web 2.0 logo creator.

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*