How to allow emojies to transfer during Virtualmin backup/restore?

Got it! Can you PM me the example of the backup file or at least the database dump for download?

Absolutely. I’ll PM you a link to the backup.

@Ilia I sent yesterday link to the Virtualmin backup files. I took a closer look at them myself too and investigated the database file content. Finding: Emojis are converted to question marks already in backup phase. The content looks very much like with mysqldump command.

You should be able to test this easily: Create a virtual server, add a table to the database with VARCHAR(255) or some other text column. Add couple of records with emojis, like :black_heart::horse::rainbow::cat::sparkles::bulb:. Then a) backup b) delete c) restore. Emojis are gone.

With mysqldump this seem to be known issue with MySQL too:

Oh, I’m sorry! Now I understand what’s happening! When you create a backup with Virtualmin for migration purposes, it doesn’t use the right charset with mysqldump command. We can most definitely automate this, I think. Let me have a closer look at this and get back to you.

Meanwhile, if you got to Servers ⇾ MariaDB Database Server ⇾ Configuration: System configuration and add to mysqldump command --default-character-set=utf8mb4 … will this work correctly then?

2 Likes

Oh wow, now I see there’s a mysqldump section in MariaDB configuration :grinning:. I will definitely check that later, thanks for the tip!

After some testing, I got everything working. Thanks for the configuration tip,Ilia, it worked. So from my behalf the case is closed. Thanks for all the help!

This problem seem to be only with earlier MariaDB versions, I assume.

Here’s my summary of the findings:

With CentOS 7.9 + MariaDB 5.5.68:
“virtualmin backup-domain” database dump uses utf8 as a default. As a result many emojis are translated to ? characters.

This can be fixed by adding this setting in MariaDB [mysqldump] section and restarting MariaDB:

default-character-set=utf8mb4

With AlmaLinux 9.2 + MariaDB 10.5.16:
“virtualmin backup-domain” database dump seem to use the original character set as a default and emojis are transferred correctly. So no need for any additional settings in MariaDB.

We will address it here:

Thank for the heads up!

3 Likes

So does it means if i use ubuntu server 22.04 LTS then everything will work fine. I mean the emojis will be exported correctly by using backup and restore Feature in virtualmin 7.7 and webmin 2.101. There is no need for more configuration in webmin or virtualmin. Am i right ? Or do i need webmin 2.102.

Most probably, because MariaDB on Ubuntu 22.04 is using utf8mb4 as default database charset.

1 Like

Thank you for help… love you :slight_smile:

You’re welcome!

@MoreKoo Could you login to mysql server on your CentOS 7 where you initially saw that issue by running:

mysql -u root -p

… after login run:

SHOW DATABASES;

… then select the database that wasn’t backing up properly (which contained emojies) using:

USE database_name_from_the_list_above;

… and the run:

SELECT @@character_set_database;

… what does it output?

Sorry, I have already upgraded the server to AlmaLinux 9 :frowning:

But I’m pretty sure the database character set was utf8mb4. I checked those settings back and forth when I tried to resolve the issue and ensured this setting for database, table and column levels.

Alright, no problem! Thanks!

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.