What strategies are recommended for archiving historical Sales Cloud data to optimize storage limits?
Answer
Basics: Salesforce data storage is limited per edition (a base amount plus per-user allocation; verify your org's numbers under Setup > Storage Usage). Most standard records count roughly 2 KB each, though some objects differ. Old activities, emails, closed opportunities and cases are typical candidates. Archiving frees space and improves query and report performance on large data volumes.
How it works:
- Identify candidates with Storage Usage and queries (for example closed opportunities older than seven years, tasks older than three years).
- Agree retention policy with legal and finance, and record what children cascade (deleting an Account removes related contacts, opportunities and cases).
- Export through Bulk API or Data Loader, ETL, or a native archive/backup product.
- Store in a Big Object, external database or data lake, or reach it via Salesforce Connect external objects.
- Delete from Salesforce; use Bulk API hard delete (needs the Bulk API Hard Delete permission) if you do not want records sitting in the recycle bin.
- Keep an index (Id, key fields) to find archived data later.
Advanced / deep dive: Big Objects scale to billions of rows but have a fixed index and limited query pattern; Async SOQL was retired, so verify the current options for querying them at scale. Salesforce Backup and Restore and Archive are paid products that handle capture, retention and restore. For very large deletes, chunk by Id range with PK chunking, disable triggers via a bypass flag, and watch sharing recalculation and locking. Deleting parents on master-detail removes details, so export the whole tree. Files and attachments often consume more space than rows: check file storage separately.
Code / config example:
Id, AccountId, CloseDate, Amount
Opportunity
IsClosed CloseDate LAST_N_YEARS:
Id Task IsDeleted