Virtualmin does not honor collationsettings when cloning server

Well, am poking around with CENTOS 7 currently, and i wanted to clone an existing server, for backup purpose. The database from live server has been set to collation utf8_general_ci and after cloning it is latin1_swedish_ci, which is the standard collation from MySQL (or MariaDB it seems). Why wouldn't latest virtualmin under CENTOS 7 use the existing utf8_general_ci collation while cloning the virtual server?

And, any chance to add commands to be executed AFTER cloning?

Example:

Most applications have their own config file, and after cloning it would still point to the old database and link setting. Therefore it would make sense, executing a post-clone script, to change this settings. My strategy is, that i usually have a example.com host and clone it to clone1.example.com. For this i create a config file, which would have adapted mysql credentials and the new base link being set. Now i have to copy this each time i create a clone; which sometimes i forget, so in the end, i am doing something on the clone, but change the database of example.com, which wasn't my intention. Of course, there could be other commands to be run as well. My application also requires a specific cron job to be set in crontab, and the cronjob has to be restarted after changing crontab etc. You get the idea.

So any idea how to manage that?

Best j_m

Status: 
Active

Comments

Jamie may need to chime in on this one, but I'm pretty sure all a clone does is use mysqldump to create a SQL file, and then import it into the new file.

Do you happen to know if the correct settings are being used when doing a general backup/restore? As in theory that would be using a similar process.

Correct, cloning of a database is done using a simple MySQL dump and restore.

It seems like the right thing to do, if the dump doesn't include the collation settings, is for Virtualmin to re-apply it to the DB after cloning.