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

Project:RUcore Software Configuration
Version:8.x
Component:Upgrade software
Category:task
Priority:normal
Assigned:dhoover
Status:active
Description

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

Comments

#1

Assigned to:chadmills» dhoover

Dave,

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?

#2

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="https://www.a2hosting.com/kb/developer-corner/mysql/convert-mysql-database-utf-8" title="https://www.a2hosting.com/kb/developer-corner/mysql/convert-mysql-database-utf-8">https://www.a2hosting.com/kb/developer-corner/mysql/convert-mysql-databa...</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 fedora-rebuild.sh and choose database.

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

#3

Dave,

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

#4

Chad

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
dhoover@rep-devel:~>

#5

Thanks I'll give it a look.

#6

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