- Install Docker Desktop
- Run
mv .env-example
to.env
and setMYSQL_ROOT_PASSWORD
- Copy the existing source db to
source.sql
in the current directory - Copy the existing target db to
destination.sql
in the current directory - Start compose with
docker-compose up
-
Modify the
CREATE DATABASE
andUSE
statements insource.sql
to use the database namesource
-
Modify the
CREATE DATABASE
andUSE
statements indestination.sql
to use the database namesource
-
Drop to a shell inside of the docker container
docker-compose exec /bin/bash
-
Enter the
/repo
directory from ./docker-compose.yamlcd /repo
-
Connect to the database
mysql --host=127.0.0.1 --port=3306 -p
-
Restore the data
source source.sql source destination.sql