Sub topic 2
Choosing an export method
This chapter assumes you know Salesforce objects, records, and fields, can read CSV files, and can run commands in a terminal. It compares the main export methods so you can pick one for each backup need. Later chapters cover each method in detail.
The five methods
Salesforce gives you several ways to get data out of an org. They differ in scope, automation, and the limits they hit.
- Data Export Service is a built-in tool in Setup. It produces CSV files for most objects, on a schedule or on demand.
- Reports export the rows and columns of one report to CSV or Excel.
- Data Loader is a desktop application. It runs a SOQL query and writes the result to CSV.
- Salesforce CLI is a command-line tool. It runs SOQL queries and retrieves metadata, and you can script it.
- Bulk API 2.0 is a REST interface that runs large query jobs asynchronously.
Comparing the methods
| Method | Best for | Scope | Automation | Notes |
|---|---|---|---|---|
| Data Export Service | Full periodic backup | Most objects at once | Built-in schedule | Fixed schedule options, files are available for a limited time |
| Report export | Small, targeted extracts | One report | Manual | Limited by report size and row rules |
| Data Loader | Selected objects with custom filters | One query at a time | Command line mode exists | Cannot export subquery results |
| Salesforce CLI | Scripted, repeatable exports and metadata | One query at a time | Works in cron or CI | Needs an authorized org alias |
| Bulk API 2.0 | Very large objects | One query per job | Fully scriptable | You must write the job handling |
How the choice works
Ask three questions in order.
- Do you need everything, or a slice? For a full copy of most objects, start with the Data Export Service. For a slice, use a query or a report.
- Does it repeat? One-off extracts suit Data Loader or a report. Recurring exports suit the CLI in a script.
- How big is the data? For very large objects, move to Bulk API 2.0.
A common query behind several methods
Data Loader, the CLI, and Bulk API 2.0 all take SOQL (Salesforce Object Query Language). A query with explicit fields and a date filter works in each of them.
SELECT Id, Name, Industry, OwnerId, CreatedDate, LastModifiedDate
FROM Account
WHERE LastModifiedDate >= 2026-01-01T00:00:00Z
ORDER BY LastModifiedDateFiltering on LastModifiedDate lets you export only records that changed since the last run.
Common errors
- Using reports as a backup. A report holds only the fields and rows it shows. It does not preserve the full record set.
- Expecting child records from Data Loader. Flat CSV tools cannot export subquery results. Export each child object with its own query.
- Treating one method as the whole plan. Data exports contain records, not metadata. You back up metadata separately.
Exercise
Your org has one very large object that must be exported every night, and you want the export to run without anyone clicking in a desktop tool. Which method fits best, and why?
Show answer
Use the Salesforce CLI in a scheduled script, or Bulk API 2.0 if the object is large enough that a standard query is too slow or hits limits. Both are scriptable and can run from cron or a CI job. Data Loader's desktop interface and report exports are manual, and the Data Export Service cannot be limited to one object.