- Two migration methods: Choose between downloading data from Supabase as CSV and using the HarperDB REST API for bulk insert, or use Fastify to connect to Supabase, query data, and directly upload it to HarperDB.
- Understand the Supabase data: Identify the specific table (e.g., "bio") and its columns (id, name, age, email, city) that you want to migrate.
- Create a HarperDB cloud instance: Sign up for HarperDB, provide necessary information, choose instance type (e.g., AWS or Verizon Wavelength), select a cloud provider (e.g., HarperDB Cloud on AWS), fill in instance details (e.g., name, credentials), specify RAM, size, and region.
- Create a schema and table in HarperDB: Set up a schema (e.g., "UserData") and a table (e.g., "bio") with a hash attribute of "id."
- Migrate using CSV download/upload: Download the Supabase database as a CSV file by selecting all rows and exporting it. Import the CSV file to HarperDB using either the dashboard method or the REST API method, specifying the schema, table, and CSV URL or file path.
- Migrate using Fastify and Harperive: Install the required packages (harperive, fastify-supabase, dotenv) and configure Supabase and HarperDB in your project. Set up a Fastify connection to Supabase, and establish a connection to HarperDB using the Harperive Node.js driver.
- Start migration with Fastify: Create an app.js file, set up a Fastify server, register the fastify-supabase plugin, and establish connections to Supabase and HarperDB. Use Fastify to query data from Supabase (e.g., bio table) and insert it into HarperDB using the Harperive client. Access the migration endpoint (e.g., http://localhost:3000/migrate) in your browser to initiate the migration process.
- Verify migration: Check your HarperDB cloud instance to ensure that the data from Supabase has been successfully migrated.