Sean,
Thanks for the help so far. This was a while ago, I realize. The solution didn't quite work, though that wasn't critical until now, when moodle changed their upgrade process to fail (i.e. stop) if the database isn't sufficiently converted to utf8mb4. So I'm stuck. What I've done so far is:
- Use Adminer to change the database character set to utf8mb4_unicode_ci
- Run (and modify) a query I found on Stack Overflow to generate statements like this:
ALTER TABLE mariadb_moodle.mdl_adminpresets CONVERT TO CHARACTER SET utf8mb4;
###
ALTER TABLE mariadb_moodle.mdl_adminpresets COLLATE utf8mb4_unicode_ci;
###
ALTER TABLE mariadb_moodle.mdl_adminpresets MODIFY name varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE mariadb_moodle.mdl_adminpresets MODIFY comments LONGTEXT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE mariadb_moodle.mdl_adminpresets MODIFY site varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE mariadb_moodle.mdl_adminpresets MODIFY author varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE mariadb_moodle.mdl_adminpresets MODIFY moodleversion varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE mariadb_moodle.mdl_adminpresets MODIFY moodlerelease varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE mariadb_moodle.mdl_adminpresets_app_it_a MODIFY itemname varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE mariadb_moodle.mdl_adminpresets_app_plug MODIFY plugin varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
and so on, a few thousand statements total.
The statements run fine in Adminer (using the SQL query window). The results are "Query executed. 0 rows affected" for each statement.
I've succeeded in getting Adminer to show that the collation method for each table is utf8mb4_unicode_ci, but the moodle upgrade tool still says the database isn't fully converted to UTF8MB4, so it won't upgrade the application.
I note there are at least two variables for the database (mariadb_moodle) that I can't change and are still the wrong value:
character_set_server latin1
character_set_system utf8mb3
I don't think I can change these. It looks like I could change them with a my.cnf file for the mariaDB instance (maybe) or possibly my.ini (I don't know the difference). However, I don't know where to put such files, or if I have access on Opalstack's shared hosting.
The error I get from the moodle installer, by the way, is:
"The current setup of MySQL or MariaDB is using 'utf8'. This character set does not support four byte characters which include some emoji. Trying to use these characters will result in an error when updating a record, and any information being sent to the database will be lost. Please consider changing your settings to 'utf8mb4'."
Do you have any guidance for how I can convince moodle that the database really is now utf8mb4?