netlify-database-migration-from-extension

netlify-database-migration-from-extension is a cursor rule for coding agents from netlify/context-and-tools. It costs 16 tokens per session (2,361 once invoked), scanned A, original, MIT.

Instructions for moving a project from an existing PostgreSQL database provider to Netlify Database. PostgreSQL is a relational database system, and the process uses database export and restore tools.

In plain words
What is it for?
Use it to switch from providers such as Neon, Supabase, Amazon RDS, or a self-managed PostgreSQL server to Netlify Database.
Why use it?
It lays out the cutover steps and highlights the short period when new writes may not be copied, so teams can plan around possible data loss.

Cursor rule

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add rules/netlify/context-and-tools/netlify-database-migration-from-extension
Clone the repo
git clone --depth 1 https://github.com/netlify/context-and-tools

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for netlify-database-migration-from-extension

README.md
[![agentmods](https://agentmods.dev/badge/rules/netlify/context-and-tools/netlify-database-migration-from-extension.svg)](https://agentmods.dev/rules/netlify/context-and-tools/netlify-database-migration-from-extension)
Your own site
<a href="https://agentmods.dev/rules/netlify/context-and-tools/netlify-database-migration-from-extension"><img src="https://agentmods.dev/badge/rules/netlify/context-and-tools/netlify-database-migration-from-extension.svg" alt="Measured on agentmods" height="20"></a>
Per session 16 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,361 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00016 $0.02361
Opus 5 $0.00008 $0.01180
Sonnet 5 $0.00003 $0.00472
Haiku 4.5 $0.00002 $0.00236

Measured 4d ago against content hash 9fab91c3f53d, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

netlify-database-migration-from-extension scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

cursor/rules/netlify-database-migration-from-extension.mdc · 181 lines

How it starts

The opening of the file, as written. The whole thing — 181 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Switching to Netlify Database

Step-by-step process for switching a project from an external Postgres provider to Netlify Database (@netlify/database, NETLIFY_DB_URL). The steps are provider-agnostic — they apply whether the source is the deprecated Netlify DB extension (@netlify/neon), a standalone Neon account, Supabase, RDS, a self-managed instance, or any other hosted Postgres.

Terminology. This document uses "switch" for the provider change and "migration" exclusively for schema migration files. The two are distinct operations that happen to overlap during this process.

Brief data-loss window. This flow trades a small data-loss risk for a much simpler cutover: any writes to the source between the final export and the production deploy will not make it across. For most projects that's a few minutes. High-traffic apps should plan a maintenance window or a dual-write strategy outside the scope of this guide.

Prerequisites

  • A linked Netlify project currently serving from an existing Postgres source
  • Netlify CLI 26.0.0+ installed and authenticated
  • pg_dump and pg_restore available locally, with versions matching your source server

The shape of the switch

Three phases, each independently reversible. The source database keeps serving production traffic until the Phase 2 merge, so any rollback before that has zero user-visible impact.

  1. Phase 1 — Provision the new database alongside the source. No code or traffic changes.
  2. Phase 2 — Swap the code and rehearse on a preview deploy with real data.
  3. Phase 3 — Cut over production with a fresh data move and a merge.

Phase 1 — Provision the new database

Goal: Netlify Database is online with the correct schema baseline. App still reads from the source.

Switching from the Netlify DB extension. @netlify/database and @netlify/neon use different env vars (NETLIFY_DB_URL vs NETLIFY_DATABASE_URL) and don't conflict. Keep @netlify/neon installed and the extension configured throughout the switch — cleanup happens at the end.

Read the full file on GitHub · 181 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 4d ago First seen · 181 lines · 16 tokens per session scan A 9fab91c3f53d

Subscribe to this mod's changes

netlify-database-migration-from-extension is a cursor rule published in the GitHub repository netlify/context-and-tools (36 stars, last pushed yesterday), licensed MIT. It adds 16 tokens to every session and 2,361 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.