Skip to content

Comments

docs(docs): add Neon to Prisma Postgres migration guide#7548

Open
aidankmcalister wants to merge 3 commits intomainfrom
feat/neon-migration-guide
Open

docs(docs): add Neon to Prisma Postgres migration guide#7548
aidankmcalister wants to merge 3 commits intomainfrom
feat/neon-migration-guide

Conversation

@aidankmcalister
Copy link
Member

@aidankmcalister aidankmcalister commented Feb 23, 2026

What changed and why

Adds a new guide covering how to migrate data from Neon to Prisma Postgres using pg_dump and pg_restore.

Covers:

  • Creating a new Prisma Postgres database and obtaining a direct connection string
  • Exporting data from Neon with pg_dump
  • Importing into Prisma Postgres with pg_restore (using --no-owner and --no-acl to avoid role errors from Neon-specific roles)
  • Updating application code for both existing Prisma ORM users and those not yet using it

Linear: DR-7110

Summary by CodeRabbit

  • Documentation
    • Added a new migration guide for moving databases from Neon to Prisma Postgres. The guide covers prerequisites, exporting and importing data (including command-line steps and SSL notes), validating the import with Prisma Studio, updating environment configuration, and tailored guidance for users already using Prisma ORM as well as those who are not.

@vercel
Copy link

vercel bot commented Feb 23, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
blog Ready Ready Preview, Comment Feb 24, 2026 5:01pm
docs Ready Ready Preview, Comment Feb 24, 2026 5:01pm
eclipse Ready Ready Preview, Comment Feb 24, 2026 5:01pm

Request Review

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 23, 2026

Walkthrough

Adds a new Postgres migration guide migrate-from-neon and registers it in the Postgres guides navigation; the guide documents export/import steps, validation, SSL/env configuration notes, and Prisma-specific guidance.

Changes

Cohort / File(s) Summary
Documentation Navigation
apps/docs/content/docs/guides/postgres/meta.json
Inserted migrate-from-neon into the pages array to expose the new guide in the Postgres guides list.
Migration Guide
apps/docs/content/docs/guides/postgres/migrate-from-neon.mdx
Added a new MDX guide covering prerequisites, pg_dump/pg_restore export-import commands, SSL/env configuration notes, validation with Prisma Studio, and guidance for Prisma ORM users and non-users.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically describes the main change: adding a new migration guide from Neon to Prisma Postgres, which aligns perfectly with the changeset.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link
Contributor

github-actions bot commented Feb 23, 2026

🍈 Lychee Link Check Report

3665 links: ✅ 2999 OK | 🚫 0 errors | 🔀 0 redirects | 👻 664 excluded

✅ All links are working!


