There have been numerous Asian characters that are not supported by the three byte MySQL utf-8. This may not impact a lot of sites that are not located in Asia, but there has been an increase in emoji being introduced and these are using 4 bytes as well. MySQL does not handle saving four byte characters in the three byte system well (it sends back an error and nothing is saved).
I'll try to answer the questions asked in this discussion.
Which columns need to be changed?
All the columns that could possibly contain 4 byte characters need to use utf8mb4. Having some columns with a collation of utf8 and others using utf8mb4 is likely to run into problems at some point. The safest solution to make sure there are no exceptions is to convert the whole database.
Why do I need barracuda, compressed row format, and large prefix settings?
We have indexes in Moodle on varchar columns. A lot of these columns are set to a length of 255. Moving over to 4 bytes means that the size of the index needs to be reduced, or we need to use dynamic rows and long prefixes. The first option was discarded, as information in those columns has the possibility of using the full 255 length and that information would have to be concatenated and lost to fit the new length, also the indexes for those varchar columns would have to be redefined with the new size limit; The second option kept all the information in the tables, and the indexes for the varchar columns did not have to be redefined. To use the second option it is required to have a compressed row format and large prefix settings enabled. This means that the row format must use 'Barracuda'.
First option documentation here https://dev.mysql.com/doc/refman/5.6/en/charset-unicode-conversion.html
The second option is located at the same address. Please read the second 'Note' on the page.
Can I run the script while users are accessing my site?
I wouldn't recommend having the script running while the site is still active. I think that there is a high possibility of errors occurring if the database is doing both and the possibility of losing data. To avoid problems it is recommended to put your site into Maintenance mode
Should I upgrade to the next version of Moodle before running the conversion script?
The order in which you run the script and upgrade to the next version of Moodle makes no difference.
The conversion tool is too slow.
Yes, we are looking at ways to speed up the conversion process. Please follow MDL-58729