Sub topic 3
Verifying That an Export Is Complete
Assume you know Salesforce objects, records, fields, CSV files, and basic terminal commands. A usable backup must be complete, readable, and restorable. Checking only whether a file exists is not enough.
Verify the export
Compare the source record count with the exported row count. A SOQL count query gives you a baseline:
SELECT COUNT() FROM AccountCheck more than the total:
- Compare counts for every exported object.
- Confirm that each record has a nonempty Salesforce
Id. - Look for duplicate
Idvalues. - Check that relationship fields contain valid parent IDs.
- Record the export time, query, org, and API version.
A count mismatch can indicate a filter, pagination failure, permission issue, or truncated file. A matching count does not prove that every field or relationship is correct.
Automate recurring exports
Use the Salesforce CLI in a scheduled job such as cron or a CI workflow. Store each run in a dated directory. Make failures visible, and do not overwrite the previous successful export. Automate verification as well as extraction.
Protect and retain exported files
Exported data contains sensitive business information. Restrict access to the backup location, encrypt files at rest and during transfer, and keep credentials outside scripts. Define a retention period that matches legal and recovery needs. Test that expired copies are actually removed.
Rehearse a restore
Restore into a sandbox or isolated test org. Load objects in dependency order: parents before children, such as Account before Contact. Preserve original IDs when possible, or maintain an old-to-new ID map. Verify record counts, relationships, permissions, and automation behavior after loading.
When to use a managed backup product
Consider a managed product when you need continuous capture, simpler recovery, deleted-record history, relationship-aware restoration, or vendor support. Compare its coverage, recovery time, encryption, retention controls, and restore testing features with your own scripts.
Build your backup plan
Document:
- Objects and metadata to protect.
- Recovery point objective, the maximum acceptable data loss.
- Recovery time objective, the maximum acceptable restore time.
- Export schedules, owners, storage, retention, and alerts.
- Verification and restore-test dates.
Exercise
An Account export has the expected count, but several Contact rows reference Account IDs absent from the Account file. Is the backup complete?
Show answer
No. The relationship check failed. Re-export the required Account records or investigate filters and permissions before accepting the backup.