tutorial··5 min read·WoWSQL Team

Migrate Postgres to WoWSQL: Neon, Heroku, RDS, Railway, Render

Move Postgres from Neon, Heroku, AWS RDS, Railway or Render to WoWSQL with pg_dump and pg_restore, or the WoWSQL CLI. Tested commands and checks.

To migrate a Postgres database from Neon, Heroku, AWS RDS, Railway or Render to WoWSQL, dump it with pg_dump --format=custom --no-owner --no-privileges using the source's direct connection string, then restore it with pg_restore --no-owner --no-privileges --single-transaction --exit-on-error into the WoWSQL connection string from the dashboard's Connect menu. That's the whole data move: it's plain Postgres to Postgres, and no WoWSQL-specific tool is needed. Afterwards, enable WoWSQL's Data API if your app will use the auto-generated REST API, compare row counts, and switch your DATABASE_URL.

We ran the dump, restore and verification commands on 30 November 2026 against local PostgreSQL 17 databases, including one with a second schema and a view. We checked the WoWSQL CLI commands against wowsql --help for version 1.7.0. Nothing was run against a live WoWSQL project, so do a trial restore into a scratch project first.

Key facts (checked 30 November 2026)

  • Target: postgresql://USER:[YOUR-PASSWORD]@db.your-project-slug.wowsqlconnect.com:5432/postgres, from the project's Connect menu (dashboard docs). Lost the password? Reset it in Project Settings → Database password.
  • CLI alternative: pip install wowsql-cli, then wowsql db restore --file dump.sql sends a plain SQL file over HTTPS. Use it for small databases.
  • Extensions: enabling extensions needs Pro or Scale. Some are blocked, including dblink, postgres_fdw, file_fdw and plpython3u (docs).
  • Data API: off by default on new projects (Compute docs). Direct SQL connections don't need it.
  • Regions: Mumbai (ap-south-1), US East (us-east-1) and Frankfurt (eu-central-1). There's no UK region. Plans: Free $0 (256 MB database), Pro $25/month (10 GB), Scale $99/month (pricing).

Where to find the source connection string

Source Which string to use Notes
Neon Connect, with Connection pooling turned off (the host without -pooler) Neon's docs say not to use pg_dump over a pooled connection (Neon docs). Keep ?sslmode=require
Heroku Postgres heroku config:get DATABASE_URL --app your-app, or download a backup heroku pg:backups:capture --app your-app then heroku pg:backups:download --app your-app gives you latest.dump in custom format (Heroku docs)
AWS RDS / Aurora PostgreSQL The instance endpoint, port 5432, master user The security group must allow your IP, or run pg_dump from an EC2 instance in the VPC
Railway The Postgres service's public connection URL (DATABASE_PUBLIC_URL variable) The private URL only works inside Railway
Render External Database URL on the database page The internal URL only works inside Render

Step 1: Check versions and size

psql "$SOURCE_DB_URL" -At -c "select version();"
psql "$SOURCE_DB_URL" -At -c "select pg_size_pretty(pg_database_size(current_database()));"
psql "$SOURCE_DB_URL" -At -c "select extname from pg_extension order by 1;"
pg_dump --version

Use a pg_dump/pg_restore whose major version is at least the newer of the two servers. Compare the size with your WoWSQL plan: 256 MB on Free, 10 GB on Pro. For each extension in the list, check Database → Extensions in the WoWSQL dashboard before you restore.

Step 2: Create the WoWSQL project and take a safety copy

Create the project in the dashboard (choose the region there; wowsql projects create has no region option), then:

pip install wowsql-cli
wowsql login
wowsql projects set-default your-project-slug
wowsql backup create --name before-migration --output ./backups/wowsql-before.sql

export WOWSQL_DB_URL='postgresql://USER:[PASSWORD]@db.your-project-slug.wowsqlconnect.com:5432/postgres'

Step 3: Dump and restore (the tested commands)

# 1. Dump: custom format, no source owners or grants
pg_dump "$SOURCE_DB_URL" --format=custom --no-owner --no-privileges --file=app.dump

# 2. Restore into WoWSQL: all or nothing, stop at the first error
pg_restore --no-owner --no-privileges --single-transaction --exit-on-error \
  --dbname="$WOWSQL_DB_URL" app.dump

For Heroku, skip step 1 and restore latest.dump instead. If the restore complains about the heroku_ext schema, Heroku's docs say to create it first: psql "$WOWSQL_DB_URL" -c "create schema heroku_ext;".

In our test, a database with a public table, a sequence, and a view in a second schema (reporting) restored in one pass, and the sequence continued from the right value.

Large databases: --single-transaction can't be combined with --jobs. To restore in parallel into a fresh, empty project, drop --single-transaction and add --jobs 4. If it fails halfway, start again with a fresh project.

Only some schemas: add --schema=public (repeat for each schema) to pg_dump. If the restore then stops with schema "public" already exists, filter that entry out:

pg_restore --list app.dump | grep -v -E 'SCHEMA - public|COMMENT - SCHEMA public' > restore.list
pg_restore --use-list=restore.list --no-owner --no-privileges --single-transaction --exit-on-error \
  --dbname="$WOWSQL_DB_URL" app.dump

