Joint session with Vercel: How to build intelligent storefronts (May 15th)

How to backup Sanity Studio CMS content?

4 repliesLast updated: Nov 30, 2025

Hi! Is there any way to backup the Sanity Studio CMS content uploaded?
AI Update

Yes, absolutely! Sanity provides several ways to backup your content, with the most common being the CLI export command.

Using the CLI to Export Your Dataset

The easiest way to backup your content is using the Sanity CLI:

sanity dataset export production

This creates a production.tar.gz file containing all your documents and assets. You can also specify a custom filename:

sanity dataset export production ./backups/backup-2024-01-15.tar.gz

What's Included in the Export

The export includes:

It does not include your schema definition (that lives in your Studio code) or access control settings.

Exporting Without Assets

If you only need the document data (not images/files), you can export to NDJSON format:

sanity dataset export production backup.ndjson --no-assets

Restoring from a Backup

To restore or import a backup:

sanity dataset import production.tar.gz production

This merges the backup content with your existing dataset. Always test imports on a development dataset first!

Automated Backup Strategies

Since Sanity doesn't store backups for you, consider setting up automated backups using:

Enterprise Backup Features

If you're on an Enterprise plan, Sanity offers managed backup features with:

Best Practice Tip

Always export your dataset before running content migrations:

# Backup first
sanity dataset export production backup-before-migration.tar.gz

# Run your migration
sanity migration run your-migration

# Restore if needed
sanity dataset import backup-before-migration.tar.gz production

The CLI export/import workflow is reliable and gives you complete control over your content backups!

Show original thread
4 replies

Was this answer helpful?

Sanity – Build the way you think, not the way your CMS thinks

Sanity is the developer-first content operating system that gives you complete control. Schema-as-code, GROQ queries, and real-time APIs mean no more workarounds or waiting for deployments. Free to start, scale as you grow.

Related contributions