Salesforce data export: how to get all your data out before you leave
Short answer
Use the Data Export Service in Setup for a full CSV backup of every object, with files and attachments if you select them. It runs weekly on Enterprise, Performance and Unlimited and every 29 days on other editions, and the ZIP files are only available for 48 hours. Use Data Loader or the Bulk API for targeted or repeat extracts, and the Metadata API or Salesforce CLI to keep a record of your configuration. No export gives you working automation or Apex outside Salesforce: logic has to be rebuilt. If you are leaving, export and verify everything before your end date. Under the Main Services Agreement, Salesforce makes your data available for 30 days after termination on request, then has no obligation to keep it. Checked Nov 25, 2026.
Contents
Who this guide is for
This guide is for admins and IT leads who need a complete copy of their Salesforce data, either as a backup or because the company is leaving. It covers what each export method gives you, what none of them give you, and the contract clock that starts when a subscription ends. Sources are Salesforce’s own help pages and Main Services Agreement, Checked on Nov 25, 2026.
Four ways to export Salesforce data
| Method | Best for | Limits to know |
|---|---|---|
| Data Export Service (Setup) | A full CSV backup of every object, with files and attachments if you tick them | Weekly only on Enterprise, Performance and Unlimited; every 29 days on other editions; one schedule per org; ZIP files available for 48 hours |
| Data Loader or Bulk API | Selective or repeatable extracts, including soft-deleted records with “Export All” | Uses your daily API allowance; you manage the queries |
| Report export | Quick extracts for a team | A Lightning report run page shows 2,000 rows; use “Details Only” export for the full set |
| Metadata API or Salesforce CLI | Your configuration: objects, fields, layouts, flows, Apex, permission sets | Needs a developer; the output only runs on Salesforce |
Sources: Salesforce Help: export backup data, Salesforce Help: Data Export FAQ, Salesforce Help: reports and dashboards limits and Salesforce Developers: API request limits and allocations.
Running the Data Export Service properly
- In Setup, open Data Export and choose Export Now or Schedule Export.
- Tick Include all data, plus images, documents, attachments and Salesforce Files if you need them. Files make the export much larger.
- Choose UTF-8 encoding and keep the option to replace carriage returns off unless your target needs it.
- Download every ZIP within 48 hours of the completion email. Salesforce removes them after that, or as soon as a new export is queued.
- Check record counts in the CSVs against the counts in Salesforce before you rely on the backup.
Records in the Recycle Bin are not included. Source: Salesforce Help: Data Export FAQ.
What the export leaves behind
The Data Export Service gives you records, not the system that used them. It produces CSV record data, not metadata such as fields, layouts, validation rules or automation. Source: Gearset’s Data Export Service guide.
| You get | You do not get |
|---|---|
| Accounts, contacts, leads, opportunities, cases, tasks, custom object records | Flows, validation rules, page layouts, record types, sharing rules |
| Files and attachments (if selected) | Apex classes and triggers in a reusable form outside Salesforce |
| Record IDs and lookup IDs, so relationships can be rebuilt | Code inside managed AppExchange packages, which is hidden in your org |
| Users, products, price books and other standard objects | Report and dashboard definitions in a form other tools can run |
Apex is Salesforce’s own language and runs on the Salesforce platform, so logic has to be rewritten rather than exported (Apex Developer Guide: What is Apex?). Managed-package Apex is not visible beyond its global signatures (Apex Developer Guide: Apex in managed packages).
The deadline: 30 days after your subscription ends
Under the Main Services Agreement, if you ask within 30 days after termination or expiry, Salesforce “will make Customer Data available to Customer for export or download”. After that 30-day period Salesforce has no obligation to keep it and will delete it. Source: Salesforce Main Services Agreement (PDF).
Export before the end date, not after
Plan to have a complete, verified export and a parallel run finished while you still have full access. The 30-day window is a safety net, not a migration plan.
Customers domiciled in the EU or EEA also have an EU Data Act switching process in the same agreement: a switching request with a two-month notice period, then an export window of 30 days that Salesforce can extend to at most seven months. The clause says outstanding subscription fees for the rest of the term are still payable as an early termination fee. Source: Salesforce Main Services Agreement (PDF). Take legal advice on your own order form.
Exit checklist: leaving without losing data
Before you give notice
- Inventory every object in use, with record counts, owners and the integrations that write to it
- Run a full Data Export Service export with files, and a Data Loader “Export All” for objects with deleted records you must keep
- Retrieve metadata with the Salesforce CLI so you have a record of fields, picklists, flows and Apex for the rebuild
- Export report and dashboard definitions you need to recreate, with screenshots of key dashboards
- Save any history and audit data you are legally required to keep, and check it is in the export
- Store two copies of everything, in two locations, and test that you can open them
- Agree the notice date against the 30-day auto-renewal deadline in your order form
Our guide to Salesforce renewal terms covers the notice period.
Where the data goes: importing into ERPNext
ERPNext’s Data Import tool loads CSV or Excel files into any record type, one record type at a time, and can insert or update records. Sources: ERPNext docs: Data Import. We keep each Salesforce ID in a custom field on the ERPNext record so relationships can be rebuilt and every row traced back to the source.
Once in ERPNext, your data sits in a MariaDB database you can back up and query yourself, under an open-source licence (GPL-3.0). Leaving ERPNext later means taking a database backup, not waiting on a vendor export. Source: ERPNext on GitHub (GPL-3.0).
See the object-by-object mapping in our Salesforce to ERPNext migration guide, or our Salesforce migration services page for how we run the move.
Planning a move off Salesforce? See our Salesforce migration services for how we move teams to ERPNext and Frappe CRM with code ownership, or read the 70 reasons companies leave Salesforce.
Frequently asked questions
How do I export all data from Salesforce?
In Setup, open Data Export, choose Export Now or Schedule Export, select Include all data plus images, documents, attachments and files, and download each ZIP within 48 hours.
How often can I export Salesforce data?
Weekly on Enterprise, Performance and Unlimited editions, and every 29 days on other editions, through the Data Export Service. Data Loader and the API can run more often, within your API allowance.
Does the Salesforce data export include metadata?
No. The Data Export Service exports record data as CSV. Fields, layouts, validation rules, flows and Apex need the Metadata API or Salesforce CLI, and only run on Salesforce.
What happens to my data when I cancel Salesforce?
Under the standard Main Services Agreement, Salesforce makes your data available for export if you ask within 30 days after termination, then has no obligation to keep it and deletes it.
Can I import a Salesforce export into ERPNext?
Yes. ERPNext’s Data Import tool loads CSV or Excel files per record type. Mapping fields, picklists and relationships is the real work; we keep Salesforce IDs on each record to rebuild links.