• Product Introduction
  • Quick Start
    • Importing a Git Repository
    • Starting From a Template
    • Direct Upload
  • Framework Guide
    • Frontends
    • Backends
    • Full-stack
      • Next.js
  • Project Guide
    • Project Management
    • edgeone.json
    • Configuring Cache
    • Error Codes
  • Build Guide
  • Deployment Guide
    • Overview
    • Create Deploys
    • Manage Deploys
    • Deploy Button
    • Use Github Actions
    • Using CNB Plugin
    • Using IDE Plug-In
    • Using CodeBuddy IDE
  • Domain Management
    • Overview
    • Custom Domain
    • Configuring an HTTPS Certificate
    • How to Configure a DNS CNAME Record
  • Pages Functions
    • Overview
    • Edge Functions
    • Node Functions
  • Log Analysis
  • KV Storage
  • Edge AI
  • API Token
  • EdgeOne CLI
  • Pages MCP
  • Integration Guide
    • AI
      • Dialogue Large Models Integration
      • Large Models for Images Integration
    • Database
      • Supabase Integration
      • Pages KV Integration
    • Ecommerce
      • Shopify Integration
      • WooCommerce Integration
    • Payment
      • Stripe Integration
      • Integrating Paddle
    • CMS
      • WordPress Integration
      • Contentful Integration
      • Sanity Integration
    • Authentication
      • Supabase Integration
      • Clerk Integration
  • Best Practices
    • Using General Large Model to Quickly Build AI Application
    • Use the Deepseek-R1 model to quickly build a conversational AI site
    • Building an Ecommerce Platform with WordPress + WooCommerce and GatsbyJS
    • Building a SaaS Site Using Supabase and Stripe
    • Building a Company Brand Site Quickly
    • How to Quickly Build a Blog Site
  • Migration Guides
    • Migrating from Vercel to EdgeOne Pages
    • Migrating from Cloudflare Pages to EdgeOne Pages
    • Migrating from Netlify to EdgeOne Pages
  • Troubleshooting
  • FAQs
  • Contact Us
  • Release Notes

Migrating from Vercel to EdgeOne Pages

This guide will help you smoothly migrate your Vercel project to EdgeOne Pages.


Preparations: Search Build Command and Output Directory

Start by finding your Vercel project's build command and output directory:
1. Log in to the dashboard and find the project to migrate.
2. Enter Settings (project setting) and select the General (common) tab.
3. In the Build and Development Settings (compilation and deployment setting) panel, record the following information:
3.1 Build Command
3.2 Output Directory



Example:
npm run build
Output Directory: build

This information will be used in project configuration.


2.Configuration Migration: Handle Redirects and Headers

If your project used a vercel.json file to configure redirects or custom headers, require migrating these configurations to the edgeone.json file in EdgeOne Pages.

Comparison example of both:

Configure the Vercel.json file.
{
"redirects": [
{
"source": "/articles",
"destination": "/blog",
"statusCode": 301
}
],
"rewrites": [
{
"source": "/assets/*",
"destination": "/assets-new/:splat"
}
],
"headers": [
{
"source": "/(.*)",
"headers": [
{
"key": "X-Frame-Options",
"value": "DENY"
},
{
"key": "Cache-Control",
"value": "max-age=7200"
}
]
},
{
"source": "/assets/*",
"headers": [
{
"key": "Cache-Control",
"value": "max-age=31536000"
}
]
}
]
}

Corresponding edgeone.json configuration:
{
"redirects": [
{
"source": "/articles",
"destination": "/blog",
"statusCode": 301
}
],
"rewrites": [
{
"source": "/assets/*",
"destination": "/assets-new/:splat"
}
],
"headers": [
{
"source": "/*",
"headers": [
{
"key": "X-Frame-Options",
"value": "DENY"
},
{
"key": "Cache-Control",
"value": "max-age=7200"
}
]
},
{
"source": "/assets/*",
"headers": [
{
"key": "Cache-Control",
"value": "max-age=31536000"
}
]
}
]
}
Note: The configuration syntax of EdgeOne Pages is very similar to Vercel, but may contain some minor differences. For detailed configuration options, refer to the edgeone.json document.


3.Function Migration: From Vercel to EdgeOne Pages

The two platforms have differences in syntax and usage. Here is a simple comparison example:

Vercel Functions Hello World:
export const dynamic = 'force-dynamic';
export function POST(request) {
return new Response(`Hello world`);
}

Pages Functions Hello World:
export default function onRequestPost(context) {
return new Response(`Hello world`);
}

main difference:
Pages use onRequest series functions (such as onRequestPost) to handle different HTTP methods.
Pages Functions receive a context object, which contains request information and environment variables.
The response method is similar, both use Response object.
Note:
Pages and Functions support Node Functions and Edge Functions, with some differences in features such as context objects. You can select based on your requirements.

Migration suggestions
Change the export function to the onRequest series functions.
If you used Vercel-specific features, you may need to find other solutions. Contact us through the community.

For detailed function usage, see Pages Functions document.


4.Project Deployment: Create a New Project on EdgeOne Pages

After preparation work is completed, create and deploy the project on Pages.
1. Log in to the Tencent Cloud console and enter Pages service.
2. Click "Create project" and select your GitHub repository.
3. In project settings, fill in the build command and output directory recorded earlier.
4. Click the "Start deployment" button, and Pages will auto-build and deploy your project.


5.Domain Configuration: Adding a Custom Domain

Migration steps
1. Add your custom domain in project settings and obtain the CNAME record value.
2. Sign in to your DNS provider console.
3. Delete the A, AAAA, or CNAME records previously set for Vercel.
4. Add a new CNAME record pointing to the new value provided by EdgeOne Pages.
5. Wait for DNS update to take effect (may take a few minutes to a few hours).

Note: If you previously used Vercel DNS, transfer the domain to another DNS provider, then configure CNAME records following the above steps.

For the detailed domain addition process, see the domain name management document.

By completing the above steps, you have successfully migrated your Vercel project to EdgeOne Pages. The two platforms have similarities in some aspects, but on a strong infrastructure, we have optimized Pages product features, such as intelligent refresh preheating, providing an out-of-the-box experience. In addition, Pages has fewer restrictions compared to competitors during the beta phase, offering more flexibility for developers. In terms of customer support, we provide more timely responses, committed to delivering a high-quality product experience for developers.

If you encounter any issues during migration, please refer to the EdgeOne Pages Documentation.