--- title: "Migrate from Vercel to Miget" description: "Move your Next.js app from Vercel's serverless model to a long-running Node server on Miget." --- Vercel runs your Next.js app as serverless and edge functions. Miget runs the same app as one long-running Node server started with `next start`. Your pages and API routes live inside a single persistent process, and you deploy from GitHub with automatic PR previews. This guide maps your Vercel setup onto Miget and walks you through the move. ## What maps to Miget | On Vercel | On Miget | | --- | --- | | Serverless Next.js functions | Long-running Next.js app (`next start`) | | Preview Deployment | PR preview via GitHub integration | | Vercel Postgres | [Miget managed PostgreSQL](/databases/postgresql) | | Vercel KV | [Miget Valkey (Redis-compatible)](/databases/valkey) | | Environment Variables | [Miget environment variables](/deployments/using-secrets) | ## Migration steps Follow the [Next.js quickstart](/quick-start/nextjs). Miget auto-detects Node from your `package.json`, and `next start` binds to the injected `PORT=5000`. Connect your repository through the [GitHub integration](/deployments/github-integration) for auto-deploy on push and PR previews - the equivalent of Vercel preview deployments. You do not need a custom server file. Keep your existing `build` and `start` scripts; Miget runs `next start` against the injected `PORT`. Provision [Miget PostgreSQL](/databases/postgresql) to replace Vercel Postgres and [Valkey](/databases/valkey) to replace Vercel KV. Both inject connection strings for you: `DATABASE_URL` for PostgreSQL and `REDIS_URL` for Valkey. Migrate your existing Postgres data with `pg_dump` from your Vercel database and `pg_restore` into the Miget database. ```bash # Dump from Vercel Postgres (use your Vercel database's connection string) pg_dump "$VERCEL_DATABASE_URL" -Fc -f dump.pgdump # Restore into Miget (DATABASE_URL is injected by the addon) pg_restore --no-owner --dbname="$MIGET_DATABASE_URL" dump.pgdump ``` Copy your Vercel Environment Variables into Miget as [environment variables](/deployments/using-secrets). `DATABASE_URL`, `REDIS_URL`, and `PORT` are injected automatically, so read them from the environment rather than hardcoding values. Add your custom domain and let Miget issue TLS automatically. See [custom domains](/networking/custom-domains/overview) for DNS records and verification. This is a model change, not just a host change. On Vercel each request runs in an isolated serverless or edge function; on Miget your whole app runs as one long-running Node process. That means no per-request cold starts, but you now manage a persistent server: in-process state persists between requests, and you should watch memory and connections over time. Background work is a long-running part of your app or a scheduled cron job, not a per-invocation serverless function. ## Next steps Deploy your Next.js app on Miget from scratch. Set up auto-deploy and PR previews. Provision a database and read `DATABASE_URL`. Add a Redis-compatible cache via `REDIS_URL`. Manage secrets and config for your app. Understand how Miget shares compute across your apps. Where the per-seat model bites, and what replaces it.