Skip to content

PlanetScale

How to back up and restore PlanetScale managed databases with SimpleBackups.

PlanetScale is a MySQL-compatible managed database platform built on Vitess. Backing it up through SimpleBackups lets you store portable copies in your own storage with custom retention schedules, independent of PlanetScale's internal backups. This guide covers both the automatic OAuth-based setup and the manual connection string approach.

Automatic setup

In this section, you will connect your PlanetScale organization to SimpleBackups so that databases are discovered automatically via OAuth.

Step 1: Get the organization name

  1. Select the organization that contains the database you want to back up.
  2. From the menu, select Settings.
  3. Copy the Organization Name.

PlanetScale organization overview screen

PlanetScale organization settings showing the Organization Name field

Step 2: Create a PlanetScale provider in SimpleBackups

  1. Go to the database backup page and click Add in the Connect your DBaaS Provider section.
  2. Select PlanetScale from the Provider dropdown, enter a name for your PlanetScale account, paste the organization name, then click Connect PlanetScale.
  3. You will be redirected to PlanetScale to log in and authorize access to your organization.
  4. Select the organization and click Authorize access.

SimpleBackups provider connection form for PlanetScale

PlanetScale OAuth authorization screen

PlanetScale organization selection and authorize screen

Manual setup

Use this approach if you prefer to supply connection credentials directly.

Step 1: Open your PlanetScale database

Navigate to the Databases section in your PlanetScale dashboard.

PlanetScale databases list screen

Step 2: Configure IP filtering

  1. Select the database you want to back up.
  2. Go to Settings, then open the Passwords section.
  3. Add the SimpleBackups IP addresses to the allowlist.

PlanetScale passwords section with IP filtering configuration

Step 3: Copy your connection credentials

  1. In the Passwords section, choose the password you want to connect through.
  2. Copy the connection details (host, username).

PlanetScale connection details screen showing host and username

Step 4: Set up a backup in SimpleBackups

Navigate to creating a new database backup and choose Serverless. You can connect using either manual form fill or automatic import:

Manual connection

Select the database Type and fill in the connection details, or click Paste connection string and enter the full connection URI.

SimpleBackups database connection form with manual fields for PlanetScale

Automatic import via DBaaS provider

  1. Click Connect your DBaaS Provider.
  2. Choose a PlanetScale provider.
  3. Select the managed database you want to back up.
  4. Click Validate.

SimpleBackups DBaaS provider selection for PlanetScale

Step 5: Validate and activate

Click Validate connection to confirm that SimpleBackups can reach your database. Once validated, configure your schedule and activate the backup.

Restoring a backup

To restore a backup, navigate to your backup page and open the Logs tab. Click the detail icon on the backup you want to restore from, then open the Restore tab. Generate a download link and copy it.

PlanetScale backup logs tab

PlanetScale backup detail view

PlanetScale restore tab with download link

Run the following command to download and decompress your backup (replace the URL with your signed download link):

bash
wget -O - "<signed-download-url>" | gunzip -c > backup.sql

Then restore using mysql, replacing the placeholders with your credentials and database name:

bash
mysql -u username -p database_name < backup.sql