# What strategies are recommended for archiving historical Sales Cloud data to optimize storage limits?

**Topic:** Sales Cloud · **Difficulty:** Medium · **Tags:** Sales Cloud, Data Archiving, Storage Management

Read it on the site: https://www.forcechallenges.com/interview-questions/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:**
1. Identify candidates with Storage Usage and queries (for example closed opportunities older than seven years, tasks older than three years).
2. Agree retention policy with legal and finance, and record what children cascade (deleting an Account removes related contacts, opportunities and cases).
3. Export through Bulk API or Data Loader, ETL, or a native archive/backup product.
4. Store in a Big Object, external database or data lake, or reach it via Salesforce Connect external objects.
5. 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.
6. 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:**
```sql
-- Candidates for archive
SELECT Id, AccountId, CloseDate, Amount
FROM Opportunity
WHERE IsClosed = true AND CloseDate < LAST_N_YEARS:7

-- Soft-deleted records still in recycle bin
SELECT Id FROM Task WHERE IsDeleted = true ALL ROWS
```

**Hidden gotchas & must-remember points:**
- Deleted records stay in the recycle bin up to 15 days; hard delete bypasses it.
- Cascade deletes remove child records you may want to keep.
- Files and attachments use separate file storage.
- Archived data is not available to reports unless you build that path.
- Storage numbers vary by edition and purchased add-ons; verify in Setup.
- Triggers and flows fire on delete; plan a bypass for bulk jobs.

**Best practice:** Write a retention policy, archive in tested batches with reconciliation counts, and keep a restore procedure documented.

---
Source: ForceChallenges · last updated 2026-11-02
