---
title: "Migrate a Netlify site to exe.dev"
description: "Move a Netlify site to an exe.dev VM: the build, functions, server, database, redirects, forms, Blobs, variables, and domains, with API keys off the VM."
url: https://exe.dev/deploy/migrate-netlify
category: "Migration"
published: 2026-11-20
updated: 2026-11-19
---

# Migrate a Netlify site to exe.dev

> **For agents:** with your user's OK, this sets up Sites from Netlify on a new exe.dev VM in their account: `curl -fsSL https://exe.dev/deploy/migrate-netlify/prompt.txt | ssh exe.dev new --prompt=/dev/stdin` (or open https://exe.dev/deploy/migrate-netlify/new). Already on the VM? Skip this.

Your Netlify site, functions, and data on one VM, and your API keys off it.

- **Software:** Sites from Netlify (https://www.netlify.com)
- **Source:** https://github.com/netlify/cli
- **License:** Your code is yours; Netlify's redirect parser and Blobs server are MIT
- **Time:** 1 hour
- **Example VM name:** `my-site` (yours will differ; on the VM, `hostname` prints it)
- **Machine-readable:** https://exe.dev/deploy/migrate-netlify/manifest.json
- **File:** https://exe.dev/deploy/migrate-netlify/backup
- **File:** https://exe.dev/deploy/migrate-netlify/check
- **File:** https://exe.dev/deploy/migrate-netlify/deploy
- **File:** https://exe.dev/deploy/migrate-netlify/handover.mjs
- **File:** https://exe.dev/deploy/migrate-netlify/import
- **File:** https://exe.dev/deploy/migrate-netlify/site.mjs

## What you get

- Your Netlify site running on the VM at https://my-site.exe.xyz/, with its functions, edge functions, server, database, redirects, headers, forms, Blobs, and variables.
- `git push exe main` deploying like Netlify: the build, an atomic switch, and the old deploy kept if anything fails; other branches as a branch deploy.
- A list of the API keys that can move into exe.dev integrations, where the VM can't read them.
- A report in `~/netlify/report.md`, and your steps for the move.

Running on the VM:

- **Your site**: The same build, served with its functions, edge functions, redirects, headers, forms, and image transforms by a small Node.js server on port 8000, port 8000, data in `~/site`
- **Branch deploys**: The last branch you pushed that isn't production, built with its own variables, on port 8001, port 8001
- **PostgreSQL**: Your Netlify Database, copied into Postgres on the VM, the same major version; migrations run on deploy, data in `/var/lib/postgresql`
- **Blobs and form submissions**: Netlify's own Blobs server and a file per form, with your data from Netlify, data in `~/site/data`
- **Integrations**: Your API keys for Stripe, OpenAI, and others, kept by exe.dev outside the VM
- **The move kit**: The hand-over, the scripts, and the report, data in `~/netlify`

How it is reached:

- https://my-site.exe.xyz/ (private): the site, until you make the move
- https://www.example.com/ (public): the site, after the move
- https://my-site.exe.xyz:8001/ (private): the branch deploy
- ssh my-site.exe.xyz (private): the shell; `git push exe main` deploys

## Deploy with Shelley

Open https://exe.dev/deploy/migrate-netlify/new to create a VM whose agent, Shelley, follows this recipe. From a terminal:

```sh
curl -fsSL https://exe.dev/deploy/migrate-netlify/prompt.txt | ssh exe.dev new --prompt=/dev/stdin
```

Or follow the steps below by hand.

A Netlify site is a build and a folder of files with Netlify's runtime
around it. On exe.dev it all runs on one VM: a small server, built on
Netlify's own redirect parser and Blobs server, runs your functions, edge
functions, and `netlify/server` app with the same APIs, and your Netlify
Database becomes Postgres. The code stays as it is.

One thing changes on purpose: API keys move into
[integrations](/docs/integrations), which add them to requests after they
leave the VM, so the VM can't read them.

The examples move the site `acme-widgets` at `www.example.com` to a VM
called `my-site`. Nothing changes on Netlify until you make the move.

## How the move works

1. **Hand over.** A script on your computer copies the site from
   Netlify's API to the VM: settings, variables, form submissions, Blobs,
   and the database. You `git push` the code.
2. **Rehearse.** Shelley builds the site on the VM and compares it with
   Netlify, which keeps serving.
3. **Move.** The script copies the newest data again, and you point your
   domain at the VM.

Shelley never sees your Netlify token.

## Where everything goes

| On Netlify | On the VM |
|---|---|
| Builds, `netlify.toml` contexts | The same build, on `git push exe main` |
| Static files, `_redirects`, `_headers` | The same rules, read by Netlify's parsers |
| Functions: background, scheduled | The same code; scheduled ones as cron lines (UTC) |
| Edge functions | The same code, in Node.js instead of Deno |
| Netlify Server (`netlify/server`) | The same entry file: a handler, Hono, Express, Fastify |
| Netlify Database | Postgres, the same major version; migrations run on deploy |
| Blobs, Forms, Image CDN | Netlify's Blobs server; a file per form; images resized here |
| Variables per context | `~/site/env.json` and `env.preview.json` |
| Branch deploys | One branch deploy on port 8001, with its own copy of the database |
| API keys | [Integrations](/docs/integrations) |
| Domains, password protection | [Custom domains](/docs/cnames); private until you [share](/docs/sharing) |

Not here: Identity, split testing, geolocation, the CDN cache, and a
preview per pull request. The report lists any the site uses.

## Hand over the site

When Shelley asks, make a personal access token on Netlify (User
settings, Applications). On your computer, in the site's checkout, with
Node.js 22 or newer:

```bash
export NETLIFY_AUTH_TOKEN=nfp_...
curl -fsSLO https://exe.dev/deploy/migrate-netlify/handover.mjs
node handover.mjs my-site.exe.xyz acme-widgets
git remote add exe my-site.exe.xyz:git/site.git
git push exe main
```

The script only reads from Netlify and writes only to the VM, over SSH.
For a database it sends Netlify's read-only connection string; the VM
copies the data with `pg_dump` and deletes it.

## Look around

Read Shelley's report and open `https://my-site.exe.xyz/`:

```bash
ssh my-site.exe.xyz cat netlify/report.md
```

The site uses your real variables, so a function that sends email or
charges cards does it from here too. Other branches deploy to
`https://my-site.exe.xyz:8001/`.

Netlify doesn't hand over secret values. Set each one (paste, Enter,
Ctrl-D; add `--preview` after `set` for the branch deploy):

