@vercel/kv and @vercel/postgres sunset

Vercel KV and Postgres Migration: free readiness score

Paste code that imports @vercel/kv or @vercel/postgres. Get a Readiness Score and every call that must move to Upstash Redis or Neon.

✓ Runs 100% in your browser✓ Free score, no signup✓ Instant download after checkout✓ Free terminal scanner
❌ Legacy / Vulnerable Code
βœ… PatchVault Auto-Fixed Code
    β€”Time saved (est.)
    β€”Engineering cost saved (est. @ $75/h)

    Or scan your whole repo locally (Python 3, stdlib only):

    $python3 <(curl -sL https://patchvault-81y.pages.dev/starters/vercel-kv-scan.py)

    Estimate: 1.5 h per CRITICAL, 1.0 h per HIGH, 0.5 h per MEDIUM issue (find, rewrite, re-test by hand). Nothing you paste leaves this tab.

    Before: @vercel/kv
    import { kv } from '@vercel/kv'
    await kv.set('k', v)
    After: Upstash Redis
    import { Redis } from '@upstash/redis'
    const kv = Redis.fromEnv()
    await kv.set('k', v)
    $19$9one-time, no subscription. 10-second fix bundle. Get the fix bundle

    100% Working Patch Guarantee β€” full refund if it doesn't pass your build check
    Refund requests: open a Discussion at patchvault-81y.pages.dev

    The math: Rewriting KV and SQL calls by hand across a codebase takes an afternoon, about $300 at $75/h. The bundle is $9.

    Key Takeaways

    • Vercel moved KV and Postgres stores to Upstash Redis and Neon; the @vercel/kv and @vercel/postgres packages are deprecated.
    • Your data was moved for you, but your code still imports the old packages.
    • The free checker lists every import; the $9 bundle swaps them for @upstash/redis and @neondatabase/serverless.

    Free instant diagnostic: your Readiness Score

    What the $9 bundle contains

    • Codemod for @vercel/kv and @vercel/postgres imports
    • Env var mapping table
    • AI repair prompts
    • Checklist

    Who this is NOT for

    • Teams with a dedicated platform engineer who already scripted this migration
    • Anyone who enjoys reading changelogs line by line
    • Repos that the free score already rates 100/100

    Vercel storage migration: this bundle vs by hand

    This toolManual / ChatGPT
    Finds every issueYes, file and lineMisses files you did not paste
    TimeAbout 10 seconds1 to 3 hours
    CostOne-time feeYour hourly rate
    Runs offlineYesNo

    Run Free 10-Second Terminal Scan

    Paste this in your project folder. One Python 3 file, standard library only, nothing is uploaded. It checks for @vercel/kv and @vercel/postgres code and env vars and prints a 0-100 score.

    python3 <(curl -sL https://patchvault-81y.pages.dev/starters/vercel-kv-scan.py) .
    View the script

    @vercel/kv and @vercel/postgres: which option is best suited for you

    OptionBest Suited ForCost
    Free checker on this pageListing every old import in secondsFree
    $9 fix bundleTeams who want the codemod, env-var map and checklist$9 one-time
    Upstash and Neon docs by handProjects with a handful of call sitesFree, 1-3 hours
    Leaving the old packagesPrototypes you will not touch againFree, deprecated

    ⚑ Building a dev tool? Get featured in our comparison table & GitHub Wiki ($49) β†’

    Exact errors this fixes

    Error: @vercel/kv: Missing required environment variables KV_REST_API_URL

    Env names change with the marketplace integration. The bundle maps them.

    @vercel/kv & @vercel/postgres are deprecated on npm β†’ Upstash Redis + Neon

    Your Vercel KV & Postgres data already moved. Move your code in one command.

    Vercel moved KV stores to Upstash Redis and Postgres databases to Neon; the old SDKs are deprecated. Paste your code and instantly see every @vercel/kv and @vercel/postgres call with the exact Redis.fromEnv() / neon() replacement, including the traps ({ rows } shape, scanIterator, db.connect(), Node 19+). Free, 100% in your browser.

    Every rule checked against the real npm packages (@upstash/redis 1.40, @neondatabase/serverless 1.2) and the official Neon / Upstash / Vercel docs Β· nothing leaves your browser

    Free checker

    Paste package.json, route handlers, server components, server actions or lib files. Separate files with a line like // app/api/route.ts to get per-file results.

    Before β†’ after (what --fix does)

    Before Β· @vercel/kv + @vercel/postgres

    import { kv } from '@vercel/kv'import { sql } from '@vercel/postgres' export async function GET() {  const hits = await kv.incr('hits')  const { rows } =    await sql<User>`SELECT * FROM users`  return Response.json({ hits, rows })}

    After Β· @upstash/redis + Neon

    import { sql } from '@/lib/db/neon-compat'import { Redis } from '@upstash/redis'const kv = Redis.fromEnv() // reads KV_REST_API_*export async function GET() {  const hits = await kv.incr('hits')  const { rows } =    await sql<User>`SELECT * FROM users`  return Response.json({ hits, rows })}

    Your { rows } destructuring and sql<User> generics keep working: the pack writes lib/db/neon-compat.ts, a 30-line wrapper on neon(url, { fullResults: true }) that reads the same POSTGRES_URL as before (then DATABASE_URL). Redis.fromEnv() reads your existing KV_REST_API_URL/TOKEN, so no env renames.

    Migration map

    @vercel/kv Β· @vercel/postgresUpstash Β· NeonPack
    import { kv } from '@vercel/kv'Redis.fromEnv() from @upstash/redisβœ“ auto
    createClient({ url, token }) (KV)new Redis({ url, token })βœ“ auto
    kv.scanIterator() & h/s/z variantsscanIterator(kv, opts) helper (generated)template + flag
    sql`…`, sql<T>`…`, sql.query()same calls via neon(url, { fullResults: true }) shimβœ“ auto
    Pool, Client, QueryResult, types …same names from @neondatabase/serverlessβœ“ auto
    db.connect() / sql.connect()new Pool() per request (+ ws on Node ≀21)flag + recipe
    createPool(), postgresConnectionString()new Pool({ connectionString }), process.env.POSTGRES_URLflag + recipe
    sql('… $1', [v]) plain callsql.query('… $1', [v]) (Neon 1.x throws)flag
    package.json deps + engines.node < 19@upstash/redis, @neondatabase/serverless, Node 20+βœ“ deps / flag engines

    The 4 ways a hand migration breaks production

    { rows } is undefined

    neon() returns an array, not a QueryResult. A blind search-and-replace turns every const { rows } = await sql`…` into undefined at runtime, with no type error if you used any.

    scanIterator is gone

    @vercel/kv added scanIterator/hscanIterator/…; @upstash/redis doesn't have them. Cache-busting and session cleanup jobs crash.

    connect() doesn't exist

    Transactions via db.connect() need a Neon Pool created and closed per request (plus ws on Node ≀21).

    Node 18 builds fail

    @neondatabase/serverless 1.x needs Node 19+, and sql('…') plain calls now throw. The checker flags your engines and every call.

    How it works

    Check
    node cli.js . --md report.md lists every finding with file:line and the fix.
    Preview
    --dry-run prints the unified diff. Nothing is written.
    Fix
    --fix rewrites safe patterns (.bak backups), writes the shim + scan helper, updates package.json.
    Gate
    --ci exits 1 until nothing breaking is left. Put it in your pipeline.

    Vercel KV & Postgres β†’ Upstash + Neon Migration Pack

    • Codemod CLI (node cli.js . --fix): rewrites @vercel/kv imports, require() and createClient to @upstash/redis; moves sql/db to a Neon shim and Pool/Client/type re-exports to @neondatabase/serverless; updates package.json. Only exact, known-safe patterns; .bak backups; --dry-run diff.
    • Generated helpers (TS + JS): lib/db/neon-compat (keeps { rows, rowCount, fields } + sql<T>) and lib/kv-scan (scan/hscan/sscan/zscan iterators). TypeScript passes tsc --strict against the real packages.
    • CI gate + reports: --ci, --json, --md checklist report.
    • 17-step migration checklist (env vars, Pool transactions, preview branches, ORMs) + 34 regression tests + fixtures; every rule cites npm, Neon, Upstash or Vercel.
    $9 one-time Β· USD

    Instant download: after checkout you're redirected straight to your private download page. Zero dependencies, runs locally on Node 18+.

    Get the 10-Second Fix Bundle β€” $9

    Cheaper than one hour of debugging a broken { rows }. Questions or download problems? GitHub issues.

    Methodology

    The free checker runs entirely in your browser: it matches the text you paste against rules written from the official changelogs and migration guides. Nothing is uploaded. The paid deliverables are files (codemod, templates, checklist) unlocked right after checkout; each pack is tested against the fixtures shipped inside it.

    Sources and free assets: GitHub release Β· GitHub Wiki guide. Contact and support: open a Discussion at patchvault-81y.pages.dev.

    Last Updated:

    FAQ

    Is @vercel/kv deprecated?

    Yes. @vercel/kv 3.0.0 is deprecated on npm with the message "Vercel KV is deprecated. If you had an existing KV store, it should have moved to Upstash Redis". Vercel moved existing KV stores to Upstash Redis in December 2024. The replacement SDK is @upstash/redis; @vercel/kv was itself a thin subclass of its Redis client.

    Is @vercel/postgres deprecated?

    Yes. @vercel/postgres 0.10.0 is deprecated on npm and Vercel Postgres databases were moved to Neon as a native Vercel integration in December 2024. Neon's official guide replaces it with @neondatabase/serverless (the neon() HTTP driver or its Pool/Client).

    Do I need to move my data?

    No. Vercel already moved existing stores: your KV data is in an Upstash Redis database and your Postgres data is in a Neon database, both linked to your Vercel project. You only need to migrate your code off the deprecated SDKs.

    Do I have to rename KV_REST_API_URL and KV_REST_API_TOKEN?

    No. Redis.fromEnv() in @upstash/redis reads UPSTASH_REDIS_REST_URL and UPSTASH_REDIS_REST_TOKEN and falls back to KV_REST_API_URL and KV_REST_API_TOKEN, so `const kv = Redis.fromEnv()` works with your existing env vars.

    Why does const { rows } = await sql`...` break after switching to neon()?

    neon() returns just the array of rows by default, while @vercel/postgres returned a node-postgres QueryResult with rows, rowCount and fields. Either change the call sites to `const rows = await sql`...``, or create the client with neon(url, { fullResults: true }). The pack's generated lib/db/neon-compat shim uses fullResults so your existing code and sql<T> generics keep working.

    What replaces sql.connect() and db.connect()?

    The neon() HTTP driver has no connect(). For interactive transactions or sessions use Pool or Client from @neondatabase/serverless (WebSockets; on Node 21 and earlier set neonConfig.webSocketConstructor = ws), created and closed inside the request. For non-interactive batches, sql.transaction([...]) works over HTTP.

    What replaces kv.scanIterator()?

    @upstash/redis has scan, hscan, sscan and zscan but not the *Iterator helpers that @vercel/kv added. The pack writes a lib/kv-scan helper with the same async-iterator API and the checker flags every call.

    Is my code uploaded anywhere?

    No. This free checker runs entirely in your browser. The paid pack is a zero-dependency Node.js CLI that runs locally on your repo.

    How do I get the pack after paying?

    Instantly: after checkout Stripe redirects you to your private download page (the unlock key is in the link). Save the link; it is your copy.

    More migration packs

    Supabase auth-helpers β†’ @supabase/ssr

    Free checker + codemod for createClientComponentClient, createServerComponentClient, middleware β†’ proxy.

    Shopify CLI 5.0 checker

    Find what breaks in your theme/app workflow before upgrading Shopify CLI.

    Free starter scanners: all PatchVault tools

    10-Second Fix Bundle β€” $9