Change rucore-staging's Fedora database character set to UTF-8

Project:RUcore Software Configuration
Component:Upgrade software

Currently the character set for Fedora's database on rucore-staging is latin1. This needs to be changed to utf-8.



Assigned to:chadmills» dhoover


When a moment arises can you send me a dump of the Fedora database on rucore-staging so I can figure out how to migrate it to UTF-8 from latin1?


My thoughts were to:

- shutdown fedora
- backup the current database
- use mysql to change the table level charsets (DBNAME=fedora32)

(from post at <a href="" title=""></a>)

mysql --database=DBNAME -B -N -e "SHOW TABLES" | awk '{print "SET foreign_key_checks = 0; ALTER TABLE", $1, "CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci; SET foreign_key_checks = 1; "}' | mysql --database=DBNAME

(or just run the CONVERT TO CHAR.. command manually over the fedora32 tables)

- change the charset of the database itself
/usr/bin/mysql ALTER DATABASE DBNAME CHARACTER SET utf8 COLLATE utf8_general_ci;

Then go to fedora/server/bin and run and choose database.

The hope is that with the tables and the database charsets fixed, the
script will extract the data from the files on the filesystem and populate the data properly.



After 8.1 and the two week soak uf you want to go ahead with that plan it looks like it should work.



The fedora32 mysql database dump is on rep-devel

dhoover@rep-devel:~> ls -ald /tmp/fedora32_20160601.dump
-rw-r--r-- 1 dhoover users 1436759 Jun 1 08:06 /tmp/fedora32_20160601.dump


Thanks I'll give it a look.


Attaching an SQL script used to convert to UTF-8. While I can't easily test it, running rebuild after is still a good idea.

Note the database name in line 1 needs to match the Fedora database this is being applied to.

Back to top