Migrate a MySQL Database To A New Server

Take a mysql dump of the existing database:

mysqldump --lock-all-tables -u root -p --all-databases > dump.sql

Copy the dump.sql file to your new mysql server

mysql -u root -p < /tmp/dump.sql

This should export all your data.

For more detailed info:

https://www.digitalocean.com/community/tutorials/how-to-migrate-a-mysql-database-to-a-new-server-on-ubuntu-14-04

Leave a comment