I have quite a lot documents in the sanity.io with completed fields. There is a need to change field type. And here are the problem:
Now I need to rewrite this field from old to the new and delete old field in each document. But it is expensive for me, I have a lot of documents. Is there any way to move data from one field to another once for all documents?
this is a great question! There's currently no way to do this through the studio user interface, but it's possible to write a data migration script that does this. Please see the example here: https://www.sanity.io/docs/migrating-data#migrate-using-the-api
This example is for renaming a field, but I believe it should be possible to modify it for changing the type name as well.