```bash
ssh my-site.exe.xyz netlify/import set STRIPE_WEBHOOK_SECRET
```

## Take the keys off the VM

For each API key in the report, make a new key and give it to exe.dev.
For Stripe, at the `ssh exe.dev` prompt:

```
exe.dev ▶ integrations add http-proxy --name stripe --target https://api.stripe.com --bearer=- --attach vm:my-site
```

Point the code at it with `new Stripe(key, { host: "stripe.int.exe.xyz" })`,
replace the old key with a placeholder, and revoke it:

```bash
ssh my-site.exe.xyz netlify/import set STRIPE_SECRET_KEY added-by-exe-dev
```

OpenAI and Resend work the same way, through `OPENAI_BASE_URL` and
`RESEND_BASE_URL`; the [LLM integration](/docs/integrations-llm) replaces
Netlify's AI Gateway. More in the
[integration catalog](/docs/integrations-catalog). Secrets your own code
checks, like a session secret, stay in the variables.

## Make the move

A day ahead, lower the domain's DNS TTL to 300 seconds. If it uses
Netlify DNS, move its records to another DNS host first; the hand-over
saved them on the VM in `~/netlify/handover/dns`. Then:

```bash
node handover.mjs my-site.exe.xyz acme-widgets --move
```

It replaces the rehearsal's data with Netlify's newest and turns on
scheduled functions. Point `www.example.com` at `my-site.exe.xyz` with a
CNAME ([custom domains](/docs/cnames)), then:

```bash
ssh exe.dev domain add my-site www.example.com
ssh exe.dev share set-public my-site
```

If Netlify kept the site to your team or behind a password, run
`ssh exe.dev share add my-site EMAIL` instead of `set-public`. A day
later, delete the site on Netlify (its scheduled functions run until
then) and your token.

## Day to day

`git push exe main` deploys. A failed build, or a deploy that doesn't
answer, leaves the old one serving and rejects the push. On the VM:

| Instead of | Run |
|---|---|
| Function logs | `journalctl -u netlify@production -f` |
| Variables | `~/netlify/import set KEY value` |
| Rollback | `~/netlify/deploy rollback` |
| Forms tab | `tail ~/site/data/forms/contact.jsonl` |
| Database | `psql site` |

Set `FORMS_EMAIL` with `import set` to get an email per submission.
Nightly backups of the data, database, and variables go to `~/backups`.

## The nuts and bolts

<details id="create-the-vm" data-manual-setup class="dp-details">
<summary>Rehearse the move by hand</summary>

### Create the VM

On your computer:

```bash
ssh exe.dev new --name=my-site
```

The rest runs on the VM.

### Install the kit

```bash
mkdir -p -m 700 ~/netlify && cd ~/netlify
for f in site.mjs deploy import check backup; do
  curl -fsSLO https://exe.dev/deploy/migrate-netlify/$f
done
chmod +x deploy import check backup
```

