I want to migrate (maybe convert) the pages data from the old site to the new site.
The outline
The problem
Part 1
Part 2
First of all, feel free to contact us in our developer community or on [email protected] to see if we can figure something out when it comes to getting to your client’s content and letting you continue building with the current stack without hitches.
I'll still try to give you some answers here.
Part 1
You can get a full export of the public part of the dataset at the export endpoint: curl https://<projectId>.api.sanity.io/v1/data/export/<dataset>/ > backup.ndjson
. The asset documents will contain the URLs to the asset binaries that you have to download separately. Check out how we deal with it in our export-module. I note that it would be helpful if the module would let you export public data without requiring a token.
Another approach is to use Gatsby, query the data you need and output it as markdown/JSON structured in the way you need it from a page template.
Part 2
If you want to convert data from Sanity into Markdown that's totally possible. Check out this demo on Codesandbox for how to go about it.