Cloning a Sanity project and migrating data explained
Yes! There are a few ways to clone a Sanity project with the same content but a different project ID. Here's what you can do:
The Standard Approach: Export and Import
The most common method is to use the Sanity CLI's export and import commands:
- Export your current dataset:
sanity dataset export productionThis creates a production.tar.gz file containing all your documents and assets.
- Create a new Sanity project (which will have a new project ID):
sanity init- Import the data into your new project:
sanity dataset import production.tar.gz productionThis approach gives you complete control and works across all plan types. You can also export to a specific filename or location if needed.
Using the Cross Dataset Duplicator Plugin
The Cross Dataset Duplicator plugin lets you migrate documents and assets between projects directly from within Sanity Studio. This is especially helpful if you want to selectively copy content rather than everything at once. Install it with:
npm i @sanity/cross-dataset-duplicatorFor Enterprise: Cloud Clone
If you're on an Enterprise plan, you have access to Cloud Clone, which duplicates datasets directly in the cloud without needing to download and re-upload data locally. This is faster and more efficient for large datasets.
Important Notes
- The export/import process includes all documents and assets, but not your schema definition (that lives in your Studio code)
- You'll need to deploy your schema to the new project separately
- Access control settings and API tokens won't carry over—you'll need to reconfigure those in the new project
- The import will merge with existing content, so make sure you're importing into a clean dataset if you want an exact copy
The export/import method is the most straightforward approach and works great for most use cases where you need a complete clone with a new project ID.
Sanity – Build the way you think, not the way your CMS thinks
Sanity is the developer-first content operating system that gives you complete control. Schema-as-code, GROQ queries, and real-time APIs mean no more workarounds or waiting for deployments. Free to start, scale as you grow.