Change your existing OSW/Openfire database in UTF

192 views
Skip to first unread message

Diana Cheng

unread,
Feb 18, 2011, 4:59:08 PM2/18/11
to onesocialweb
Hello there,

Since we have some new international members, we realized that our
database was not set to work with utf8. If you are running Openfire
with a MySQL backend it is easy to change the configuration of mysql
to character set utf8, but that will not alter existing databases. It
is also necesary to alter the existing tables. Here are the necessary
steps:

1)Backup your database (this is very important, and under YOUR OWN
responsibility!)
2)Edit the my.cnf file in your MySQL installation (in a linux debian-
based distribution this is located in /etc/mysql). Add the following:

in section [client]

default-character-set = utf8


in section [mysqld]

init-connect='SET NAMES utf8'
character-set-server=utf8
default-character-set=utf8


in section [mysql]

default-character-set = utf8


3)Run the following script (replace with the right name of your
database in the first line): http://github.com/onesocialweb/osw-openfire-plugin/wiki/Turn-your-MySQL-DB-to-utf8
4) Maybe restart MySQL (sudo /etc/init.d/mysql restart)

That will allow to show characters in most languages correctly for the
activities, jabber account info, profile, etc.

I read in the openfire documentation that the JDBC driver url should
also be changed but I did not find that necessary. Here is the article
in case you need to refer to it:
http://www.igniterealtime.org/builds/openfire/docs/latest/documentation/database.html#mysql

Hope you find this useful.

Regards,
Diana.
Reply all
Reply to author
Forward
0 new messages