CoursesMigrating from Webflow to SanityInitialize Sanity and install the migration toolkit
Migrating from Webflow to Sanity

Initialize Sanity and install the migration toolkit

Scaffold a Sanity project, add your schemas, and install the migration toolkit so AI agents can work with your content.
Log in to mark your progress for each Lesson and Task

From the root of your project:

pnpm create sanity@latest

Follow the prompts. Choose a new project, create a staging dataset, and select TypeScript. When asked for the project output path, type ./sanity. The CLI defaults to a folder named after your project, but you want it at /sanity/ relative to your migration root, and the ./ prefix is required — typing sanity alone will fail. This scaffolds /sanity/ with a Studio configuration, a schemaTypes/ folder, and a dev server.

Once it completes, fill in the Sanity credentials in your .env file. Your project ID shows up in the terminal output, and also at sanity.io/manage. For the token, go to sanity.io/manage → your project → API → Tokens and create one with Editor permissions:

# .env — add these after running pnpm create sanity@latest
SANITY_PROJECT_ID=your_project_id
SANITY_DATASET=staging
SANITY_TOKEN=your_editor_token

The Sanity CLI scaffolds the project but doesn't always create the dataset you named — type staging but the project only has production, and the first import fails with "dataset not found." Confirm it before continuing:

npx sanity datasets list --project <your_project_id>

If staging isn't in the list, create it:

npx sanity dataset create staging

From the project root (not inside /sanity/):

pnpm dlx skills add sanity-io/agent-toolkit --skill sanity-migration

This gives AI agents in your project access to Sanity's mutation API, GROQ querying, and asset upload, the tools the migration scripts use.

cd sanity && pnpm dev

Open localhost:3333. The sidebar is empty at this point since you haven't added any schemas yet and that's expected. What you're confirming here is that Studio loads without errors. Fix any TypeScript or compilation error before moving on.

Next, you’ll design your content model using the API data you just fetched.

Mark lesson as complete
You have 1 uncompleted task in this lesson
0 of 1