Discussion of missing translated documents and issues with the document internationalization plugin
I'm really sorry to hear about your documents disappearing - that's definitely stressful! Let me help you understand what likely happened and how to recover your content.
Recovering Your Documents
The good news is that your translated documents are likely recoverable since Sanity maintains document history. Since the references still exist but the documents themselves are gone, they were probably deleted rather than completely removed.
Method 1: Via Studio URL
If you know the document IDs (which you can find from your translation references):
- Navigate directly to:
https://your-studio.sanity.studio/desk/your-doc-type;[document-id] - You should see the deleted document with its history
- Click the document status indicator at the bottom of the editor or use the contextual menu (ellipsis icon) and select "History"
- Use the History panel to restore it to a previous version
Method 2: Programmatically via History API
If you have many documents to restore, you can use the History API to batch restore them:
import {createClient} from '@sanity/client'
const client = createClient({
projectId: 'your-project-id',
dataset: 'production',
token: 'your-token-with-write-access',
apiVersion: '2025-02-19',
useCdn: false
})
// Get document history
const history = await client.request({
url: `/data/history/production/documents/[document-id]`,
method: 'GET'
})
// Restore by using a previous revision (before deletion)
const previousVersion = history.documents[0] // Get the last version before deletion
await client.createOrReplace(previousVersion)Important: Your ability to restore depends on your plan's retention period (3 days for Free, 90 days for Growth, 365 days for Enterprise), so act quickly!
What Likely Happened
Without being able to verify the exact translation maintenance documentation you followed, it sounds like the maintenance process may have inadvertently deleted your translated documents. This could happen if:
- The maintenance operation interpreted the documents as orphaned or invalid
- There was a mismatch in how the translation references were configured
- The operation removed documents that it thought were no longer needed
About Reference Types in Document Internationalization
Regarding your question about strong vs. weak references: The document-internationalization plugin's behavior depends on how it's configured in your schema. The key difference:
- Weak references allow documents to be deleted independently without affecting the referencing document
- Strong references prevent a document from being deleted if another document references it
The appropriate choice depends on your use case and how the plugin is configured in your specific implementation. For translation workflows, the reference configuration affects what happens when you try to delete or modify translation relationships.
Prevention Going Forward
To avoid this in the future:
- Always backup before maintenance operations - Use dataset exports to create a safety net
- Test on a development dataset first - Clone your dataset and test any maintenance operations there before running them on production
- Verify reference integrity - Ensure all translation fields (
__i18n_lang,__i18n_refs, etc.) are properly populated before attempting fixes - Document your setup - Keep notes on your specific document-internationalization configuration so you understand how references are structured
- Be cautious with maintenance operations - Any operation that modifies or "cleans up" references should be thoroughly tested first
Additional Resources
For more information about restoring deleted documents, check out:
- Sanity's guide on restoring deleted documents
- History experience documentation
- Restoring previous versions of documents
Once you restore your documents, I'd recommend carefully verifying that all translation references are correctly bidirectional (base language references translations, translations reference base) to prevent similar issues in the future.
If you continue to have trouble with the restoration or need help understanding what went wrong with your specific maintenance operation, consider reaching out to Sanity support with your project details - they can help investigate what happened and ensure your translation setup is configured correctly.
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.