πŸ‘€ See Sanity in action: Watch product demo now β†’

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?
Aug 14, 2022, 3:41 PM
Have you check the data export docs: https://www.sanity.io/docs/export ? πŸ™‚
Aug 14, 2022, 4:20 PM
You can also use the CLI by following step 1 of the Export, reshape, import instructions in the Migrating Data docs.
Aug 14, 2022, 4:23 PM
user F
yes I check that and wrote this:
curl https://&lt;projectId&gt;.<http://api.sanity.io/v2021-06-07/data/export/&lt;dataset&gt;/|api.sanity.io/v2021-06-07/data/export/&lt;dataset&gt;/> &gt; backup.ndjson
but this text give me the first data of the dataset and I want the hole data of the dataset
πŸ™‚
Aug 14, 2022, 6:22 PM
user A
Umm. I didn't get what you said sorryπŸ˜…can you explain it more?
Aug 14, 2022, 6:23 PM
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.
Aug 14, 2022, 6:28 PM
user A
Thank you so much. I will check that and if there is any question I'll come back againπŸ˜…πŸ™
Aug 15, 2022, 6:39 AM

Sanity.io – build remarkable experiences at scale

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

Categorized in