Skip to content

Establish PostgreSQL DB for DataForge

Setting Up a Supabase Project and Migrating a Provided SQL Dump

Section titled “Setting Up a Supabase Project and Migrating a Provided SQL Dump”

This guide will help you create a new Supabase Postgres project, set up psql on your machine, and migrate a provided SQL dump into your database.


  1. Supabase account: Sign up here.
  2. Basic terminal knowledge (Command Prompt, PowerShell, or macOS/Linux terminal).
  3. Provided SQL dump: You should have a file named supabase_dump.sql ready for migration.

psql is required to interact with your Postgres database.

Terminal window
brew install postgresql
Terminal window
sudo apt update
sudo apt install postgresql-client
  1. Download PostgreSQL from here.
  2. During installation, make sure to include Command Line Tools.
  3. After installation, open Command Prompt or PowerShell and verify:
Terminal window
psql --version

  1. Log in to the Supabase dashboard.
  2. Click New Project.
  3. Fill in the required details:
    • Project Name
    • Organization
    • Database Password (remember this, you’ll need it later)
    • Region
  4. Click Create new project.
  5. Wait a few minutes until the project is initialized.

Step 3: Get Your Supabase Database Connection String

Section titled “Step 3: Get Your Supabase Database Connection String”
  1. Go to your project dashboard → Settings → Database → Connection Info
  2. Copy the connection string. It looks like this:
postgres://USER:PASSWORD@HOST:PORT/DATABASE

Ensure it includes sslmode=require. If not, append it manually:
?sslmode=require


Save the provided SQL dump (supabase_dump.sql) in a folder you can easily access, e.g., ~/Downloads or C:\Users\YourName\Downloads.


Step 5: Migrate the SQL Dump to Your Supabase Database

Section titled “Step 5: Migrate the SQL Dump to Your Supabase Database”

Open your terminal and run:

Terminal window
psql "postgres://USER:PASSWORD@HOST:PORT/DATABASE?sslmode=require" -f /path/to/supabase_dump.sql

macOS/Linux:

Terminal window
psql "postgres://postgres:mysecretpassword@db.supabase.co:5432/postgres?sslmode=require" -f ~/Downloads/supabase_dump.sql

Windows:

Terminal window
psql "postgres://postgres:mysecretpassword@db.supabase.co:5432/postgres?sslmode=require" -f "C:\Users\YourName\Downloads\supabase_dump.sql"
  • Replace USER, PASSWORD, HOST, PORT, DATABASE with your Supabase connection info.
  • Replace the path with where your SQL dump is saved.

  1. Go to Supabase Dashboard → Table Editor
  2. Check that all tables and data from the SQL dump are present.

  • SSL issues: Ensure ?sslmode=require is appended to the connection string.
  • Existing tables: If the restore fails due to existing tables, drop them first or request a dump created with the --clean flag.

Congratulations! Your new Supabase Postgres project is now set up and populated with the provided SQL dump.