Data export/backup

Hi everyone :waving_hand:

We’re currently planning a change to our DatoCMS project and wanted to sanity-check our understanding of the available export and recovery options before proceeding.

Our situation

We have a project with localized content and are planning to remove one locale from the supported locales. This implies that:

  • the locale will be removed from the project configuration

  • localized fields will be updated accordingly

  • the content for that locale will no longer be accessible in the UI

Before doing this, we want to export/archive the existing content, knowing that this is more of a safety snapshot than a restore mechanism.

What we’ve investigated so far

Based on the documentation and other forum discussions, it seems that our realistic export options are:

  1. Custom scripts using the Content Management API
    (e.g. exporting records as JSON via the CMA client)

  2. Project Exporter plugin
    https://www.datocms.com/marketplace/plugins/i/datocms-plugin-project-exporter
    Mainly useful for:

    • per-model exports

    • editor-friendly formats (CSV/XLSX)

    • self-serve exports for non-technical users

From what we understand, these exports are intended rather for archival purposes, and not as a one-click backup & restore solution.

What we’d like to confirm

  1. Are the options above the recommended / best available approaches for exporting content before removing a locale?

  2. If we remove a locale from the supported locales, is it correct that:

    • the records are updated

    • the values for that locale are permanently removed

    • there is no built-in way to restore that locale’s content afterward (outside of re-importing via custom tooling/data migration)?

We want to make sure we fully understand the consequences before proceeding and communicate them clearly to our content team.

Thanks in advance for any confirmation or guidance!

Hey @technology

Your understanding is spot on! For an external export, both the exporter plugin and the CMA are equivalent (the plugin uses the CMA under the hood). The only issue with it is that if you need to re-import back the data, restoring it demands a bit of scripting to map the values on the JSON to the CMA calls to create/update records, so it may need a bit of scripting to restore values from the external backups generated.

That said, before removing the locale, I’d strongly recommend forking your primary environment first. This creates a complete copy of your schema, content, and media area. Including all locale data. If anything goes wrong or you realize later you need the content back, you can promote the forked environment back to primary, effectively rolling back the change. This is probably your safest “backup” approach in DatoCMS, since it preserves everything exactly as it was.

This way you can have a “single click” restore, in case anything goes immediately wrong.

So yeah, for your use case, what I would do is to export the entire project into a JSON using the plugin (or the CMA), fork the environment with a “pre-locale-removal” tag, and then delete the locale from the primary environment.

If something goes wrong, just promote the “pre-locale-removal” to primary :slight_smile:

After a couple of months or so, you can delete the sandbox environment if needed, and keep just the local backup in case some older value is needed in the future for lookup.

1 Like