BOX OXDocs

Manage

Backups and retention

Back up mail objects and metadata together. Test your restore.

On this page

Backups, export, and retention#

D1 Time Travel provides account-level database recovery. Confirm the current retention window in your Cloudflare plan. Back up R2 objects separately and keep database metadata and objects from a consistent period. A D1 restore does not restore deleted R2 objects. The app's FTS5 tables prevent ordinary wrangler d1 export from providing a complete SQL backup. Do not rely on it without testing a restore.

The authenticated owner/member export API returns mail from addresses the caller can read:

EndpointResult
/api/orgs/default/export/statusCounts of accessible mail and retained originals
/api/orgs/default/export/manifest.ndjsonMetadata, original-byte hashes where available, and fidelity indicators
/api/orgs/default/export/mboxMail in mbox format

Exports contain at most 200 messages per request. Read X-Next-Cursor and request the next page with the cursor query parameter until X-Complete is true. Concatenate the pages in order and retain the manifest with the mbox file. A single response is not necessarily a complete backup. There is no archive-assembly job or V1 mailbox import in this release.

The exporter uses original RFC message bytes where retained. If the original is missing, it reconstructs a message from stored fields, with attachment descriptors rather than a byte-exact original. Inspect fidelity and hash fields instead of assuming every exported message is an original.

The retention sweep permanently removes threads that have stayed in Trash for 30 days. It also removes their mail objects and search data. Operational events expire after 90 days and audit events after 365 days.

The root onboarding helper preserves existing R2 rules and adds seven-day cleanup for incomplete multipart uploads when missing. It does not expire all stored mail. The D1-aware Trash sweep handles application deletion.

Existing R2 lifecycle rules can still remove configured object prefixes independently of D1. Inspect the installed lifecycle rules before setting your backup schedule.