Skip to main content

How to handle data storage issues with the email message object

Updated over 2 weeks ago

As your team grows, the EmailMessage object often becomes the biggest consumer of data storage in your Salesforce org. When you hit your data storage limits, Salesforce can become sluggish, and you may face significant overage fees.

This guide outlines three verified methods to move older emails out of Salesforce storage while keeping your system clean and fast.

1. The Automated Route: Third-Party Archiving Apps

For most Weflow users, this is the preferred balance of cost and functionality. Tools like OwnBackup (Archive), Odaseva, or Storage Helper automate the export-and-delete cycle.

  • How it works: You set a rule (e.g., "Archive all emails over 2 years old"). The app copies the data to its own secure servers and deletes the original record from Salesforce.

  • The benefit: Most of these apps provide a "Virtual Viewer," so your reps can still read the archived emails inside Salesforce without that data counting against your storage limits.

  • Storage impact: Records are fully removed from live data storage. Note that related objects (such as EmailMessageRelation and ContentDocumentLink) may also need to be addressed depending on the tool β€” check your provider's documentation.

2. The Native Paid Route: Salesforce Data Archive

Salesforce offers an add-on called Data Archive, part of the Backup & Restore suite. (Note: This product has been rebranded several times. Confirm the current name and packaging with your Salesforce Account Executive.)

  • How it works: It moves records into a Salesforce-managed archival data store. Once moved, the record is deleted from your live data storage.

  • The benefit: It is fully native. Reps don't need to log into a different system to see the history.

  • The catch: It requires an additional license from your Salesforce Account Executive.

  • Storage impact: Full reduction from live Data Storage for every archived record.

3. The "DIY" Route: Manual Export and Purge

If you want to save on software costs and just need the data gone, you can do this manually using the Salesforce Data Loader.

Step 1 β€” Export

Run a query to download all EmailMessage records created before a specific date.

Pro Tip: Also export related files. In most orgs, email attachments are stored as Salesforce Files (ContentVersion records linked via ContentDocumentLink), not legacy Attachment records. These files often take up 10x more space than the email body text itself. Be sure to query ContentDocumentLink where LinkedEntityId matches your EmailMessage IDs, then export the corresponding ContentVersion records.

Step 2 β€” Verify

Save these exported files to your company's secure external storage (e.g., AWS S3, SharePoint, or a Data Warehouse).

Step 3 β€” Delete

Use the Delete or Hard Delete operation in Data Loader to remove those IDs from Salesforce.

Important: If you use the standard "Delete" operation (not "Hard Delete"), records go to the Recycle Bin first. Records in the Recycle Bin still count toward your data storage until the bin is emptied. Either use "Hard Delete" to bypass the Recycle Bin entirely, or manually empty the Recycle Bin after deletion to see the storage freed immediately.

Storage impact: Full reduction once records are permanently deleted (i.e., not sitting in the Recycle Bin).

Comparison Table: Storage Solutions

Solution

Effort

Cost

Accessibility

AppExchange Apps

Low

$$

High (viewable in Salesforce)

Salesforce Data Archive

Low

$$$

High (viewable in Salesforce)

Manual Export

High

Free

Low (stored in CSV / external DB)

A Warning on "Activity Archiving"

You may see a setting in Salesforce called Activity Archiving. This does not free up data storage. It only hides old tasks and events from the UI to make page loads faster. The records remain in your database and continue to count against your storage limits. To actually reclaim space, you must use one of the three methods above to delete the records from your live database.

Best Practices Before You Purge

Consult Legal/Compliance. Many industries require you to keep communications for 7+ years. Ensure your external backup meets these requirements before deleting anything from Salesforce.

Test in Sandbox. Always run your deletion logic in a Sandbox first to ensure your date filters are correct and that cascade behavior (e.g., related ContentDocumentLink records) works as expected.

Account for related objects. Deleting an EmailMessage does not automatically delete all associated storage. Depending on your org's configuration, you may also need to clean up orphaned ContentDocument and ContentVersion records to fully reclaim space.

Check Weflow Sync. Deleting emails in Salesforce will remove them from the Salesforce Activity Timeline. If your team relies on these for context in Weflow, make sure they are aware of the "cutoff date" (e.g., "We only keep the last 24 months of emails in the live system").

Did this answer your question?