How to Restore Files
Overview
Salesforce files are stored as ContentVersion records and linked to standard or custom objects (e.g., Accounts, Contacts, Cases). When a file is deleted from a record, it is essential to restore the associated ContentVersion to recover the file. This article provides an example of the process involved in restoring a deleted file using Backup & Archive. It covers how to identify the correct backup, prepare the restore, and confirm the results.
Key Concept
To recover a deleted file, restore the ContentVersion object. While files may reference other objects, such as ContentDocument or ContentDocumentLink, recovering the ContentVersion is usually sufficient.
Restoring records with Backup & Archive is a two-step process:
Create a Restore Request: Identify what to restore before making any changes to your org.
Run Restoration: Verify the data to restore, then execute the restoration.
For more background on the restore process and links to detailed instructions, see the following article.
Recover a Deleted File from an Account Record
This guide provides instructions for testing the Backup & Archive recovery process for a file deleted in Salesforce. The restoration process consists of two main steps:
Create a Restore Request: Identify the records to restore before making any changes.
Run Restoration: Verify the data and execute the restoration.
For a detailed understanding of the restoration process, refer to the provided article.
Tips
Only the ContentVersion object is required to restore file content.
Restore jobs can optionally include related objects for additional context or validation.
Always use filters to narrow the scope and reduce processing time.
Prerequisites
To complete this example, ensure you are familiar with the following actions in Backup & Archive:
Create Composite Backup: Creating a User-Defined Composite Backup
Create Restore Job: Creating a Backup Restore Job (Preparation)
Execute Restore Job: Execute the Restore
Simulate Accidental File Deletion
To restore a file with Backup & Archive, you must simulate a file being accidentally deleted. The following is an example of how to create this situation. The steps below assume you know the basics of creating a composite backup. For more detailed guidance, see the following article.
Prepare the Restore
With both backups ready, you can now set up the Restore job. The steps below assume you know the basics of creating a restore job. For more detailed guidance, see the following article.
Choose Objects to Restore
Click Add Objects to select objects to restore.
(Recommended) Check the Account object to allow for filtering by account name.
(Required) Check the Content Version object to include the object type in which the file is stored.

(Recommended) Apply Filters.
For example, to filter for just the account record that the file was deleted from, create a filter for the Account object to filter for
Name equals ACME Brick
Click Next once you are done adding objects and filters.

Execute the Restore
Now that the restore request has been created, the next step is to restore the file. The steps below assume you know the basics of executing a restore job. For more detailed guidance, see the following article.
Verify Restore Data
When the restore request is successfully created, a single ContentVersion record will be identified for restoration. This ContentVersion record contains the deleted file. Since the Account object was included for filtering purposes and no changes have been made to Accounts, no records should appear as changed.
Click the Data tab.

Confirm the following data to be restored:

Account
0
ContentVersion
1
The ContentVersion object has the file to restore. You can click the ContentVersion object to verify further the file details to be restored.
Last updated
Was this helpful?








