Salesforce File Backup and Archiving: Move Files to Your Own S3 and Free Salesforce Storage
Salesforce Files — the attachments, uploaded documents, images, and signed PDFs stored as Content Versions — are often the largest and most expensive data in an org, and metadata or record backups don't copy them. mtdt.io copies them to an S3-compatible bucket you own, on demand or on a daily or weekly schedule. In archive mode it also deletes each file from Salesforce once the copy is verified, which frees Salesforce file storage, and can leave a record in Salesforce that points to the file in S3.
Files are the forgotten backup
A metadata backup captures your configuration. A data backup captures your records. Neither captures the binary Files attached to those records:
- contracts, quotes, and signed PDFs;
- images and design assets;
- documents uploaded to records and Chatter.
Lose them to an accidental delete, a bad integration, or a departed admin's cleanup, and a metadata or record backup holds no copy of them. On top of that, Salesforce file storage is limited and pricey, so these files are both under-protected and over-charged.
Back up files to your own S3
mtdt.io streams your Salesforce Content Versions into an S3-compatible bucket you own — AWS S3, Google Cloud Storage, or any S3-compatible provider you've connected. Pick the org, pick the destination, and your files land in your storage under a path you choose, each named <ContentVersionId>_<file name>.

Each backup shows how many files it holds, how much storage they use, and when it last ran. The run history shows, for each run, how many files could not be backed up and why.
Run it on a schedule
Set a backup to Daily or Weekly (on the day you pick) at the time you choose, or leave it on Manual and start it with Run now. The first run copies every matching file; each later run picks up only the files added or changed since the last successful run, so a daily schedule stays fast. The exception is Write S3 URL to text field: writing the URL changes the file in Salesforce, so with that option on every run reads the whole org again.
What the backup covers
- Latest versions by default. Turn on Include all file versions to back up every version of a file.
- Uploaded files only. Link-type content (a URL added with Add link) has no file body and is skipped.
- Content Versions only. Files stored in the classic
Attachmentobject aren't included. - The connected user needs "Query All Files". Without it, Salesforce returns only the files that user can see, and the backup is incomplete.
- Files you want to keep out. Skip files by checkbox field excludes every Content Version where the field you pick is TRUE.
- 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 copies files and leaves them in Salesforce. To reclaim file storage, turn the backup into an archive. An archive applies to every file the backup picks up: the whole org, minus the files you exclude 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.
To set it up:
- Check how much you can free. When you pick the org, the dialog shows the org's used file storage and the total size of its Content Versions.
- Turn on Create a record in Salesforce for each file. Choose an object (an
Archived_File__cobject is picked automatically if your org has one) and map its fields: the S3 URL (required), the original publication location (FirstPublishLocationId), the ContentVersion and ContentDocument IDs, the file size, the backup time, whether it was the latest version, and the mode. Use text fields for record IDs, because a file can belong to a record of any object. - Turn on 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.
- Put it on a schedule so new files move to S3 every day or every week.
How deletion handles files with several versions:
- 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 every one of its versions is in the bucket.
- With only latest versions backed up, a file that has older versions stays in Salesforce and the run reports it as skipped, unless you also turn on Delete the whole ContentDocument, which deletes the file with all its versions.
The record in Salesforce is created before the original is deleted. If Salesforce rejects the records for a batch of files, those files are not deleted and the run is marked failed. The Mark ContentVersion with checkbox and Write S3 URL to text field options write to the Content Version itself, so in archive mode they are deleted together with the file; the archive record is what stays in Salesforce. Each archive record counts toward Salesforce data storage, which is usually a small fraction of the file it replaces.
Your files, your storage
Because the destination is your own bucket, the same "your data, your rules" principle applies as with private cloud storage:
- No lock-in — files sit in standard object storage you already operate and pay for.
- Your region, your access controls — the copy lives in your infrastructure, and server-side encryption is applied if your storage connection has it configured.
- Cheap at scale — S3-class storage costs a fraction of Salesforce file storage.
- Retention is yours — files stay in the bucket for as long as your bucket's lifecycle rules keep them, including after you delete the backup configuration in mtdt.io.
When you'd use it
- Protection — a copy of business-critical attachments and documents outside Salesforce.
- Storage pressure — move files to S3 and stop paying for extra Salesforce file storage.
- Compliance & retention — keep files for as long as policy requires, under your bucket's lifecycle rules.
- Completeness — close the gap so every layer of your org is backed up: metadata, records, and files.
Best practices
- Start with a backup, then archive. Run the backup without deletion first, check the files in your bucket, then turn on the archive options.
- Grant "Query All Files" to the connected user so the backup sees every file in the org.
- Exclude files that must stay in Salesforce with a checkbox field and Skip files by checkbox field.
- Map the original publication location and the S3 URL on the archive record. Preserve any other record links separately before source deletion.
- Pair with metadata and record backups for a complete recovery story. (See the disaster-recovery playbook.)
For the step-by-step — connecting storage, picking an org, scheduling, archive options — see the guide: Backing Up Salesforce Files.
FAQ
Do metadata or record backups also cover Salesforce Files? No. A metadata backup captures configuration and a data backup captures records, but neither captures the binary Files — Content Versions — attached to those records. Files need their own backup, which is what mtdt.io's file backup covers.
Where does mtdt.io store backed-up files? In an S3-compatible bucket you own — AWS S3, Google Cloud Storage, or any S3-compatible provider you've connected. Files go under the path you set, each named with its ContentVersion ID and original file name.
Can a file backup run automatically? Yes. Set it to run daily or weekly at a chosen time, or leave it on manual and start it with Run now. After the first run, each run copies only the files added or changed since the last successful run.
Does backing up files free Salesforce storage? Only in archive mode. A plain backup copies files and leaves them in Salesforce. Delete source files after backup removes eligible source files after the upload and backup checks succeed. Deletion also depends on your version settings: a multi-version file can be left in Salesforce to avoid losing older versions that were not backed up. See the version-history question below.
How do users find a file after it has been archived? Enable Create a record in Salesforce for each file, choose an existing destination object, and configure the field mappings, including the S3 URL. A separate record is created for each backed-up ContentVersion before source deletion and remains afterwards. If creating that record fails, deletion does not proceed for that batch. Turning on source deletion alone does not enable archive-record creation.
Checkbox values and S3 URLs written directly to ContentVersion are removed with the original file. Use the separate archive record to retain a reference in Salesforce.
What counts as a Salesforce File in this backup?
Files stored as Content Versions: contracts, quotes, signed PDFs, images, design assets, and documents uploaded to records or Chatter. Only the latest version is backed up unless you include all versions. Link-type content and the classic Attachment object are not included.
Can I filter files using a field on a linked record, such as a Quote? Skip files by checkbox field reads a checkbox on ContentVersion. It does not directly evaluate fields on linked Quotes, Opportunities, or other records.
To apply your own business rules, use Salesforce automation to maintain a checkbox on ContentVersion. For example, set Keep_In_Salesforce__c = TRUE while a linked quote is live, and set it to FALSE only when the file is eligible for archiving. Keep files outside your intended archive population excluded too. Populate the field for existing files before the first run, and keep it updated as record statuses, file links, and file versions change.
What happens when the skip checkbox is TRUE?
That ContentVersion is excluded from the run: it is not uploaded, given a new archive record, or passed to source deletion. FALSE makes it eligible for processing, subject to the other backup filters.
This filter is separate from Mark ContentVersion with checkbox, which sets a checkbox to TRUE after a version is backed up. Source deletion operates on the whole ContentDocument, so review the version-history caveat below before enabling whole-document deletion.
What if a file is linked to more than one record? A Salesforce file is a ContentDocument containing its versions. ContentDocumentLink records connect it to records, users, and other locations. Source deletion removes the shared ContentDocument and its links, affecting every record using that file.
mtdt.io does not automatically check whether a linked record still needs the file. Your automation should keep it excluded whenever any linked record still requires it, even if another linked record is ready for archiving.
Does the archive record preserve every link to the original file?
No. The mapped Parent record ID comes from FirstPublishLocationId, the file's original publication location. It may not identify the record you want to archive, and it is not a list of all current links. mtdt.io does not create an archive record for each link. Preserving all relationships requires additional automation or a separate mapping of the links before source deletion.
What happens to older file versions when I archive a file? Only the latest version is backed up by default. With Delete source files after backup enabled, a single-version document can be deleted after backup. A multi-version document is normally left in Salesforce when its older versions have not been backed up.
Enable Include all file versions to retain the full history in S3. In that mode, mtdt.io waits until every version of a document has been backed up in the run before deleting the document. If filters exclude some versions, the document can remain in Salesforce.
With latest-only backup, the separate Delete the whole ContentDocument option permits deletion of the entire document, including older versions that were not backed up. Those older versions will not be available in the S3 backup.
Don't pay Salesforce prices for file storage
Back up your Salesforce files to storage you own, and move them out of Salesforce when you need the space.
Log in to mtdt.io and set up a file backup to your own S3.
Was this page helpful?
Let us know how we did
