This tutorial explains how to migrate your schema and data from Supabase to Altan Databases.
Overview#
Migration has two phases:1.
Schema Migration — replicate your Supabase tables, columns, indexes, and foreign keys inside Altan.
2.
Data Migration — export your rows from Supabase as CSV files and import them into Altan.
Here's a quick tutorial video that walks you through the process:
Step 1: Export Your Supabase Schema#
Open the SQL Editor in Supabase and run the following query:This query returns a JSON description of your schema including:Columns, types, nullability, defaults
Click 'Copy cell content' to copy the JSON output in the clipboard.
Step 2: Import Schema into Altan#
Copy the JSON output, then open the Altan project where you want to import the corresponding database schema and enter:Import this database schema:
[PASTE JSON HERE]
This will recreate your tables with the same structure.
Step 3: Export Data from Supabase#
3.
Use the ···
menu → Export data → Export table as CSV.
4.
Repeat for all tables in the database.
Step 4: Import Data into Altan#
1.
Open the corresponding table in Altan project.
3.
Upload the CSV file you exported from Supabase.
4.
Repeat for all tables in the correct order.
⚠️ Import order is critical:When working with relational data, some tables depend on others through foreign key relationships. This means that one table (the child) references rows in another table (the parent).Parent tables contain the primary data that other tables point to.
Child tables contain references (foreign keys) to the parent tables.
For example, imagine you have two tables:A customers
table that stores each customer’s details (id
, name
, email
, etc.).
An orders
table that stores purchases. Each order includes a customer_id
field that points back to a row in the customers
table (i.e. the correspondingid
value from the customers
table).
Because every order
must reference an existing customer
, you need to import the CSV for customers
first. Once all customers are in place, you can safely import orders.csv
, since the foreign key (customer_id → customers.id
) will resolve correctly.If you reverse the order, the import will fail because Altan will try to insert orders that point to customers who don’t yet exist.TLDR: import parent tables first and then child tables. Modified at 2025-09-10 17:58:38