How to easily migrate from Contentful to Sanity
Written by Even Westvang
As we’ve been working away at our infrastructure, we have cast the occasional sidelong glance at other companies with projects based on some of the same principles as Sanity.
The great thing about headless CMSes is that they don’t lock you into technological choices. You can deliver your front-ends on whatever technology you like. Could the same hold true for data backends? Of course it can. Given that the system that you are importing to organizes data at least as well as the system you're importing from.
The team at Sanity maintains a free sanity-migration agent skill, with a Contentful-specific guide.
Add it to your coding agent (like Claude Code, Cursor or Codex) and it guides the migration: exporting your Contentful space, mapping content types to a Sanity schema, converting Rich Text to Portable Text, and keeping your assets and references intact. For a quick lift-and-shift, it can use the contentful-to-sanity package to generate a first-pass schema and dataset for you to review.
Afterwards, you’ll have your data in a collaborative editor on a real-time backend, and a permissively licensed editor that you can extend with your own code and easily deploy.
Migrate your content to Sanity for free in 5 steps
The best way to evaluate Sanity for your team is with content they are already familiar with.
With the migration skill, you can get up and running with your content in a Sanity Studio in 5 steps:
- Initiate an empty Sanity Studio in a new free project.
- Add the skill to your coding agent: npx skills add sanity-io/agent-toolkit --skill sanity-migration
- Ask your agent to migrate your Contentful space, and give it tokens to access the space.
- Review the generated schema and imported content with your team before you commit to the content model.
- Run the command to deploy the Studio and invite your team to get a feel for how it is to work with their content.
The migration skill offers an efficient way for your teams to test Sanity. Developers can quickly get a feel for Sanity’s great developer experience, and content creators can to test out the clean, real-time editing environment.
You can start on the Free plan, which works well for simpler projects. When your team needs more collaboration and control, you can try the Growth plan for free before you commit.
After the migration, you can let developers test out the Studio Customization Framework, Sanity’s Content Lake and APIs. They will be able to query the content more freely, and customize the Sanity Studio with fewer restrictions, tailoring the system to how you work, not the other way around.
Want to understand how content migrations work under the hood? The Refactoring content for migration course on Sanity Learn walks you through it.
Try the Sanity migration skill today and explore how Sanity helps developers and content creators do their best work.
Get the migration skill