Feature request: sanity dataset sync
See original GitHub issueI have multiple client projects running on Sanity. I use a staging
and production
dataset for each, using staging
for my local development. This way I can show them a staging site, using staging data, for new features or other changes.
I like to keep the staging
dataset as close to production
as much as possible. So, when I get to work on a new feature, I run:
sanity dataset export production && sanity dataset import production.tar.gz staging --replace && rm production.tar.gz
Now that my clients have been using Sanity for a bit, their assets have grown substantially and this command can take some time - and is also (probably) eating up our bandwidth.
I’d love to be able to do something like:
sanity dataset sync --from production --to staging
and (ideally) have it do a real ‘sync’, instead of an entire dump-and-upload.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:46
- Comments:11 (3 by maintainers)
This is a… good idea. It’s put on the backlog 👍
I made a package for syncing between datasets – it’s still a little “beta” but has been doing the trick: https://github.com/sanctuarycomputer/sanity-graph-import
You could do a complete sync by providing it with a query for all documents
*
(but come to think of it you may need to omit the internal document types that start with_sanity
)