Skip to content

CLI to migrate databases from PlanetScale to other MySQL-compatible database services (TiDB).

License

Notifications You must be signed in to change notification settings

albugowy15/planetscale-migrator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PlanetScale Migrator

This is a command-line interface tool designed to facilitate the migration of databases from PlanetScale to other MySQL-compatible database services.

Prerequisites

Go 1.22.0

Ensure that you have Go installed on your system. Always use the latest version of Go for optimal performance and compatibility.

Exporting Data from PlanetScale

To export data from PlanetScale, refer to the instructions provided in this article: Hobby tier deprecation - FAQ

How to run

  1. Begin by cloning this repository
git clone https://github.com/albugowy15/planetscale-migrator.git
  1. Create a .env file by copying the provided .env.example file and fill in all the required environment variables
cp .env.example .env
  1. Build the Go binary
go build -o pscale-migrator main.go
  1. Execute the binary and specify either a .sql file or a directory containing .sql files
# Execute a single file, such as sample.sql
./pscale-migrator -file sample.sql

# Execute all SQL files within the migrations directory
./pscale-migrator -dir migrations/

About

CLI to migrate databases from PlanetScale to other MySQL-compatible database services (TiDB).

Topics

Resources

License

Stars

Watchers

Forks