Vercel → Cloudflare Pages
Move a Vercel project to Cloudflare Pages while translating build settings, functions, edge behavior, environment values, domains, redirects, analytics, previews, and a measured rollback.
Should you make this move?
Both platforms have a case. Compare what you gain with what you give up before scheduling the cutover.
Vercel
- Exceptional frontend previews and framework integration make releases fast and polished
- Managed deployments reduce infrastructure and release-management work
- Costs and proprietary platform features can grow rapidly with traffic and complexity
- Runtime assumptions, platform services, and pricing models shape the architecture
Cloudflare Pages
- Static sites deploy globally with simple previews and strong Cloudflare integration
- Managed deployments reduce infrastructure and release-management work
- Pages-specific workflows and Functions constraints can limit complex full-stack applications
- Runtime assumptions, platform services, and pricing models shape the architecture
Cloudflare Pages: Static sites deploy globally with simple previews and strong Cloudflare integration. This removes a major source-side concern: Costs and proprietary platform features can grow rapidly with traffic and complexity.
What you lose: Exceptional frontend previews and framework integration make releases fast and polished. What you inherit: Pages-specific workflows and Functions constraints can limit complex full-stack applications.
Jump to a section
Know the shape of the move.
This timeline assumes
- A static or Pages-compatible project with one production domain.
- Vercel serverless functions are treated as a separate rewrite because Cloudflare's guide says they are not supported directly in Pages.
- The Git repository remains canonical.
- Secrets are re-entered and rotated.
- Vercel stays intact through verification.
What survives the move.
“Partial” and “manual” are not footnotes. They are work that must be scheduled and verified.
| Item | Outcome | Impact | What happens | Mitigation |
|---|---|---|---|---|
| Static build output | clean | critical | Pages can run the build command and publish the output directory. | Pin runtime and compare artifacts. |
| Vercel serverless functions | lost | critical | Cloudflare's migration guide says these are not directly supported in Pages. | Rewrite as Pages Functions, Workers, or an external service. |
| Edge middleware and edge functions | manual | critical | Runtime APIs and routing differ. | Translate and test every request path. |
| Environment variables and secrets | manual | critical | Values and environment scope do not transfer. | Inventory, rotate, and configure production/preview separately. |
| Redirects, rewrites, and headers | partial | high | vercel.json semantics differ from Pages files and Functions. | Translate and test every rule with status and header assertions. |
| Preview deployments | partial | medium | Both platforms support previews but URLs, protection, aliases, and hooks differ. | Rebuild branch and access policy. |
| Domains and TLS | manual | critical | Domain association and DNS require cutover. | Pre-validate hostname and certificate. |
| Vercel Analytics, Speed Insights, and logs | lost | high | History and product integrations remain at Vercel. | Export baselines and choose Cloudflare or external observability. |
| Image optimization | manual | high | Framework and platform image behavior can differ. | Choose a Cloudflare-compatible image path and verify formats/cache. |
| Cron, storage, queues, and integrations | manual | critical | Platform resources require explicit replacements. | Map each binding and test its failure path. |
Where each thing goes.
| Source | Destination | Method | Notes |
|---|---|---|---|
| Build Command | Pages build command | automatic | Pin runtime and package manager. |
| Output Directory | Pages output directory | automatic | Verify artifact root. |
| Environment variable | Pages variable/secret | manual | Separate preview and production. |
| Vercel Function | Pages Function/Worker | manual | Rewrite runtime APIs. |
| Redirect/rewrite/header | _redirects, _headers, or Function | transform | Test precedence. |
| Cron | Worker cron trigger | manual | Preserve timezone and idempotency. |
| Custom domain | Pages custom domain | manual | Switch DNS after preview passes. |
| Vercel integration | No destination | unsupported | Install Cloudflare-native replacement. |
Make the move recoverable.
Create the source-of-truth backup
Preserve source, deployment configuration, variables, domains, functions, rules, and operating evidence.
- Record build/runtime settings, framework, domains, aliases, variables, functions, middleware, rules, cron, storage, analytics, logs, and integrations.
- Export variables names and owners without exposing values.
- Download or record the known-good deploy and commit.
- Crawl production routes and headers.
- Record DNS and rollback values.
Proof to capture: A manifest covers every build setting, route rule, runtime feature, binding, domain, and integration.
Runtime translation
Replace Vercel-only execution paths.
- Inventory functions and middleware.
- Map APIs and bindings.
- Run unit, integration, and failure tests.
Proof to capture: Save the input, output, command or tool settings, warnings, and final item counts.
Routing contract
Preserve public request behavior.
- Translate rules.
- Test status, location, headers, and body.
- Check precedence and loops.
Proof to capture: Save the input, output, command or tool settings, warnings, and final item counts.
The things most likely to hurt.
These are operating limits. Treat every “Stop if” condition as a blocked migration, not a suggestion.
Static preview hides missing functions
Pages load but API paths fail.
- Consequence
- Production runtime breaks.
- Mitigation
- Inventory and exercise every dynamic route.
Stop if: Any production function lacks a tested replacement.
Secret scope changes
Preview builds can read production secrets.
- Consequence
- Credential exposure.
- Mitigation
- Separate environments and rotate values.
Stop if: Any preview can access production-only data.
Redirect precedence changes
Rules loop, chain, or return wrong content.
- Consequence
- SEO and application failure.
- Mitigation
- Test the full route matrix.
Stop if: Any critical route changes status or destination.
Do the work in this order.
- Days 1–2 · inventory
Inventory
6–10 hours active2 days elapsedOwner review waiting- Inventory build, runtime, routing, data, and integrations.
- Choose replacements.
Depends on: Vercel and Cloudflare access
Stop / go checkpointBuild?
Go when: Every runtime feature is mapped.
Stop when: Critical Vercel-only behavior is unknown.
- Days 3–4 · static
Static build
4–7 hours active2 days elapsedBuilds waiting- Create Pages project.
- Match build and artifact settings.
- Compare static output.
Depends on: Inventory
Stop / go checkpointTranslate?
Go when: Static routes and assets pass.
Stop when: Build is nondeterministic.
- Days 5–8 · runtime
Runtime and routing
10–22 hours active4 days elapsedCode review waiting- Rewrite functions and middleware.
- Configure variables, rules, bindings, and observability.
Depends on: Static build
Stop / go checkpointRehearse?
Go when: Every dynamic and failure path passes.
Stop when: Critical behavior differs.
- Days 9–11 · rehearse
Production rehearsal
3–8 hours active3 days elapsedPreview and DNS waiting- Crawl preview.
- Test performance, security, cron, integrations, and rollback.
Depends on: Runtime
Stop / go checkpointCut over?
Go when: Route and operational checks pass.
Stop when: Any blocking check fails.
- Days 12–15 · cutover
Domain switch
2–8 hours active2–4 days elapsedDNS and observation waiting- Freeze deploys.
- Attach domain and switch DNS.
- Monitor and verify.
Depends on: Rehearsal
Stop / go checkpointClose rollback?
Go when: Seven days or agreed window is stable.
Stop when: Critical route, function, or metric regresses.
Cut over with a way back.
Cutover
Route production to Cloudflare Pages while Vercel remains recoverable.
- Freeze Vercel and repository deploys.
- Deploy the approved commit to Pages.
- Verify variables, functions, rules, bindings, and TLS.
- Switch the custom domain.
- Run production route and integration tests.
- Keep Vercel intact.
Proof to capture: Cloudflare serves the canonical domain and every blocking route/runtime check passes.
Rollback
Restore Vercel routing without losing configuration changes.
- Stop Pages-related scheduled writes.
- Restore DNS/domain association to Vercel.
- Restore integrations and webhooks.
- Run the route and runtime suite.
- Preserve Cloudflare deployment for analysis.
Proof to capture: Vercel again serves the approved release and all critical routes.
- Critical function failure
- Route or header regression
- Secret exposure
- Domain/TLS failure
- Data-binding failure
Prove the migration worked.
Every blocking check must pass. Capture the evidence before cleanup begins.
| Pass | ID | Check | Method | Expected result | Evidence |
|---|---|---|---|---|---|
V-01Blocking | Artifact parity | Compare routes and key asset hashes. | Approved output. | Build report. | |
V-02Blocking | Functions | Exercise success and failure paths. | Correct status, body, and side effect. | API log. | |
V-03Blocking | Rules | Assert redirects, rewrites, headers, and 404s. | Exact contract. | Route matrix. | |
V-04Blocking | Variables | Audit environment and scope. | Correct least-privilege values. | Config audit. | |
V-05Blocking | DNS and TLS | Resolve and inspect. | Cloudflare target and valid cert. | DNS/TLS output. | |
V-06Blocking | Cron and integrations | Trigger each. | One correct execution. | Job log. | |
V-07Blocking | Logs and alerts | Generate known events. | Signals arrive and alerts fire. | Alert evidence. | |
V-08 | Critical pages | Compare synthetic results. | Within approved thresholds. | Performance report. |
Remove the scaffolding safely.
Safe after: Seven stable days and all scheduled/runtime paths pass.
- Archive Vercel settings and evidence.
- Revoke obsolete tokens and integrations.
- Remove old DNS records.
- Keep Vercel project through retention.
- Cancel paid resources only after billing review.
- Schedule quarterly route and recovery checks.
When the plan met reality.
First-hand accounts are preferred. Vendor case studies are labeled, and every note below is an editorial paraphrase—follow the link for the full context.
Puvaan Raaj moved a personal site from Next.js on Vercel to Astro on Cloudflare Pages after encountering cold-start and bandwidth concerns that did not fit a mostly static workload. The author selected an Astro template, connected the repository, configured the build command and output directory, and reports completing the site preparation in under an hour. SSL, caching, and edge delivery were then handled by the platform.
- Separate framework requirements from hosting requirements because this account changed both Next.js and Vercel at the same time.
- Confirm that the site is truly static before using this migration's easy setup and cost profile as an expectation.
- A content-oriented personal site did not need the serverless behavior that had introduced cold starts and usage concerns.
- The smooth deployment reflects a small static workload and should not be generalized to a stateful Next.js application.
Verify against the primary material.
Platform behavior changes. Check these sources and the review dates above before executing a production migration.
- Cloudflare: migrate from VercelAccessed 2026-07-19
- Cloudflare Pages framework guidesAccessed 2026-07-19
- Vercel project configurationAccessed 2026-07-19