Troubleshooting

A triage guide for failed Lovable-to-Supabase migrations: route connection, schema, and data errors to the exact fix and decode any Postgres error string.

A migration step fails with a Postgres error, not a stack trace. Read the error string first, then jump to the matching page below. The source is read-only throughout, so a failed step never corrupts your Lovable data — fix the cause and retry the step.

Connection failures

These happen before any SQL runs, usually on the connect step.

  • connect ENETUNREACH on an IPv6 address → your network has no IPv6 route. Switch to the pooler host (port 6543). See ipv6-enetunreach.
  • password authentication failed for user "postgres" → wrong password, or you pasted the anon key into the password field. See password-authentication-failed.
  • sorry, too many clients already / remaining connection slots are reserved → the direct connection limit is exhausted. Use the connection pooler and lower concurrency. See too-many-connections.

If the host and port look wrong, rebuild the string with the connection string builder.

Schema replay failures

The schema step runs DDL in dependency order. When an object references something not yet created:

  • relation "public.orders" does not exist → a table or view was referenced before it existed. Usually a FK or trigger replayed out of order. See relation-does-not-exist.
  • type "public.order_status" does not exist → a custom enum or composite type is missing. Types must replay before the tables that use them. See type-does-not-exist.

Re-run the schema step; the replay is idempotent and skips objects that already exist.

Data failures

The data step inserts in FK order with batched inserts.

  • insert or update on table "orders" violates foreign key constraint → a child row points at a parent row that was not inserted. Check the parent table finished, then retry. See foreign-key-violation.

If sequences are off after data loads, the fix is a sequence resync, which the data step runs automatically.

Decode any error

If the string is not listed above, paste it into the Postgres error decoder. It maps the SQLSTATE code and message to a likely cause and fix.

Next step

Once the failing step passes, run validation to confirm the destination matches the source end to end.

Edit this page on GitHubLast updated July 13, 2026