Skip to content
wp2next, home

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 running

Not done yet. Tick it at the end of the page.

migrate is the move itself: your 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.

Your AI tool

Commands are shown for Claude desktop, the recommended tool. Pick another if you use a different one; this browser remembers.

Your computer

Pick your computer's system. Steps that differ switch to it, and this browser remembers.

Do this

  1. Start your Local site (Local → your site → Start site), and open your AI tool in your projects folder, as in step 5.

  2. Start migrate, using your Local site's folder name followed by .local (here the folder is mysite, so you type mysite.local):

For Claude desktop
Text
/wp2next:migrate mysite.local

Or describe it in plain words: "Move the site mysite.local to Next.js and Sanity."

  1. 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>-site on these pages). Write it down; you'll open this folder whenever you come back.
For Claude desktop

The session keeps working from your Sites folder. When you come back later, open the project folder itself (see How long things take).

  1. 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, , 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.

GroupWhat it asks
The siteA short code for the site (like acme), its public name, its domain, and which Local site it is
Hosting and goalsWhere 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, accountsHow many people edit content; any launch deadline; whether to use your saved accounts; who can change the domain's DNS (see step 7)
TrackingHow 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 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 setupA 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 are grouped into five stages. The main pauses:

  • Approve each thing it creates in your accounts, one at a time: your first, later your GitHub repository and Vercel project.
  • Enter private keys only into a in a terminal, never into the chat (see Entering a private key).
  • Sign off : 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.

StagePhasesWhat happensWhat you do at the pauses
1. Reading your old site1 Inventory, 2 SnapshotLists 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 computer3 Scaffold, 4 Baseline, 5 Look and feel, 6 Content structure, 7 Sanity, 8 Pages and formsSets 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 matches9 Parity, 10 Phones and qualityCompares 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 hidden11 InfrastructureCreates 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. Launch12 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 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 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
  1. The AI tool gives you a command to run. It contains secrets.py and ends in put SOME_KEY, with the full path to the script written out, for example:
Terminal
python3 "/Users/<you>/.claude/…/scripts/secrets.py" put RESEND_API_KEY
  1. Paste it into a in your project folder and press Enter (Return on a Mac):
For Claude desktop

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.

Terminal
cd ~/Sites/<code>-site      # or the folder the AI tool names
  1. 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 .)
  2. 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 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:

For Claude desktop

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:

Text
/wp2next:status
/wp2next:migrate

You'll know it worked when

  • status shows phases 1 to 11 as done.
  • You signed off parity (or approved the design).
  • Your new site opens at its 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 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)