DEV Community

Rohan Mehta
Rohan Mehta

Posted on

Salesforce Data Archiving: Keeping Your Org Fast Without Losing History

Salesforce Data Archiving: Keeping Your Org Fast Without Losing History

Every Salesforce org grows. Tasks pile up, old cases accumulate, and years of records sit in objects nobody opens anymore. At first it's harmless. Then reports slow down, list views take forever to load, and storage warnings start appearing. That's when archiving stops being a nice-to-have and becomes real maintenance.

Why archiving matters

Salesforce is fast when your data is lean. Every query scans less, every report renders quicker, and every automation runs against fewer records. Old data doesn't just take up storage — it drags on performance for the records people actually use every day.

There's a cost angle too. Storage overages are one of the easiest bills to avoid, and keeping seven years of closed cases in live objects is the most common way orgs end up paying for it. Archiving is cheaper than buying more storage, and it makes the org faster at the same time.

What to archive first

Start with the obvious candidates:

Closed cases older than two years. Nobody reopens a case from 2023, but support teams keep them "just in case." Archive them with their related records intact.

Completed tasks and activities. A task marked complete three years ago has no operational value in a live list view. Archive it.

Stale leads. Leads that never converted and haven't been touched in eighteen months aren't a pipeline — they're clutter. Archive them, or delete them if your retention policy allows it.

Old opportunities. Lost and closed-won opportunities older than your reporting horizon don't need to live in the standard object. Keep the summary data; archive the detail.

The rule of thumb: if nobody has opened a record in a year and no report depends on it, it's an archiving candidate.

How to archive without losing anything

1. Decide what "archive" means for you. For some teams it's a Big Object. For others it's a CSV export stored securely, or a custom object with a stripped-down field set. Pick the approach before you move a single record — the destination determines what you can still do with the data later.

2. Keep the relationships. A case without its account, contact, and attachments is useless as a record. Whatever you archive, archive the related records together, or keep a key that lets you reconstruct them.

3. Archive in batches, and verify each one. Don't move 500,000 records in a single job and hope for the best. Run a small batch, check the counts on both sides, and confirm a sample of records made it through intact. Then scale up.

4. Tell people before you remove anything. The fastest way to lose trust in an admin is to make records disappear without warning. Announce what's being archived, where it lives now, and how to get it back.

The reporting question

The most common objection to archiving is "but what about our reports?" Fair point — and the answer is to check first. Before archiving an object, list every report, dashboard, and automation that touches it. If a quarterly report genuinely needs five years of case history, archive everything older than that horizon, not everything older than two years. Archiving should follow your reporting needs, not fight them.

This is the same discipline as cleaning your data in the first place. Our guide to why every AI strategy needs data cleaning first makes the point well: bad or bloated data quietly undermines everything built on top of it, whether that's an AI feature or a Monday-morning dashboard.

Automate the habit

A one-time archive helps, but data grows back. The fix is a recurring process: a scheduled flow or a quarterly job that moves records past your retention threshold into the archive automatically. Set the threshold once, review it once a year, and the org stays lean without a heroic cleanup every eighteen months.

And before any bulk data job — archiving included — test it properly. Our guide to Salesforce test classes and code coverage covers how to verify that automation behaves the way you expect, which is exactly the habit you want before a job touches hundreds of thousands of records.

Archiving isn't glamorous work. Nobody gets praised for making an org slightly faster. But it's the difference between an org that stays usable for years and one that slowly grinds to a halt under its own history. Start with closed cases, verify your batches, and make it a habit — your future reports will load faster for it.


Originally published at Way2Force

Top comments (0)