Overview
This document will demonstrate how to migrate a database from Azure Database for MySQL to PlanetScale. We recommend reading through the Database import documentation to learn how imports work before proceeding.Prerequisites
Before you can perform the migration, you’ll need to gather the following information from you MySQL instance in Azure:- Server name
- Server admin login name
- Server admin password
- Database name


Configure firewall rules
In order for PlanetScale to connect to your Azure database, you must allow traffic into the database through the associated security group. The specific IP addresses you will need to allow depend on the region you plan to host your PlanetScale database. Check the Import public IP addresses page to determine the IP addresses to allow before continuing. This guide will use the AWS us-east-1 (North Virginia) region so we’ll allow the following addresses:
Configure MySQL server settings
There are three settings that need to be configured before you can import your database:- gtid_mode
- enforce_gtid_consistency
- binlog_row_image
For “gtid_mode”, you’ll need to update the value in sequence displayed in the dropdown until it is set to “ON”. For example, if the current setting is “OFF_PERMISSIVE”, you’ll need to first change it to “ON_PERMISSIVE”, save the changes, then set it to “ON” in that order.

Import your database
Now that your Azure Database for MySQL is configured and ready, follow the Database imports guide to complete your import. When you create the external keyspace, use the following connection settings:- Host name (
--host) - Your Azure server name (from Prerequisites) - Port (
--port) - 3306 (default for Azure MySQL) - Database name (
--source-database) - The exact database name to import - Username (
--username) - Your server admin login name - Password (
--password) - Your server admin password - SSL verification mode (
--ssl-mode) -verify_identity(verify the certificate and hostname)
- Creating your PlanetScale database
- Connecting to your Azure MySQL database with an external keyspace
- Checking your server settings, user grants, and schema
- Starting the import with MoveTables
- Monitoring the import progress
- Switching traffic and completing the import

