👋 Next.js Conf 2024: Come build, party, run, and connect with us! See all events

Duplicating datasets in admin dashboard and using CLI for imports

5 replies
Last updated: May 21, 2024
Is there an easy way to duplicate an entire dataset in the admin dashboard? Hoping to duplicate Contentful behavior where you can easily delete and spin up a staging env from production.
May 21, 2024, 5:59 PM
The only two ways to create a dataset are via the CLI or the HTTP API. There is some tooling for cloning and swapping datasets, but those are only available on Enterprise plans.
I should also note that we have an endpoint for exporting your dataset, but not for importing (unless you want to do it all through mutations).
May 21, 2024, 6:09 PM
Thanks, that's super helpful info! There's the
CLI NDJSON
import, right? Is the export supporting the same format?
May 21, 2024, 6:12 PM
The export through the CLI will output a gzipped tarball. There are some examples here .
May 21, 2024, 6:14 PM
Oh awesome, just tried it. Spits out
.ndjson
so should be easy to import with the CLI right away!
May 21, 2024, 6:16 PM
Excellent!
May 21, 2024, 6:19 PM

Sanity– build remarkable experiences at scale

Sanity is a modern headless CMS that treats content as data to power your digital business. Free to get started, and pay-as-you-go on all plans.

Was this answer helpful?