DigitalOcean database migration guide
Learn how to migrate a database from a DigitalOcean MySQL cluster into PlanetScale using the database Import tool.
In this article, we’ll walk through migrating a MySQL database from DigitalOcean to PlanetScale using the Import tool.
This guide assumes you are using MySQL on DigitalOcean. Other database systems available through DigitalOcean will not work with the PlanetScale import tool.
Before you can start migrating your database, you’ll also need to collect the following information from your DigitalOcean cluster:
- The admin username and password
- The database host
- The port
- Database name
Most of this information is located on the landing page of your cluster.
You can view the list of databases in the "Users & Databases" tab. This article will use the default database created when the cluster was initialized, named
If you don’t know the admin password, you can create a new set of credentials using the information on the Import tool user permissions page to create an account that can be used to import your database.
In order for PlanetScale to connect to your DigitalOcean database, you must allow network traffic into the database by adding the necessary IP addresses to the trusted sources list in DigitalOcean. The specific IP addresses you will need to allow depend on the region you plan to host your PlanetScale database. Check the Import tool 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:
18.104.22.168 22.214.171.124 126.96.36.199 188.8.131.52 184.108.40.206 220.127.116.11 18.104.22.168 22.214.171.124 126.96.36.199 188.8.131.52 184.108.40.206 220.127.116.11 18.104.22.168 22.214.171.124 126.96.36.199
In the DigitalOcean dashboard, navigate to the “Settings” tab of your database and locate Trusted sources in the list of configuration items. Click “Edit” and the row should change to allow edits to the setting.
When you enter an IP address from the list, a message will appear below the input box asking if you want to add that IP as an address. Click that message to add it to the list. Repeat this step for each IP address that needs to be added, then click “Save” once you are done.
The default settings for MySQL databases on DigitalOcean is to have
ANSI_QUOTES enabled in the global MySQL settings, which is not supported by PlanetScale. To remove this setting, navigate to the "Settings" tab of your cluster and locate the section titled Global SQL mode. Click “Edit” in that section to change the configuration settings.
To remove the
ANSI_QUOTES setting, click the “x” next to the tag and click “Save.” The change should apply immediately.
In the PlanetScale dashboard, click “New database”, then “Import database”.
The Import database feature is in beta at the time of this writing. If this is your first time accessing this feature, you will be prompted to opt into using the feature. Click “Join beta” to proceed.
Complete the form using the information gathered in the previous section. Click “Connect to database”, and the import tool will attempt to connect to your DigitalOcean database.
The “Connect to database” button will update with the status of the connection. If the connection is successful, click “Begin database import” to migrate your data to PlanetScale.
You’ll then be moved to a page where you can monitor the import status of the database from DigitalOcean.
Once the initial import has been completed, the first card in the Database import section will update to reflect the status of the import. If it is successful, you’ll have the option to “Enable primary mode,” which will prepare the PlanetScale database to be used as the primary data source. Click “Enable primary mode” & you’ll be presented with a confirmation modal to proceed.
Once Primary mode is enabled, you can complete the migration by clicking “Finish import” and confirming on the modal that will display. This will remove any synchronization occurring between DigitalOcean and PlanetScale.
This concludes the guide to migrating a database from DigitalOcean to PlanetScale.