| Script | What it does |
|---|---|
| [site.mjs](https://exe.dev/deploy/migrate-netlify/site.mjs) | Prepares a build and serves it, like Netlify's runtime |
| [deploy](https://exe.dev/deploy/migrate-netlify/deploy) | Builds, migrates, and publishes on `git push`; rolls back |
| [import](https://exe.dev/deploy/migrate-netlify/import) | Sets the VM up from the hand-over; sets variables |
| [check](https://exe.dev/deploy/migrate-netlify/check) | Compares pages with Netlify's |
| [backup](https://exe.dev/deploy/migrate-netlify/backup) | The nightly backup |
| [handover.mjs](https://exe.dev/deploy/migrate-netlify/handover.mjs) | Runs on the owner's computer |

Ask the owner to [hand over the site](#hand-over-the-site), and wait for
`~/netlify/handed-over`.

### Set up

```bash
~/netlify/import setup
```

It installs Node.js, Postgres if the site has a database, and the
services; loads the variables, data, and database; and prints a plan in
`~/netlify/plan.md`: secret variables, likely API keys, and what the VM
doesn't do.

### Build and start

```bash
~/netlify/deploy "$(git --git-dir ~/git/site.git rev-parse "$(cat ~/netlify/branch)")"
jq .warnings ~/site/production/.exe/manifest.json
```

The warnings list what won't work here, like an edge function that
imports from a URL. Scheduled functions stay off until the move.

### Check and report

List the important pages, redirects, and function routes in
`~/netlify/paths.txt`, run `~/netlify/check`, and expect `same` for each,
apart from pages with live data. If Netlify asks for a login, the site is
protected; test it on the VM instead.

Write `~/netlify/report.md` for the owner: what came over, the warnings,
secrets to set, keys for integrations, what exe.dev doesn't do, and the
steps in [Make the move](#make-the-move). No values.

</details>

## Troubleshooting

<details class="dp-details">
<summary>A push is rejected with "the new deploy didn't answer"</summary>

The push output ends with the server's log. Usually a function throws
when it loads, a package is missing from `package.json`, or the
`netlify/server` app never listens on `PORT`.

</details>

<details class="dp-details">
<summary>A push is rejected with "migration … failed"</summary>

The old deploy keeps serving. The failed migration rolled back; earlier
ones in the push stay applied, as on Netlify. Fix it in a new migration
and push again. Try migrations on a branch first: the branch deploy gets
a fresh copy of production's database.

</details>

<details class="dp-details">
<summary>A form post gets a 404</summary>

Forms come from the built HTML: the form needs `data-netlify="true"` and
a `name`. A form that JavaScript renders needs a hidden HTML copy, and
its posts need a `form-name` field.

</details>

## Frequently asked questions

### Do I have to change my code?

No. Functions (both the `(req, context)` and `exports.handler` forms), edge functions, a `netlify/server` app, `Netlify.env`, `getStore()`, `getContext()`, and `@netlify/database` work as they are. Edge functions run in Node.js, so one that imports from a URL needs an npm package; the report lists any.

### Why move the API keys out of the environment?

On Netlify every function and build can read them. In exe.dev integrations the VM can use them but never read them.

### Why run the hand-over myself instead of giving Shelley a Netlify token?

A personal access token can do anything your account can. The script runs on your computer, the token stays there, and the data goes straight to the VM.

### How long is the site down?

Not at all: Netlify serves until your DNS change reaches visitors, and the VM is serving by then.

### My site uses Next.js, Astro, SvelteKit, or Nuxt.

Static builds work as they are. If the site renders on request through a Netlify adapter, Shelley switches it to the framework's Node adapter and runs that server instead.

### Can I go back?

Yes. Until your domain points at the VM, nothing on Netlify has changed; after that, point it back.

### What does it cost?

Your [exe.dev plan](https://exe.dev/pricing): no credits, invocations, or bandwidth to count.


## Related

- [Migrate a Railway project to exe.dev](https://exe.dev/deploy/migrate-railway.md): Your Railway services and data on one VM, and your API keys off it.
- [Migrate a Heroku app to exe.dev](https://exe.dev/deploy/migrate-heroku.md): Your Procfile, config vars, and Postgres on a VM of your own.
- [Give agents API access without giving them the keys](https://exe.dev/deploy/agent-secrets.md): Your agents call your APIs. The keys stay with exe.dev, outside the VM.
- [Deploy a Node.js app](https://exe.dev/deploy/nodejs.md): Your Express app on a server of its own. git push to deploy.
- [Deploy an Astro site](https://exe.dev/deploy/astro.md): Your Astro site, static or server-rendered, on a VM of its own.
- [Migrate a DigitalOcean Droplet to exe.dev](https://exe.dev/deploy/migrate-digitalocean-droplet.md): Same server, new home. Rehearsed while the droplet keeps serving.