Step 4: Or restore through the WoWSQL CLI

If your network blocks outbound port 5432, send a plain SQL file over HTTPS:

pg_dump "$SOURCE_DB_URL" --no-owner --no-privileges --column-inserts --file=app.sql
perl -0pi -e 's/^\\(un)?restrict .*\n//mg' app.sql   # psql-only lines added by recent pg_dump
wowsql db restore --file app.sql

--column-inserts replaces COPY … FROM stdin, which only psql understands. Recent pg_dump releases also add \restrict lines, which are psql meta-commands, and the perl line removes them. The CLI uploads the whole file in one request, so keep this route for small databases. We couldn't run wowsql db restore against a live project for this article, so try it on a scratch project and check the counts.

Step 5: Verify

Run these on the source and on WoWSQL, and compare:

set timezone = 'UTC';

-- Exact row counts
select table_schema, table_name,
       (xpath('/row/c/text()',
              query_to_xml(format('select count(*) as c from %I.%I', table_schema, table_name),
                           false, true, '')))[1]::text::bigint as row_count
from information_schema.tables
where table_type = 'BASE TABLE'
  and table_schema not in ('pg_catalog', 'information_schema')
order by 1, 2;

-- Sequences: last_value should be at or above max(id) of each table
select schemaname, sequencename, last_value from pg_sequences order by 1, 2;

-- Fingerprint one important table
select md5(string_agg(t::text, '|' order by t.id)) from public.orders t;

On WoWSQL, the platform's own schemas (for example auth) show up in the first query too. Compare only your schemas. From the CLI: wowsql db tables list and wowsql db query "select count(*) from orders".

Step 6: Point the app at WoWSQL

Most apps on these platforms connect with a Postgres driver, so the switch is a new DATABASE_URL:

DATABASE_URL=postgresql://USER:PASSWORD@db.your-project-slug.wowsqlconnect.com:5432/postgres

Prisma, Drizzle, SQLAlchemy, Django, Rails and node-postgres all take that URL. If you also want WoWSQL's generated REST API, auth or storage:

  1. Enable the Data API and expose the tables (new projects start with it off, and calls return 403 DATA_API_DISABLED).
  2. Turn on RLS for every table the API exposes, then add policies. A table exposed without RLS is readable by anyone with the anon key if its grants allow it.
  3. Use @wowsql/sdk 3.10.0 from JavaScript. It's CommonJS, so use const { WowSQLClient } = require('@wowsql/sdk') or import { WowSQLClient } from '@wowsql/sdk', not the default import.

If your app already has its own users table with bcrypt hashes, those rows move with the dump and your login code keeps working over the direct connection. Moving those users to WoWSQL Auth is a separate project: WoWSQL documents no hash import.

Platform notes

  • Neon: branches are separate databases. Dump the branch you serve production from. Neon-specific extensions such as neon or neon_utils won't exist on WoWSQL, so remove them from the restore list. See WoWSQL vs Neon.
  • Heroku: backups are in custom format already. Remove heroku_ext references, or create the schema first.
  • AWS RDS: RDS-only roles such as rds_superuser don't exist on WoWSQL; --no-owner --no-privileges keeps them out of the restore. If you're weighing RDS in Mumbai against a BaaS, see AWS RDS in Mumbai vs a Postgres BaaS.
  • Railway and Render: use the public or external URL from your machine. Long dumps over the public internet can time out, so --format=custom (compressed) helps.

Rollback

Don't delete the source until the new database has served traffic for a while. If you need to go back, point DATABASE_URL at the source again, and copy any rows written to WoWSQL in the meantime. That's why a short write freeze during cutover makes rollback easy. The full plan is in the migration runbook.

FAQ

How do I migrate a Postgres database to WoWSQL?

Run pg_dump --format=custom --no-owner --no-privileges against your current database, then pg_restore --no-owner --no-privileges --single-transaction --exit-on-error into the WoWSQL connection string from the Connect menu. Verify row counts and switch DATABASE_URL.

How do I migrate from Neon to another Postgres provider?

Copy Neon's connection string with connection pooling turned off, dump with pg_dump -Fc, and restore with pg_restore into the new provider. Neon's own docs warn against running pg_dump over a pooled connection.

How do I move a Heroku Postgres database?

Run heroku pg:backups:capture and heroku pg:backups:download to get latest.dump, then pg_restore it into the new database with --no-owner --no-privileges. Create a heroku_ext schema first if the restore asks for it.

Do I need the WoWSQL CLI to migrate?

No. pg_dump and pg_restore against the direct connection string are enough. The CLI helps with local backups (wowsql backup create), restoring a SQL file over HTTPS (wowsql db restore --file), checks (wowsql db query) and later schema migrations (wowsql migration up).

Can I migrate with zero downtime?

The tested path is dump and restore, which needs a short write freeze for the final copy. Logical replication from the source would shorten that, but WoWSQL's docs don't describe accepting a replication subscription, so ask support before planning around it.

Will my extensions work on WoWSQL?

Check Database → Extensions in your dashboard first. Enabling extensions needs Pro or Scale, and some are blocked, including dblink, postgres_fdw, file_fdw and plpython3u.

Related guides

Create a free WoWSQL project and restore a copy of your database into it today. · Pricing · CLI docs