Skip to main content

SF-0216 · Scenario · Easy

What are the steps to export the data in salesforce using Data loader?

✓ Verified by Vikas Singhal · Last reviewed 5/17/2026 · Updated for Spring '26

An Export pulls records out of Salesforce into a CSV file on your local disk. Under the hood it’s just a SOQL query that streams rows to disk through the SOAP or Bulk API.

Step-by-step

  1. Launch Data Loader and click Export (or Export All if you also need the recycle bin).
  2. Log in — production (login.salesforce.com) or sandbox (test.salesforce.com).
  3. Choose the Salesforce object you want to export — Accounts, Contacts, your custom object, anything queryable.
  4. Pick a destination CSV file. Data Loader will write the results here.
  5. Build the SOQL query.
    • Tick the fields you want in the left panel (Data Loader generates the SELECT clause for you).
    • Add a WHERE clause for filters (Industry = 'Banking', CreatedDate = LAST_N_DAYS:30).
    • Add ORDER BY and LIMIT if you want predictable output.
    • Or paste a hand-written SOQL string into the box.
  6. Click Finish. Data Loader executes the query and writes the rows to the CSV in batches.
  7. Open the CSV — every column is one field, every row one record.

Export vs Export All

This trips people up in interviews.

  • Export — returns active (non-deleted) records only. The standard backup or analysis option.
  • Export All — returns active records plus records currently in the recycle bin (the soft-deleted ones, before they age out at 15 days or capacity). Useful for full backups, audit trails, or recovering before a hard delete.

Use cases

  • Backup before a risky deploy. Export every record on the objects you’re about to touch.
  • Bulk update. Export, edit in Excel, re-import as an Update.
  • Reporting workaround. SOQL via Data Loader handles result sets reports can’t (millions of rows, joins on custom objects, etc.).
  • Migration to another org. Export from source, transform, insert into target.

SOQL tips

  • Always include Id in the SELECT — you’ll need it for any follow-up update or delete.
  • Audit fields like CreatedDate, CreatedById, LastModifiedDate, LastModifiedById, and SystemModstamp are exportable; on insert into a new org you’ll need Set Audit Fields upon Record Creation enabled to preserve them.
  • For >2 GB exports turn on Use Bulk API under Settings → Settings.
  • Date literals (THIS_MONTH, LAST_N_DAYS:7) are your friend for incremental exports.

What you can’t export this way

  • Attachment bodies (the binary content) — you need a separate process, or a tool like Weekly Export for that.
  • Encrypted fields show as masked values unless you have View Encrypted Data permission.
  • Field history beyond what the History object stores.

Verified against: Data Loader Guide — Exporting Data, Metadata API Developer Guide. Last reviewed 2026-05-17 for Spring ‘26 release.