Planetscale Database

How to back up and restore Planetscale Managed databases with SimpleBackups

Configure your PlanetScale Backup

In these steps, we will get Organization Name on Planetscale that will be needed later to allow us to automate Planetscale database backups from SimpleBackups dashboard.

1. Get the Organization Name

  1. Select the organization which contains the database you want to backup.
  1. From the menu select “Settings”.
  1. Copy the “Organization Name”.
    1. Notion image
      Notion image

2. Create Planetscale Provider on SimpleBackups

  1. Afterwards, create a new provider on SimpleBackups with your Planetscale Organization Name by going to the database backup page and click add on the “Connect your DBaaS Provider” section as shown.
  1. Select Planetscale from the Provider dropdown list, enter a name for your Planetscale account, then paste the Organization Name we obtained in the previous step and click Connect Planetscale.
  1. That redirects you to Planetscale to login and authorize access to your organization which contains the database you want to backup.
  1. Select the organization then click on “Authorize access”.
    1. Notion image
      Notion image
      Notion image
 

Create a Planetscale Database

To create backups for Planetscale database using SimpleBackups, follow these steps. The process is designed to be straightforward, ensuring that your Planetscale database is securely backed up.

You can create a Backup for any Planetscale Database type:

  • Planetscale MySQL database.

Prerequisites

  • A SimpleBackups account.
  • Access to your Planetscale database
  • Network access from SimpleBackups to your Planetscale database.

1. Log in to Your Planetscale Account:

  • Navigate to the Databases section in your Planetscale dashboard.
    • Notion image

2. Configure IP Filtering:

  • Select the database you want to backup.
  • Go to the "Settings" section.
  • Open “Passwords” section.

3. Copy Connection Data:

  • From the "Passwords" section.
  • Choose the password you want to connect through.
  • Copy connection details (host, username).
    • Notion image

4. Set Up Backup in SimpleBackups:

  • Log in to your SimpleBackups account or create a new one if needed.
  • Navigate to creating a new database backup.
  • Choose "Serverless".

5. Fill the connection details:

Manual connection settings:

  • Choose the Database “Type”.
  • You can either fill the form with connection details or select "Paste Connection string" and paste the service URI.
    • Notion image

Automatically import your settings:

  • Click on “Connect your DBaaS Provider”.
  • Choose an Planetscale provider.
  • Select a managed database.
  • Click on “Validate”.
    • Notion image

6. Validate and Activate Backup:

  • Click on "validate connection" to ensure all settings are correct and the connection can be established.
  • Once validated, finalize any additional backup settings (like scheduling) and activate the backup.

This process ensures that your Planetscale database is securely backed up using SimpleBackups, providing an additional layer of data protection.

 

Restoring a Planetscale backup

In order to restore your backup, Go to your backup page, then navigate into logs.

Notion image

Click on the “i” button on the backup that’s on the point of time you’d like to restore to.

Notion image

Click on the Restore tab, then generate a new download link, and copy it.

Notion image

Run these commands:

wget -O - "PasteTheSignedDownloadLinkHereBetweenTheQuotes" | gunzip -c > decrypted-backup.sql

Then, run the mysql command to restore your database like so:

mysql -u username -p database_name < decrypted-backup.sql
💡
Make sure that you have mysql updated to the latest version to avoid facing restore issues.
 

Planetscale MySQL Database backup

SimpleBackups supports Planetscale MySQL Database backup.

 

Did this answer your question?
😞
😐
🤩

Last updated on June 25, 2024