Backing Up Salesforce Files
Metadata and record backups don't cover your Files — the attachments, uploaded documents, and images stored as Salesforce Content Versions. mtdt.io backs those up to your own S3-compatible storage, so every layer of your org is protected.
You manage file backups under File Backups.

How it works
- Connect an S3-compatible bucket under Storages (AWS S3, Google Cloud Storage, or any S3-compatible provider).
- Under File Backups, choose Add Backup, pick the Salesforce org (source) and the S3 storage (destination).
- Under Schedule, choose Manual, Daily, or Weekly, and for a schedule the day and time it runs. The time is shown in your local time zone.
- Save, then start it with Run now or wait for the scheduled time. mtdt.io streams the org's Content Versions into your bucket under Path in bucket (default
sf_archive/contentVersions), each file named<ContentVersionId>_<file name>.
The first run copies every matching file; each later run picks up only the files added or changed since the last successful run. After a run in which some files failed, the next run goes back at least to the first file that failed and reads on from there. The one exception is Write S3 URL to text field: writing the URL changes the file record in Salesforce, so with that option on every run reads the whole org again.
A scheduled run is skipped, and the backup waits for its next slot, when the org needs to be reconnected or its connection has expired, when the backup has no storage, or when the previous run of the same backup is still going. Each run also writes a small test object under <Path in bucket>/.mtdt-healthcheck/ to check that it can write to the bucket.
Each configuration shows how many files are captured, the storage they use, and when it last ran, plus a run history that shows, for each run, how many files could not be backed up and why.
What is backed up
- The latest version of each file, or every version if you turn on Include all file versions.
- Uploaded files only. Link-type content (Add link) has no file body and is skipped.
- Content Versions only. Files stored in the classic
Attachmentobject aren't included. - Only files the connected user can query. Give that user the Query All Files permission for a complete backup.
- Minus the files you exclude. Skip files by checkbox field leaves out every Content Version where the field you pick is TRUE.
- Minus files already marked. With Mark ContentVersion with checkbox on, files that already have the checkbox set are skipped on later runs.
Archive files and free Salesforce storage
A backup leaves the files in Salesforce. These options under After backup turn it into an archive. An archive applies to every file the backup picks up: the whole org, minus the files excluded with Skip files by checkbox field. There is no filter by file age or size, so mark the files that must stay in Salesforce with a checkbox field before you turn deletion on.
Create a record in Salesforce for each file. Choose the object that receives one record per backed-up file; an object named Archived_File__c is selected automatically if your org has one. Then map its fields. Only fields Salesforce lets you create, of a type the value fits, are offered:
| Value | Field types offered |
|---|---|
| S3 URL (required) | URL, Text, Text Area |
| Parent record ID — the record the file was first shared to (Salesforce can leave it empty on a later version of a file) | Text |
| ContentVersion ID | Text |
| ContentDocument ID | Text |
| File size (bytes) | Number |
| Backed up at | Date/Time |
| Latest version | Checkbox |
Mode (backup or archive) | Text, Picklist |
Use text fields for record IDs: a file can belong to a record of any object, and a lookup to one object rejects IDs of another.
Delete source files after backup. After each file is uploaded and its size in the bucket matches the original, mtdt.io deletes it from Salesforce. Salesforce doesn't allow deleting the only version of a file, so mtdt.io deletes the whole file (the ContentDocument):
- a file with one version is deleted once that version is in the bucket;
- with Include all file versions on, a file is deleted once all its versions are in the bucket;
- with only latest versions backed up, a file with older versions stays in Salesforce and is reported as skipped, unless Delete the whole ContentDocument is also on.
The order within each batch of files is fixed: upload, archive records, ContentVersion updates, deletion. If Salesforce rejects the archive records, the files of that batch are not deleted and the run fails. Mark ContentVersion with checkbox and Write S3 URL to text field write to the Content Version, so in archive mode they are deleted together with the file; use the archive record to keep a link in Salesforce.
Before you turn deletion on, the Source section of the dialog shows the org's used file storage and the total size of its Content Versions, so you can see how much an archive frees. Once a backup is saved, its configuration panel shows whether Delete source after backup and Delete whole ContentDocument are on.
Why back up files
- Files are usually the largest, least-protected data in an org — and Salesforce file storage is limited and expensive.
- A metadata or record backup holds no copy of a deleted file; a file backup keeps one in your bucket.
- The copy lives in your own storage, in your region and under your access controls — no lock-in.
Best practices
- Back up production first — that's where losing a file hurts most.
- Use your own S3 bucket so you own both the copy and the cost.
- Put it on a daily or weekly schedule — each run adds only new and changed files.
- Grant "Query All Files" to the connected user.
- Run a plain backup first, then archive. Check the files in your bucket before you turn on deletion.
- Map the S3 URL and the parent record ID on the archive record so users can find a file from the record it was attached to.
- Pair with metadata backup and record backups for complete coverage.
Deleting a file backup configuration in mtdt.io leaves the files in your bucket.
For the bigger picture, see Salesforce file backup and archiving.