Step 6 of 7: Rebuild your site (migrate)
- Time
varies by site; see How long it takes
- Cost
your plans from step 3
- You need
step 5 done, and your Local site running
Not done yet. Tick it at the end of the page.
migrate is the move itself: your AI tool asks about your site, then rebuilds it in 12 phases,
checking its own work and asking before it creates anything in your accounts. Your live WordPress
site keeps running, untouched, the whole time.
Commands are shown for Claude desktop, for every computer until you pick yours.
Do this
-
Start your Local site (Local → your site → Start site), and open your AI tool in your projects folder, as in step 5.
-
Start migrate, using your Local site's folder name followed by
.local(here the folder ismysite, so you typemysite.local):
/wp2next:migrate mysite.local/wp2next:migrate mysite.local$wp2next migrate mysite.local/wp2next migrate mysite.localOr describe it in plain words: "Move the WordPress site mysite.local to Next.js and Sanity."
- Answer the site questions (below), then check the summary table and say yes. The summary
table shows the project folder (for example
~/Sites/acme-site, written~/Sites/<code>-siteon these pages). Write it down; you'll open this folder whenever you come back.
The session keeps working from your Sites folder. When you come back later, open the project
folder itself (see How long things take).
When you come back later, start from the project folder itself (see How long things take).
When you come back later, start from the project folder itself (see How long things take).
After phase 3 (when the project folder exists) the AI tool may ask you to open the new folder. Do
so (File > Open Folder), then type /wp2next migrate in the agent chat to carry on.
- Stay nearby. The AI tool works for long stretches on its own, then pauses for you. Each pause is one of the approvals listed below.
What it asks first
Before it reads anything from your site, the AI tool asks six short groups of questions: about the
site, hosting, your team, tracking, forms and a few extras. It already knows your defaults from
init, so it skips those. Then it shows a summary table of everything it will create and every
account it will use. Nothing is created until you say yes.
See the six groups of questions
Recommended answers come first.
| Group | What it asks |
|---|---|
| The site | A short code for the site (like acme), its public name, its domain, and which Local site it is |
| Hosting and goals | Where the live site is hosted and what access you have; how close the new site should look (pixel parity, faithful or facelift); whether to keep the blog; how many languages |
| Team, timing, accounts | How many people edit content; any launch deadline; whether to use your saved accounts; who can change the domain's DNS (see step 7) |
| Tracking | How to measure visitors (it first looks at your current site and tells you what it found); Google Search Console and Bing Webmaster Tools (both free and recommended); where visitors are; the consent banner, if you need one |
| Forms and compliance | Where form messages go; spam protection (a hidden "honeypot" field is recommended); whether the business is in a regulated field, such as health, legal, finance or real estate. These answers decide what the compliance check looks for. They are not legal advice |
| Extras and setup | A private brand guide page (recommended); whether AI tools may read your site (your choice, or decide later); the quality bar; where the project folder goes and what things are called |
The summary table also lists any warnings (for example, "Hobby is for non-commercial use"). The full list of questions, for the curious, is in the interview question bank (external site).
What you approve along the way
The 12 phases are grouped into five stages. The main pauses:
- Approve each thing it creates in your accounts, one at a time: your Sanity project first, later your GitHub repository and Vercel project.
- Enter private keys only into a hidden prompt in a terminal, never into the chat (see Entering a private key).
- Sign off parity: confirm the new site matches the old one, or say what's left.
- Send one real test message through each form and check it arrives.
See all 12 phases and what you do at each pause
"You" means you, at a pause; everything else the AI tool does by itself and checks at the end of each phase.
| Stage | Phases | What happens | What you do at the pauses |
|---|---|---|---|
| 1. Reading your old site | 1 Inventory, 2 Snapshot | Lists every page, post, menu, form, tracker and font; matches your site to a playbook (external site); saves a copy of every page and your images. It never reads customer or user data. | Say yes to an optional compliance scan of the old site (recommended: it becomes a to-do list for the new one). Confirm anything it found that you didn't mention, such as an old tracker or a CRM your forms already feed. |
| 2. Building on your computer | 3 Scaffold, 4 Baseline, 5 Look and feel, 6 Content structure, 7 Sanity, 8 Pages and forms | Sets up the new project; screenshots the old site and measures its speed and accessibility (Lighthouse); copies colors, fonts, header and footer; creates your Sanity content area and copies your content into it; builds every page, keeps every old address working (with redirects where needed) and wires up your forms. | Approve creating your Sanity project. Enter private keys (for example your Resend key) only into the hidden prompt in a terminal, never into the chat: see Entering a private key. Give public IDs it asks for, such as a Tag Manager ID. Set up Resend's sending domain with its help, and send the DNS records it shows (usually three or four) to whoever controls your DNS. |
| 3. Checking it matches | 9 Parity, 10 Phones and quality | Compares old and new, page by page, on a real production build; redesigns the layout for phones and tablets; runs accessibility and design reviews. | Look at the comparison report and sign off parity ("the new site matches"), or say what's left. Approve any visible fix (for example a color made easier to read); each one is written down. Say yes or later to the optional extra review (optimize). |
| 4. Putting it online, still hidden | 11 Infrastructure | Creates your GitHub repository and Vercel project, stores the keys in Vercel, connects Sanity so edits appear on the site, and verifies your domain with Google Search Console and Bing (if you chose them). The site stays hidden from search engines and behind a Vercel login. | Approve each account resource (repository, Vercel project, Sanity webhook) one at a time. If your GitHub is an organization, approve the Vercel GitHub app there. Add a DNS record for Search Console, or send it to whoever controls DNS. Submit one real test message through each form and check it arrives. |
| 5. Launch | 12 CLAUDE.md and cutover (go-live) | Final checks with tracking on, then the domain switch. | See Step 7: Go live. |
Along the way it also builds a private brand guide at /brand/ and a component library at
/components/. Both are working pages for you and the AI tool: never linked, never shown to search
engines, and switched off on the live site unless you turn them on. See
Brand guide.
Entering a private key
Some steps need a private key, such as your Resend API key. It must never go into the chat. The AI tool gives you a command to run in a terminal, and you paste the key into a hidden prompt there.
When the AI tool asks for a key, open this
- The AI tool gives you a command to run. It contains
secrets.pyand ends input SOME_KEY, with the full path to the script written out, for example:
python3 "/Users/<you>/.claude/…/scripts/secrets.py" put RESEND_API_KEYpy -3 "C:\Users\<you>\.claude\…\scripts\secrets.py" put RESEND_API_KEYOn Windows, the command must be written for PowerShell. If it starts with python3, contains /c/,
~, $PY or $SKILL, or joins two commands with &&, ask the AI tool: "Give me the PowerShell
version of that command."
- Paste it into a terminal in your project folder and press Enter (Return on a Mac):
Open the Terminal pane in the Code tab (Ctrl+` on Mac and Windows). It opens in the session's
folder, so you can paste the command straight away. If the session is still in your Sites folder,
type the cd line below first.
If the hidden prompt doesn't accept a paste in the Terminal pane, use the Terminal app instead.
The prompt should start with PS; which shell the pane opens isn't documented (Not yet confirmed). If it
shows a $ prompt instead, type pwsh and press Enter first, or use Windows Terminal. If the hidden
prompt doesn't accept a paste in the Terminal pane, use Windows Terminal instead.
Open a second terminal window (Claude Code is busy in the first one) and go to the project folder first, as below.
Open a second terminal window and go to the project folder first, as below.
Use Cursor's Terminal panel (View > Terminal). It usually opens in the folder you opened in Cursor; if not, go to the project folder first, as below.
cd ~/Sites/<code>-site # or the folder the AI tool namesSet-Location "$HOME\Sites\<code>-site" # or the folder the AI tool names- When it says
Value for RESEND_API_KEY (hidden):, paste the key and press Enter. Nothing shows while you paste. That's normal: the key is hidden on purpose. (To paste in a terminal: Cmd+V on a Mac; Ctrl+V or a right-click in Windows Terminal.) - Tell the AI tool you're done. It checks the key is stored without showing it.
If it says "empty value", nothing was pasted: run the command again.
How long things take
- The questions and summary: roughly 20 to 30 minutes (rough guide, not measured).
- Stages 1 to 4: most of the total time; you spend minutes at each pause. Expect to run it over several sessions for anything but a small site.
- Waiting outside your control: Resend's domain check can take from minutes to a few hours, and Search Console's DNS check up to 24 hours (checked 2026-12, see Forms, email and CRM and Tracking and search). The AI tool keeps building while these finish.
- Usage limits: on cheaper AI plans you may hit a limit mid-run. Progress is saved; carry on when it resets, or move up a plan (see step 1).
You can stop at any pause. Everything is saved in the new project (in wp2next.json). To see where you
are, run status; to carry on, run migrate again from the project folder:
Click Code, start a new session, and pick your project folder (Sites → <code>-site, for
example acme-site) with Open folder…. Or open the earlier session from the sidebar. Then type:
/wp2next:status
/wp2next:migratecd ~/Sites/<code>-site # for example ~/Sites/acme-site
claude
# then: /wp2next:status and to continue: /wp2next:migrateSet-Location "$HOME\Sites\<code>-site" # for example acme-site
claude
# then: /wp2next:status and to continue: /wp2next:migratecd ~/Sites/<code>-site # for example ~/Sites/acme-site
codex
# then: $wp2next status and to continue: $wp2next migrateSet-Location "$HOME\Sites\<code>-site" # for example acme-site
codex
# then: $wp2next status and to continue: $wp2next migrateOpen the folder Sites/<code>-site (for example Sites/acme-site) in Cursor
(File > Open Folder), then in the agent chat:
/wp2next status and to continue: /wp2next migrateYou'll know it worked when
statusshows phases 1 to 11 as done.- You signed off parity (or approved the facelift design).
- Your new site opens at its Vercel preview address after you log in to Vercel, and a test message from each form reached your inbox (and your CRM, if you use one).
- An edit you publish in Sanity Studio shows on that preview within seconds.
If something goes wrong
- It can't connect to the WordPress database. Your Local site stopped. Start it again in Local.
- It asks you to run a command yourself. Some steps are blocked by your AI tool's safety settings on purpose, and keys always go through a command you run. Run the exact command in a terminal (see Entering a private key), then tell it you're done.
- You pasted a key into the chat by mistake. Tell the AI tool; that key must be replaced (see If it stops).
- It stopped halfway, or you closed the window. See If it stops.
- Something looks different from the old site. Say so at the parity pause; nothing is signed off until you agree. See Troubleshooting → Matching the old design.
- More: Troubleshooting, the migrate command reference.
This page is docs/start/6-run-migrate.md in the wp2next repository. Read or edit it on GitHub (external site)