How to Export Dataset in a JSON File

6 replies
Last updated: Aug 15, 2022
Hi guys.I want to export all of my dataset in Json file.
can someone tell me how can I do that?
Have you check the data export docs: https://www.sanity.io/docs/export ? πŸ™‚
You can also use the CLI by following step 1 of the Export, reshape, import instructions in the Migrating Data docs.
user F
yes I check that and wrote this:
curl https://<projectId>.<http://api.sanity.io/v2021-06-07/data/export/<dataset>/|api.sanity.io/v2021-06-07/data/export/<dataset>/> > backup.ndjson
but this text give me the first data of the dataset and I want the hole data of the dataset
πŸ™‚
user A
Umm. I didn't get what you said sorryπŸ˜…can you explain it more?
Sure. If you follow the link, it provides a command you can run in your terminal, which will export the dataset you specify to a destination file.
user A
Thank you so much. I will check that and if there is any question I'll come back againπŸ˜…πŸ™

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?