🗓️ Everything *[NYC] is back. A free gathering for AI builders. Sept 9

Does Sanity keep dataset backups or can I restore to a previous date?

12 repliesLast updated: Dec 1, 2025

Hello,Does sanity keep dataset backups somewhere or is it something that needs to be done manually?
Is there a way to retrieve a dataset as of yesterday?

I have mistakenly overwritten the production dataset with the development one which is few months old, and I cannot find any option on the website to restore a previous dataset. (project is on team plan if that helps)

Best,
User
AI Update

I'm really sorry to hear about this situation - accidentally overwriting production data is incredibly stressful. Let me clarify what options are available to you.

Understanding Backups vs. Document History

First, it's important to distinguish between two different Sanity features:

Document History/Revisions: This is automatically enabled for all plans and tracks individual document changes over time. However, the retention period is limited based on your plan:

Backups: This is a separate enterprise-only feature that provides managed dataset snapshots with longer retention policies. This feature must be manually enabled via the CLI and is not available on the Team plan.

Your Situation on the Team Plan

Unfortunately, the Team plan (which has been deprecated in favor of the current Free/Growth/Enterprise tiers) does not have access to the managed Backups feature. This means Sanity doesn't automatically create full dataset backups that you can restore.

However, you may still be able to recover your data depending on your plan's document history retention:

If Your Team Plan Has Document History Retention

The document revision system keeps track of individual document changes. If your Team plan includes revision history similar to the Growth plan (90 days), your documents from "yesterday" should still exist in the revision history.

Important limitation: The History API is designed for restoring individual documents, not bulk dataset restoration. You would need to:

This is technically possible but extremely time-consuming for an entire dataset.

Immediate Action Required: Contact Support

Given that you've overwritten your entire production dataset, you need to contact Sanity support immediately. Reach them through your Sanity dashboard or at support@sanity.io.

Explain:

Support may be able to:

Time is critical - the sooner you contact them, the better your chances of recovery.

What Sanity Does NOT Provide

Sanity does not automatically create or store full dataset backups for you unless you're on an Enterprise plan with the Backups feature enabled. This is a common misconception - document history is not the same as dataset backups.

Prevention for the Future

Once you've resolved this situation, you should implement your own backup strategy using the dataset export CLI command:

# Manual backup
sanity dataset export production backup-$(date +%Y%m%d).tar.gz

You can automate this with:

Also consider:

Bottom Line

Contact Sanity support immediately - they're your best hope for recovery. Don't make any more changes to your production dataset until you've spoken with them or begun a recovery process. While document history may preserve individual document versions from yesterday, recovering an entire overwritten dataset is not something you can easily do yourself with the available tools.

Show original thread
12 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