Hi Nicolas. One thing to distinguish is between studio code and datasets. Your studio code is what gets installed with
sanity install
and deployed with
sanity deploy
(or with
sanity build
followed by outputting the files to a hosting environment). This studio is the structure where your content lake is displayed and manipulated, but which studio you use (local or deployed) has no impact on your data in the content lake. It is the vehicle rather than the passengers.
What I think you’re asking is more about a distinction between datasets. More specifically, your project can have multiple datasets with separate content (though, as you hinted at, they can be synchronized). Some people might have separate staging and production datasets, or development and staging datasets. These datasets house your content lake and they are what you specify when you’re sourcing your data. They’re the passengers that will sit in your studio “vehicle”.
If that’s indeed the case, then question 1 might be “how do I tell my dev environment I want to fetch data from my development dataset instead of the production dataset?” There are a few ways to do this, with one being
configuring your sanity.json file to select a dataset based on your environment. You can use
environment variables to override your environment (so, for example, you could test your sanity.json file is set up correctly by running
SANITY_ACTIVE_ENV=production sanity start
, which should run your production dataset locally).
For question 2, the question that follows may be “how would I migrate my data from a development dataset to a production dataset?” If that’s the case, there are a few different ways, with some exclusive to enterprise plans. However, on every plan there is the option to export (i.e., from dev) and import (i.e., to production). Details of that are
here .
If I’ve misunderstood your questions or you have additional ones, please let me know!