Skip to main content
CMSquestions

How to Migrate from Contentful to Sanity

IntermediateQuick Answer

TL;DR

To migrate from Contentful to Sanity, export your Contentful space using the Contentful CLI or Management API, then map content types to Sanity schemas. Convert Contentful's rich text to Sanity's Portable Text, handle asset references, and import using Sanity's mutation API. Since both are structured content platforms, the schema mapping is often more straightforward than migrating from a traditional CMS.

Key Takeaways

  • Both Contentful and Sanity use structured content models, making this a schema-to-schema migration rather than a restructuring project
  • Contentful's rich text format (using embedded entries and assets) requires conversion to Portable Text — the most technically involved step
  • Export assets from Contentful and re-upload to Sanity's asset pipeline; asset URLs will change
  • Community migration scripts exist for common Contentful-to-Sanity patterns — check the Sanity Exchange before writing from scratch