
Grab your gear: The official Sanity swag store
Read Grab your gear: The official Sanity swag storeGood news - you're actually on the right track, but it sounds like you're working with an older Studio v2 setup (which used sanity.json). If you're seeing errors after changing the dataset, here's what's likely happening and how to fix it:
Your dataset configuration should be in sanity.config.js (or .ts), not sanity.json. The sanity.config.js file is where all Studio configuration lives in v3. Here's what you need to do:
import { defineConfig } from 'sanity'
export default defineConfig({
projectId: 'your-project-id',
dataset: 'your-new-dataset-name', // Change this to your new dataset
// ... rest of your config
})Make sure the dataset exists: Go to your Sanity project dashboard and verify the new dataset has been created. You may need to create it first if it doesn't exist.
Deploy your schema to the new dataset: Run this command to ensure your schema is available in the new dataset:
sanity schema deployThis is especially important if you're using newer features like Agent Actions or if you have any validation rules that depend on the schema being deployed.
Studio v2 reached end-of-life in December 2023, so I'd strongly recommend migrating to v3. But if you need a quick fix for v2, check that your sanity.json has the correct dataset name under the api section.
The errors you're seeing are likely because:
After updating the config and deploying the schema, restart your dev server (sanity dev or npm run dev) and the errors should clear up!
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.
Content operations
Content backend


The only platform powering content operations
By Industry


Tecovas strengthens their customer connections
Build and Share

Grab your gear: The official Sanity swag store
Read Grab your gear: The official Sanity swag store