Joint session with Vercel: How to build intelligent storefronts (May 15th)

How to reconnect VS Code to existing Sanity dataset without wiping data?

23 repliesLast updated: Nov 29, 2025

Hi just re 'setup' question. I have a website, using sanity to store some images and data. I connect to sanity through vscode. I connect to sanity dataset production for example. My site and data are all finished.
Now the problem. I have backups of my visual studio project. Though my pc has completely died. Motherboard issues so I am starting my new build i was planning. When I reinstall Vs code and use my backup vscode files......how do I connect to my existing sanity dataset in vscode without wiping that dataset? I think its called 'production' or 'projecttest'.
AI Update

Good news - you won't wipe your dataset! Your Sanity content lives in the cloud, not in your local VS Code files. Your backup project files just contain the connection configuration to access that data, so you're safe to restore them on your new machine.

Here's what you need to do:

Restore Your Project

That's it! Your project will connect to your existing dataset without any issues. The sanity login command just authenticates your machine - it doesn't affect your content at all.

If Configuration Files Are Missing

If your backup doesn't include the sanity.cli.js file, you can recreate it manually. You'll need:

Just create the configuration file with those values, and you'll be connected to your existing data.

Your content is completely safe in Sanity's cloud - these configuration files are just the "key" to access it, not the data itself!

Show original thread
23 replies

Was this answer helpful?

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.

Related contributions