Hello
I’ve tried to upgrade Opennebula from 5.8 to 5.10 in my test environment.
I did the packages upgrade and run onedb fsck.
According your documentation I got a message “Table and database charset (utf8, latin1) differs” and run the command: ALTER DATABASE opennebula CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
The error message repeated.
I saw that you mentioted system_attributes table in the documentation and converted it: ALTER TABLE opennebula."system_attributes" CONVERT TO CHARACTER SET utf8mb4;
Finally onedb upgrade and onedb fsck finished without any errors.
My question: Is it correct to change only table (system_attributes)? Because I had the similar issue during upgrade to 5.8 with vm_pool table
Versions of the related components and OS (frontend, hypervisors, VMs): Opennebula 5.10, Ubuntu 18.04 LTS, Mariadb 10.4.8+maria~bionic
No, we are assuming that all your tables have the same encoding. So in that case you should change the encoding value for every table. Maybe a note mentioned this can be added in the documentation.
The ALTER DATABASE opennebula CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; should be enough. Did you check that the query was successfully executed by running select default_character_set_name FROM information_schema.SCHEMATA where schema_name = "opennebula" after the change?
Hello again
I’ve compared my database characters setting and default. You use latin1 encoding, but last upgrade I got an error from the MySQL (Maria DB had version 10.4.6)
Mysql2::Error: Incorrect string value: ‘\xD1\x83\xD0\xB4\xD0\xB0…’ for column opennebula . vm_pool . short_body at row 1
I solved it changing character set to utf8:
ALTER DATABASE databasename CHARACTER SET utf8 COLLATE utf8_general_ci;
ALTER TABLE opennebula.vm_pool CONVERT TO CHARACTER SET utf8;
I don’t remember exactly if I changed all tables or not.
Now I realized that your script compares equality “character settings” for the whole database and for the table “system_attributes”.
I’m not sure if converted to latin1 database will work.
May be it would better to use utf8mb4 for the opennebula database?