> Portal Navigation:
> 
> - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version.
> - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages).
> - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`).
> - Top-level index of all portals: https://dev.wix.com/docs/llms.txt
> - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt

## Resource: About Wix Site Migration to a Headless Project

## Article: About Wix Site Migration to a Self-Managed Headless Project

## Article Link: https://dev.wix.com/docs/go-headless/self-managed-headless/get-started/migrate-from-an-existing-wix-site/about-wix-site-migration-to-a-headless-project.md

## Article Content:

# About Wix Site Migration to a Self-Managed Headless Project

If you built your site with a Wix editor, you can take its frontend off Wix and host it yourself, and keep managing your business from the same dashboard. Your data and business logic stay exactly the same.

The result is a [self-managed headless](https://dev.wix.com/docs/go-headless/self-managed-headless/about-self-managed-headless.md) project, made up of your own frontend and the same backend as your editor-built site. That backend, including its dashboard, becomes the backend for your headless project.

You build, host, and maintain the frontend, and it reads and writes your project's data through Wix APIs. For flows such as checkout, login, and member accounts, you can redirect visitors to [Wix-hosted pages](https://dev.wix.com/docs/go-headless/business-solutions/wix-hosted-pages/about-wix-hosted-pages.md) instead of building them yourself against Wix APIs.

This article explains how the pieces fit together, so that the steps in [Migrate a Wix Site to a Self-Managed Headless Project](https://dev.wix.com/docs/go-headless/self-managed-headless/get-started/migrate-from-an-existing-wix-site/migrate-a-wix-site-to-a-headless-project.md) make sense.

> **Note:** If you want to keep your editor-built site as your public website and only ever use your new frontend as an additional frontend, such as a mobile app, you don't need to migrate.

## What changes and what doesn't

The migration changes what serves your public website, not the backend behind it.

### What changes

After migration:

- Your own externally hosted frontend serves your public website, instead of your editor-built site.
- If you use Wix-hosted pages, the domain your project serves directly changes to a Wix subdomain, such as `checkout.example.com`. Visitors only reach it during those flows, such as checkout or login, not while browsing your public website.
- You take on hosting, authentication, and SEO for your frontend.

### What stays the same

The migration doesn't affect any of the following:

- Your project and all its data, including your catalog, bookings, courses, forms, members, and orders.
- Your site's backend, now your project's backend, including its custom code and automations.
- Your Premium plan, which is still required for a custom domain and for payments.
- Payment processing.
- Email to your domain, as long as you change only the `A` and `CNAME` records that route visitors to your project, not the separate `MX`, `SPF`, `DKIM`, and `DMARC` records that route email.

## How your frontend connects to your project

Your frontend calls Wix APIs directly to read and write your project's data. It authenticates these calls through your [headless client](https://dev.wix.com/docs/go-headless/authentication/setup/set-up-a-headless-client.md), which tells Wix which project to connect to.

This connection doesn't depend on domains. It works the same whether your frontend runs on a preview address or your public website, which is why you can build and test it against your project before you migrate.

[Add a Frontend to an Existing Wix Site](https://dev.wix.com/docs/go-headless/self-managed-headless/get-started/add-a-frontend-to-an-existing-wix-site.md) covers building this frontend, since the build process is the same whether you plan to migrate afterward or keep the frontend as an additional frontend indefinitely. Follow that guide first, while your editor-built site keeps serving as your public website. Migrating is the separate, later step where you switch that frontend to become your public website instead.

## Your backend keeps running

Any backend you built, such as HTTP functions, scheduled jobs, service plugins, or automations, keeps running on your project. The migration doesn't touch your code.

If you use Wix-hosted pages and part of your backend, such as an HTTP function, is reachable by URL, check whether that URL changes along with your project's domain. If it does, update any hardcoded URLs in your frontend or external services to match.

## Addresses and settings

Migrating involves 2 kinds of things: your domains, and the Wix settings that reference them.

You have 2 domains:

- Your main domain, such as `www.example.com`: the address visitors already use for your public website.
- Your Wix subdomain, such as `checkout.example.com`: the address you dedicate to your project's Wix-hosted pages.

Wix has 2 settings that determine which domain plays which role, and the domain switch reassigns both of them at once:

| Setting | What it does | Before migration | After migration |
|---------|--------------|-------------------|------------------|
| Primary domain | The one domain that serves your Wix-hosted pages and backend. | Your main domain. | Your Wix subdomain. |
| [Wix pages domain](https://dev.wix.com/docs/go-headless/business-solutions/wix-hosted-pages/set-a-domain-for-wix-hosted-pages.md) | The address visitors see while on a Wix-hosted page. | Not set. | Your Wix subdomain. |

Wix also has a 3rd setting, [frontend link](https://dev.wix.com/docs/go-headless/project-management/add-a-frontend-link.md), that doesn't change during the switch. You set it to your main domain before the switch happens, and Wix uses it in emails and notifications, and as a return address after a Wix-hosted flow.

### Primary domain and Wix pages domain

Primary domain and Wix pages domain end up pointing at the same Wix subdomain, which is what makes them easy to confuse. They have to match, because a secondary domain redirects to the primary domain instead of serving pages, so Wix-hosted pages only load at your Wix pages domain if that domain is also your project's primary domain.

They stay 2 separate settings because primary domain is a general Wix setting, while Wix pages domain is specific to configuring your Wix-hosted pages.

### Redirect settings

Visitors reach the Wix pages domain through a short-lived [redirect session](https://dev.wix.com/docs/go-headless/business-solutions/wix-hosted-pages/redirect-using-the-js-sdk.md), and return to your frontend when the flow finishes.

In addition to setting your Wix pages domain, you update your headless client's redirect settings, so that Wix can send visitors back to your frontend after login and checkout. For details, see [Allow Redirect URIs and Domains](https://dev.wix.com/docs/go-headless/authentication/setup/allow-redirect-uris-and-domains.md).

## Why the domain switch happens in a single step

Most of the work happens safely before you migrate. Only the domain switch changes your live site, and it happens in a single coordinated step.

Every Wix site, including your project, serves its own pages on exactly 1 domain at a time, called its primary domain. Any other domain connected to the project redirects to the primary domain instead of serving pages of its own. Right now, that's your main domain, since it's the domain currently serving your editor-built pages.

The following table shows what changes:

| Domain | Before migration | After migration |
|--------|-------------------|------------------|
| Main domain, such as `www.example.com` | Your project's primary domain. Serves your editor-built pages. | Points to your external host. Serves your frontend. |
| Wix subdomain, such as `checkout.example.com` | Not connected to your project. | Your project's new primary domain. Serves your Wix-hosted pages and backend. |

Migrating doesn't add a second primary domain. It reassigns that role from your main domain to your Wix subdomain, so your main domain has to give up the role at the same moment your Wix subdomain takes it on. That's why the reassignment happens in a single step. You point your main domain at your external host and disconnect it from your project, while your Wix subdomain becomes the project's new primary domain.

Everything else, such as building and testing your frontend or updating your headless client's redirect settings, is safe to prepare ahead of time, without affecting your live site.

## SEO and redirects

On a self-managed headless project, you're responsible for your public website's SEO, including metadata, redirects, and canonical tags, which tell search engines which version of an address is official.

Plan for a few kinds of redirects:

- Redirects to your canonical address: Your host sends visitors from other versions of your address to your single canonical address. For example, redirect `http://` to `https://`, and `example.com` to `www.example.com`.
- Redirects from old page paths: If a page's URL changed in your frontend, add a permanent (301) redirect from the old Wix path to the new one. Search engines and bookmarks can point to old paths for months, so these redirects protect your traffic and rankings.
- Redirect sessions for Wix-hosted flows: Checkout and login use short-lived redirect sessions that send a visitor to a Wix-hosted page and back. These handle a single flow and don't replace the permanent redirects above.

## See also

- [Migrate a Wix Site to a Self-Managed Headless Project](https://dev.wix.com/docs/go-headless/self-managed-headless/get-started/migrate-from-an-existing-wix-site/migrate-a-wix-site-to-a-headless-project.md)
- [About Self-Managed Headless](https://dev.wix.com/docs/go-headless/self-managed-headless/about-self-managed-headless.md)
- [Add a Frontend to an Existing Wix Site](https://dev.wix.com/docs/go-headless/self-managed-headless/get-started/add-a-frontend-to-an-existing-wix-site.md)