Dataset import not reflecting in Sanity Studio after CLI deployment

14 replies
Last updated: Jan 27, 2026
Hello all! This morning we launched our new brand to our Sanity CMS powered site 🎉 . We have run into something interesting. When we started the brand work we imported our production dataset into our development dataset to start making changes that weren’t live to the public. This morning we imported that development dataset we worked on to our production dataset using the CLI . The website is accurate in every way to the dataset we deployed, however, the modules in the Sanity CMS when targeting the new production dataset still reflect the old production dataset, not the one that was newly imported. I don’t know how the Sanity CMS picks up the dataset import, but this wasn’t an issue when we imported production into development the first time. Any ideas how we can get our CMS up to date?
AI Update

Congratulations on the launch! 🎉

The issue you're experiencing is likely related to Studio configuration, not a data import problem. Since your website is showing the correct content, the dataset import was successful. The Studio showing old data suggests it might be pointing to the wrong dataset or there's a configuration mismatch.

First: Verify Your Studio Configuration

Check your sanity.config.ts (or sanity.config.js) file to ensure it's pointing to the correct dataset. According to the defineConfig documentation, your configuration should look like this:

import { defineConfig } from 'sanity'

export default defineConfig({
  projectId: 'your-project-id',
  dataset: 'production', // Make sure this matches your target dataset
  // ... rest of config
})

If you're using environment variables to manage different datasets, verify that your production Studio is using the correct environment configuration. Check for .env files that might be overriding your dataset setting:

SANITY_STUDIO_API_DATASET="production"

Understanding Dataset Imports

When you use the CLI to import a dataset (with commands like sanity dataset import), you're updating the Content Lake - the actual data storage. Your Studio then queries this data through Sanity's API. The datasets documentation explains that datasets are "named isolated collections of schemaless JSON documents" that are completely separate from each other.

Troubleshooting Steps

  1. Verify the import completed successfully: Check your CLI output for any errors during the import process

  2. Confirm you're viewing the correct dataset: If your Studio supports multiple datasets or workspaces, make sure you haven't accidentally switched to a different one

  3. Redeploy your Studio: If your Studio is hosted on Sanity's platform, try redeploying it:

    sanity deploy
  4. Check for dataset name mismatches: Ensure the dataset name in your Studio config exactly matches the dataset you imported to (including any differences in capitalization or spacing)

  5. Restart your local development server: If you're running the Studio locally with sanity dev, stop and restart the development server

About the --replace Option

When using sanity dataset import with the --replace flag, it completely replaces the target dataset's contents with the imported data. This is a destructive operation that removes all existing documents before importing the new ones. The fact that your website shows correct data confirms this worked as expected.

The Studio should immediately reflect changes in the Content Lake since it queries the data in real-time through the API. If it's not showing updated content, it's almost always a configuration issue rather than a data synchronization problem.

If none of these steps resolve the issue, double-check that you imported to the exact dataset name that your production Studio is configured to use - even small typos or naming differences would cause this exact symptom you're seeing.

Show original thread
14 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.

Was this answer helpful?