Archive for March, 2009

moodle upgrade – database needs to be stored in utf-8

Tuesday, March 3rd, 2009

While I was upgrading moodle, I got this message:

It is required that you store all your data in Unicode format (UTF-8). New installations must be performed into databases that have their default character set as Unicode. If you are upgrading, you should perform the UTF-8 migration process (see the Admin page).

After googling around, I was able to get this solution:

1. Create a dump of your old database.

> mysqldump -uUSER -p OLD_DATABASE > OLD_DATABASE.sql

2. Create a new database. This is where you will transfer the old one.

mysql> create database NEW_DATABASE default charset=utf8;

mysql> grant all privileges on NEW_DATASE to ‘USER’@'localhost’;

3. Load your old database to the new one.

>mysql -uUSER -p NEW_DATABASE < OLD_DATABASE.sql

  • Share/Bookmark