Mysql – Migrate database from one server to another without downtime

migrationMySQL

I want to migrate a MySQL database to another MySQL database (different server and only terminal access). I believe I can do a dump on it, but then I won't have the latest data. How do I make sure that I have the latest data if I am not allowed to have downtime? Is it possible?

Please excuse my ignorance if any (newbie in dba). I have read all the suggestions and duplicate questions before creating this new one. But none of them seems to be the one I am looking for.

Best Answer

In general I don't think it's possible to move a database without any downtime with MySQL standard tools.

However you can try to use mysqldump and mysqlbinlog to minimize "data loss": see section "Example: mysqldump + mysqlbinlog for Backup and Restore" in https://dev.mysql.com/doc/refman/8.0/en/mysqlbinlog-backup.html