Full Statistics Table
Status Count
✅ Successful 2999
🔀 Redirected 0
👻 Excluded 664
🚫 Errors 0
⛔ Unsupported 2
⏳ Timeouts 0
❓ Unknown 0

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@apps/docs/content/docs/guides/postgres/migrate-from-neon.mdx`:
- Around line 78-82: The .env example for DATABASE_URL is missing a database
name which can cause connection failures; update the `.env` snippet so
DATABASE_URL includes a placeholder DB name (e.g., .../:5432/DB_NAME?...) or
explicitly instruct readers to paste the exact direct connection string from the
Neon Console; ensure the `.env` sample and accompanying text reference the
DATABASE_URL variable and show where to put the database name or full direct
connection string.
- Around line 46-63: The example commands use literal quoted strings
("NEON_DATABASE_URL" / "PRISMA_POSTGRES_DATABASE_URL") which are not
copy/paste-safe; update the pg_dump and pg_restore invocations to use
shell-friendly placeholders or environment variable expansion instead (e.g.,
"$NEON_DATABASE_URL" or a clearly marked placeholder like <NEON_DATABASE_URL>),
and ensure the same change is applied to both the pg_dump command and the
pg_restore command so readers can paste and run them without replacing quotes or
breaking expansion.

ℹ️ Review info

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b2427d3 and 4cde0a6.

📒 Files selected for processing (2)
  • apps/docs/content/docs/guides/postgres/meta.json
  • apps/docs/content/docs/guides/postgres/migrate-from-neon.mdx

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

♻️ Duplicate comments (1)
apps/docs/content/docs/guides/postgres/migrate-from-neon.mdx (1)

78-82: ⚠️ Potential issue | 🟡 Minor

The .env DATABASE_URL is missing a database name — connection will fail.

Line 81 shows:

DATABASE_URL="postgres://USER:PASSWORD@db.prisma.io:5432/?sslmode=require"

The path component between the port and the query string is empty (/), so the URL contains no database name. Most PostgreSQL clients (including the pg driver Prisma uses) fall back to the OS username as the database name when the path is absent, which will cause an immediate connection failure for almost every user who copy/pastes this.

📝 Proposed fix
-DATABASE_URL="postgres://USER:PASSWORD@db.prisma.io:5432/?sslmode=require"
+DATABASE_URL="postgres://USER:PASSWORD@db.prisma.io:5432/DBNAME?sslmode=require"

Instruct readers to replace DBNAME (or the full URL) with the exact direct connection string copied from the Prisma Console in step 1, which already carries the correct database name.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@apps/docs/content/docs/guides/postgres/migrate-from-neon.mdx` around lines 78
- 82, The example DATABASE_URL in the .env snippet is missing a database name
and will fail; update the dotenv example so DATABASE_URL includes the actual
database name (e.g., replace the empty path "/" with "/DBNAME") or, better,
instruct readers to paste the full direct connection string copied from the
Prisma Console into DATABASE_URL (so the DATABASE_URL value contains the correct
host, port, database name and query params). Ensure the text references the .env
DATABASE_URL example in the snippet and shows that the path component must
include the database name.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@apps/docs/content/docs/guides/postgres/migrate-from-neon.mdx`:
- Line 50: Add a clear informational callout next to the reference to the -n
public flag explaining it restricts the dump to only the public schema and will
silently omit objects in other schemas; update the docs line that currently
shows "-n public" (and nearby explanatory text) to include a Note/Callout
stating: the -n public flag exports only the public schema, how to include
additional schemas with extra -n <schema> flags, or remove the flag to export
all schemas so users aren’t surprised by missing objects.
- Around line 44-52: The guide uses shell vars NEON_DATABASE_URL and
PRISMA_POSTGRES_DATABASE_URL in the pg_dump and pg_restore commands but never
tells readers to export them; add a short step after the connection-string
example that instructs readers to export the connection string into
NEON_DATABASE_URL (showing the example format used earlier) before running
pg_dump, and likewise instruct readers to export their direct connection string
into PRISMA_POSTGRES_DATABASE_URL before running pg_restore so the referenced
commands (pg_dump and pg_restore) will work as written.

---

Duplicate comments:
In `@apps/docs/content/docs/guides/postgres/migrate-from-neon.mdx`:
- Around line 78-82: The example DATABASE_URL in the .env snippet is missing a
database name and will fail; update the dotenv example so DATABASE_URL includes
the actual database name (e.g., replace the empty path "/" with "/DBNAME") or,
better, instruct readers to paste the full direct connection string copied from
the Prisma Console into DATABASE_URL (so the DATABASE_URL value contains the
correct host, port, database name and query params). Ensure the text references
the .env DATABASE_URL example in the snippet and shows that the path component
must include the database name.

ℹ️ Review info

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4cde0a6 and eeedb1a.

📒 Files selected for processing (1)
  • apps/docs/content/docs/guides/postgres/migrate-from-neon.mdx

coderabbitai[bot]
coderabbitai bot previously approved these changes Feb 24, 2026
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

♻️ Duplicate comments (2)
apps/docs/content/docs/guides/postgres/migrate-from-neon.mdx (2)

44-52: Env var instructions are still ambiguous — readers won't know whether to substitute inline or export first.

Line 44 says "replacing $NEON_DATABASE_URL with your actual Neon database URL", but the pg_dump command treats it as a shell variable. A reader who follows the instruction literally would do an inline substitution and get a bare URL in the command, while the variable-expansion idiom requires an export step. Neither path is explained.

The same gap exists on line 56 for $PRISMA_POSTGRES_DATABASE_URL.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@apps/docs/content/docs/guides/postgres/migrate-from-neon.mdx` around lines 44
- 52, The docs instruct users to "replace `$NEON_DATABASE_URL`" but the shown
pg_dump command uses a shell variable; update the text to explicitly show both
supported options: (1) inline substitution by replacing `$NEON_DATABASE_URL`
directly with the URL in the pg_dump command, and (2) exporting the variable
first (export NEON_DATABASE_URL="your_url") and then running pg_dump
"$NEON_DATABASE_URL"; do the same clarification for
`$PRISMA_POSTGRES_DATABASE_URL` and reference the command name `pg_dump` and the
variable names `NEON_DATABASE_URL`/`PRISMA_POSTGRES_DATABASE_URL` so readers
know which approach to use.

50-50: -n public silently drops every non-public schema — a callout is still missing.

There's no note warning readers that tables, types, functions, or sequences in schemas other than public will be silently excluded from the dump.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@apps/docs/content/docs/guides/postgres/migrate-from-neon.mdx` at line 50, Add
a clear callout immediately near the "-n public" flag explaining that using "-n
public" causes pg_dump to silently exclude all tables, types, functions, and
sequences in non-public schemas; instruct readers to either remove the "-n
public" flag to include all schemas, or explicitly include additional schemas
(or run separate dumps per schema) if they need non-public schema objects
preserved. Ensure the callout references the "-n public" flag so readers know
exactly which command option is dangerous.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Duplicate comments:
In `@apps/docs/content/docs/guides/postgres/migrate-from-neon.mdx`:
- Around line 44-52: The docs instruct users to "replace `$NEON_DATABASE_URL`"
but the shown pg_dump command uses a shell variable; update the text to
explicitly show both supported options: (1) inline substitution by replacing
`$NEON_DATABASE_URL` directly with the URL in the pg_dump command, and (2)
exporting the variable first (export NEON_DATABASE_URL="your_url") and then
running pg_dump "$NEON_DATABASE_URL"; do the same clarification for
`$PRISMA_POSTGRES_DATABASE_URL` and reference the command name `pg_dump` and the
variable names `NEON_DATABASE_URL`/`PRISMA_POSTGRES_DATABASE_URL` so readers
know which approach to use.
- Line 50: Add a clear callout immediately near the "-n public" flag explaining
that using "-n public" causes pg_dump to silently exclude all tables, types,
functions, and sequences in non-public schemas; instruct readers to either
remove the "-n public" flag to include all schemas, or explicitly include
additional schemas (or run separate dumps per schema) if they need non-public
schema objects preserved. Ensure the callout references the "-n public" flag so
readers know exactly which command option is dangerous.

ℹ️ Review info

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between eeedb1a and 3100d11.

📒 Files selected for processing (1)
  • apps/docs/content/docs/guides/postgres/migrate-from-neon.mdx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant