How to migrate physical MySQL server to VMware virtual server with all db and user privileges

2 Answers 2


You test everything local with an installation of vmware.

Install the vm including the mysql server. then stop the server in the vm and the original.

And simply copy the data files.

You need all files including ini ...

change the ini/cnf file to the new location and start the vm mysql again or the local first.

Check the error log of the new server if something is a wrong.

  • Thanks. Now I’m sure this will also work, however due to the downtime (stop service during copy db) issues will be going for Xtrabackup solution. So I’ll be tickets answer as well
    – Fasil CV
    May 28, 2020 at 8:10
  • InnoDb is changing some files all the time, thta is why the service has to stop, or else you have to repair the files in the new server, which can work.
    – nbk
    May 28, 2020 at 8:44

You would almost certainly be better off doing a fresh install, taking a backup using xtrabackup, and restoring the config files and the backup into the install inside the VM. That way you could even do it with only seconds of downtime by using replication up to the moment you switch over.

  • Thanks. Now got an idea about migration planning. Regarding DB backup and restore to new vm instance, which backup is best, you already mentioned here is Xtrabackup (I’m new to this) or can we use dump full backups for the same.
    – Fasil CV
    May 24, 2020 at 3:48
  • Yes, xtrabackup is one of the better ways to do MySQL backups. May 24, 2020 at 8:17
  • Thanks Gordan for your advice, let me do some trials then I can got for pre-prod and production server. I will be updated and ticked as answer once it is done
    – Fasil CV
    May 24, 2020 at 8:22
  • and here's the manual on how to backup and restore to create a new slave - percona.com/doc/percona-xtrabackup/2.4/howtos/… May 24, 2020 at 10:37
  • 1
    Thanks. It’s working well. I have tested.
    – Fasil CV
    May 28, 2020 at 8:05

Not the answer you're looking for? Browse other questions tagged or ask your own question.