Upgrading Sanity from V1 to V3 without losing data - is it possible?
Good news - your data in the Content Lake is completely safe and separate from your Studio version. Upgrading Studio versions won't affect your content at all, so there's no risk of data loss.
However, you're right that jumping from v1 to v3 is a significant leap. Here's what you need to know:
The Migration Path
Since you're on Studio v1, you'll essentially need to go through two major migrations. The good news from this community thread is that v1 to v2 had minimal breaking changes - you can actually skip directly to v3 if you follow the migration guides.
The reality is that the v2 to v3 migration guidance will be directly relevant to you, though you may encounter some v1-specific patterns that need updating first.
Key Changes Across Versions
Studio v1 → v2:
- Minimal breaking changes (mostly internal)
- Both used
sanity.jsonconfiguration - Parts System updates
Studio v2 → v3 (the bigger architectural shift):
sanity.json→sanity.config.js/ts(JavaScript-based config)- Parts System completely removed → new plugin API
- Webpack → Vite build system
- Full TypeScript support
- ESM modules required
defineTypeanddefineFieldwrappers for schemas
Recommended Approach
Based on the community experience, the fastest and cleanest approach is:
- Initialize a fresh v3 Studio using
npm create sanity@latest - Copy over your schema files to the new project structure
- Add your existing project ID and dataset name to
sanity.config.jsandsanity.cli.js - Update schema syntax to use v3 patterns (mainly adding
defineType/defineFieldwrappers)
If you don't have custom input components or complex plugins, this can take as little as 10-15 minutes!
Schema Considerations
Your schema structure (document types, fields, validation) remains conceptually the same, but the syntax changes slightly:
v2/v1 style:
export default {
name: 'post',
type: 'document',
fields: [...]
}v3 style:
import {defineType, defineField} from 'sanity'
export default defineType({
name: 'post',
type: 'document',
fields: [...]
})Important Notes
- Studio v2 support ended December 7, 2023, so you should prioritize this upgrade
- The
sanity upgradecommand doesn't work for major version jumps - that's why you're seeing the 404 - Your data remains completely safe in the Content Lake throughout this process
- If you hit dependency issues (like RxJS errors), the fresh install approach typically resolves them
Why the Fresh Install Works Better
Community members found that trying to upgrade in-place often caused dependency conflicts that were hard to resolve. Starting fresh with npm create sanity@latest and migrating your schemas over avoids these issues entirely - the new project gets all the correct dependencies from the start.
Your data is safe, and once you're on v3 (or now v4, which is the current version), the platform is much more stable and modern. The migration effort is worth it!
Show original thread13 replies
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.