> ## Documentation Index
> Fetch the complete documentation index at: https://docs.nometria.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Supabase Export

> Export all your Supabase tables to JSON or SQL and import into any Postgres database.

`supabase-export` is the definitive answer to "how do I export all my Supabase data?" — paginated export of every table, with a direct importer into any Postgres target: self-hosted Supabase, Neon, Railway, RDS, or local.

<CardGroup cols={2}>
  <Card title="GitHub" icon="github" href="https://github.com/nometria/supabase-export">
    nometria/supabase-export
  </Card>

  <Card title="npm" icon="npm" href="https://www.npmjs.com/package/@nometria-ai/supabase-export">
    @nometria-ai/supabase-export
  </Card>
</CardGroup>

## Install

```bash theme={null}
# Run without installing
npx @nometria-ai/supabase-export export --url https://your-project.supabase.co --key eyJ...

# Install globally
npm install -g @nometria-ai/supabase-export

# Or as a dev dependency
npm install --save-dev @nometria-ai/supabase-export
```

## Export from Supabase

```bash theme={null}
# Export all tables to ./supabase-export/ as JSON
supabase-export export \
  --url https://your-project.supabase.co \
  --key eyJ...service-role-key...

# Export specific tables only
supabase-export export --url ... --key ... --tables users,posts,comments

# Export as SQL INSERT statements
supabase-export export --url ... --key ... --format sql

# Bundle all tables into a single file
supabase-export export --url ... --key ... --bundle
```

<Warning>
  Use your **service role key**, not the anon key. The anon key cannot read all tables.
</Warning>

## Import into any Postgres

```bash theme={null}
# Import into any Postgres target (Neon, Railway, RDS, self-hosted Supabase, local)
supabase-export import \
  --dir ./supabase-export \
  --target postgresql://user:pass@host:5432/db

# List available export files before importing
supabase-export list-local --dir ./supabase-export
```

## Environment variables

```bash theme={null}
SUPABASE_URL=https://your-project.supabase.co
SUPABASE_SERVICE_KEY=eyJ...        # service role key
TARGET_DATABASE_URL=postgresql://...  # for imports
```

## Use cases

| Scenario                        | Command                                      |
| ------------------------------- | -------------------------------------------- |
| Full data backup                | `supabase-export export --url ... --key ...` |
| Migrate to self-hosted Supabase | Export + import to new instance              |
| Move to Neon or Railway         | Export + `--format sql` + psql               |
| Local dev seeding               | Export prod → import to local                |
| Exit Supabase entirely          | Full export to any Postgres                  |

<Note>This tool is open source and works with any Supabase project, not just Nometria deployments.</Note>
