Allow records to be exported/imported via CSV

For some types of models there will be a lot of records that are easier to edit offline in Excel or another spreadsheet program rather than through a web admin. It would be great to be able to export all the records for a given model as a CSV and then reimport to update.

Understandably this would get complicated with more complex field types and localization, but even if there were some limitations on it, a basic version of this would be useful.

Agree, thumbs up!

THAT … would be awesome ! :slight_smile:

FYI, there is a plugin that can handle exporting to CSV: https://www.datocms.com/marketplace/plugins/i/datocms-plugin-project-exporter?s=export (made by our own @m.finamor)

It doesn’t support bulk import yet, but you can look at the source code and maybe try to reverse the calls, converting the CSV back to JSONs and then using the CMA to create/update one row at a time: https://www.datocms.com/docs/content-management-api/resources/item/create

It won’t be easy, though :frowning:

I agree that having native import/export would be great. Let’s leave this feature request open :slight_smile:


Edit: For bulk importing, it might also be worth looking at how our CLI does it for Contentful and Wordpress imports:
https://github.com/datocms/cli/tree/main/packages/cli-plugin-contentful
https://github.com/datocms/cli/tree/main/packages/cli-plugin-wordpress