Keeping up my monologue. Found out that mysqldump default character set is utf8. When backing up and restoring with it, I get exactly the same result.
With mysqldump, adding parameter --default-character-set=utf8mb4 when backing up resolves the issue and emojis are transferred correctly.
If/when Virtualmin backup-domain is using mysqldump, which I suspect, is there a way to add this parameter for “virtualmin backup-domain” command?. The documentation mentions “–option” parameter, but there are no details if it could be used in this scenario.
are you now using mariadb database server in replacement for mysql community server ?
if so you may find that mariadb does not understand the encoding of your database/table/field.
This would be worth checking
I would make the next attempt. From the backup I would use (if it is OK) everything except the database. I would make an SQL dump including database create line from the CLI in the source VM, I would go to the destination VM where I would create a database with the same format then I would import the dump. We basically did the Virtualmin part manually.
@Jamie any thoughts on why encoding is breaking on backup restore? I assume it’s related to the big version jump between the MariaDB in CentOS 7 and Alma 9, but that’s a guess, and I’m sure there’s some incantation to prevent it.
I updated Webmin to the latest, and got 2.101. But as far as I can see, the mentioned collation fix is include starting 2.100. I double checked from the disk and yes, I seem to have it.
However, after testing again (backup and restore in the same system), the problem persists.
Ilia, isn’t the fix you mention relate to collation and not character set? The problem I have is definitely character set related, so collation fixes won’t help me.
The UI “Backup Database” seem to have “Character set for backup” option, which is exactly what I need. I just can’t find the parameter in the command line “virtualmin backup-domain” command.
Not 2.100. 2.102. Virtualmin repo does not have it yet. Sorry!
Jamie, just released Webmin 2.103. You can take a small risk and install it manually to see if that works for you.
Also, I would strongly advised against using CentoOS 7 for clean installs in the 4Q of 2023. You should try Rocky 9 or Alma 9 or Debian 12 or Ubuntu 22.04.