Salesforce · · 38 min read

Mass Updating Data in Salesforce

Every tool Salesforce provides for bulk data operations — Mass Delete, Mass Transfer, team reassignments, address updates, the Data Wizard, and the Data Loader.

Part 33: Mass Updating Data in Salesforce

Day-to-day Salesforce administration is not all about building flows and configuring page layouts. A huge part of the job involves data operations — cleaning up stale records, transferring ownership during team restructures, fixing addresses after a company moves offices, importing leads from a trade show, or purging test data from a sandbox. Salesforce gives you a suite of built-in tools for exactly these tasks, ranging from simple point-and-click wizards inside Setup to the powerful Data Loader desktop application.

In this post we will walk through every mass data tool available to administrators: Mass Delete, Mass Transfer Records, Mass Transfer Approval Requests, Mass Reassign Account Teams, Mass Reassign Opportunity Teams, Mass Update Addresses, the Data Import Wizard, and the Data Loader. For each tool you will learn where to find it, when to use it, how it works step by step, and what its limitations are. By the end you will know exactly which tool to reach for in any bulk data scenario.


Why Mass Data Operations Matter

Before we dive into the tools, let’s understand why this topic deserves its own post.

Common Scenarios

ScenarioWhat Needs to HappenBest Tool
Sales rep leaves the companyTransfer all their accounts, contacts, opportunities, and cases to a new ownerMass Transfer Records
Marketing imports 10,000 trade show leadsInsert new Lead records in bulkData Import Wizard or Data Loader
Duplicate cleanup identifies 3,000 junk accountsDelete records in bulkMass Delete or Data Loader
Company relocates headquartersUpdate billing/shipping addresses on thousands of accountsMass Update Addresses
A VP is promoted and their account team shiftsReassign account team members across many accountsMass Reassign Account Teams
End-of-quarter pipeline cleanupUpdate fields on thousands of opportunitiesData Loader (Update)
Sandbox refresh left behind test dataPurge records that should not exist in productionMass Delete or Data Loader
A manager goes on leave with 50 pending approvalsTransfer approval requests to another approverMass Transfer Approval Requests

Each of these scenarios would be painful to handle one record at a time. The tools in this post make them manageable.

The Golden Rule of Mass Data Operations

Always test in a sandbox first. Mass operations are difficult or impossible to undo. A mass delete of 5,000 records sends them to the Recycle Bin, but the Recycle Bin has storage limits. A mass transfer changes ownership and can trigger assignment rules, sharing recalculations, and workflow rules. A Data Loader update with a bad CSV can overwrite good data with blank values. Test every mass operation in a sandbox or developer edition before running it in production.


Mass Delete

Mass Delete is the simplest bulk deletion tool in Salesforce. It lives inside Setup and lets you delete records that match criteria you define — no CSV file, no external tools, no code.

Where to Find It

Setup > Data > Mass Delete Records

You will see links for the objects that support Mass Delete:

  • Mass Delete Accounts
  • Mass Delete Activities
  • Mass Delete Cases
  • Mass Delete Contacts
  • Mass Delete Leads
  • Mass Delete Products
  • Mass Delete Reports
  • Mass Delete Solutions

Step-by-Step: Mass Deleting Leads

Let’s walk through a practical example — deleting all leads with a status of “Disqualified” that were created more than a year ago.

  1. Navigate to Setup > Data > Mass Delete Records.
  2. Click Mass Delete Leads.
  3. You will see a filter interface with up to five criteria rows. Set your filters:
    • Lead Status equals Disqualified
    • Created Date less than 03/18/2025 (one year ago)
  4. Click Search.
  5. Salesforce displays matching records in a paginated list. Review them carefully.
  6. You can select individual records using checkboxes, or check the Select All box at the top to select all records on the current page.
  7. Optionally, check Permanently delete the selected records if you want to bypass the Recycle Bin. Use this with extreme caution — there is no undo.
  8. Click Delete.
  9. Salesforce processes the deletion. If the number of records is large, it may take a moment.

What Happens Behind the Scenes

  • Deleted records go to the Recycle Bin by default (unless you checked the permanent delete option).
  • The Recycle Bin holds records for 15 days before they are permanently purged.
  • Each user’s Recycle Bin can hold up to 25 times their MB storage allocation worth of records.
  • Related child records may also be deleted depending on the relationship type. For example, deleting an Account will cascade-delete its Contacts, Opportunities, and Cases if those relationships are master-detail or if the account is the parent.
  • Mass Delete respects validation rules, triggers, and sharing rules. If a validation rule prevents deletion of certain records, those records will be skipped and an error message will appear.

Limitations of Mass Delete

LimitationDetails
Limited objectsOnly supports the eight objects listed above. You cannot mass-delete custom object records this way.
Filter constraintsMaximum of five filter criteria. Complex filtering is not possible.
Page-by-page selectionYou must select records page by page. There is no “select all matching records across all pages” button.
No schedulingYou cannot schedule a mass delete to run at a future time.
Trigger executionApex triggers fire on each deleted record, which can cause performance issues or governor limit errors on very large sets.
Profile permission requiredThe user must have the “Modify All Data” permission to access Mass Delete.

When to Use Mass Delete

Use Mass Delete when:

  • You need to delete records from one of the eight supported objects.
  • The number of records is manageable (a few hundred to a few thousand).
  • You can define the target records with simple filter criteria.
  • You want a quick, no-setup solution that does not require a CSV file.

For anything more complex — custom objects, more than five filter criteria, tens of thousands of records, or scheduled operations — use the Data Loader instead.


Mass Transfer Records

Mass Transfer Records lets you change the owner of multiple records at once. This is one of the most frequently used mass tools because ownership changes are a constant reality in any organization — reps leave, territories get realigned, managers take over accounts.

Where to Find It

Setup > Data > Mass Transfer Records

You will see options for:

  • Mass Transfer Accounts
  • Mass Transfer Leads
  • Mass Transfer Service Contracts
  • Mass Transfer Custom Object Records (available for custom objects with an Owner field)

Step-by-Step: Mass Transferring Accounts

Let’s say a sales rep named Jordan Lee has left the company and you need to transfer all of Jordan’s accounts to a new rep named Morgan Chen.

  1. Navigate to Setup > Data > Mass Transfer Records.
  2. Click Transfer Accounts.
  3. In the Transfer From field, use the lookup to select Jordan Lee.
  4. In the Transfer To field, select Morgan Chen.
  5. Optionally, add filter criteria to narrow down which records to transfer. For example:
    • Account Type equals Customer (if you only want to transfer customer accounts, not prospects).
  6. Configure the transfer options:
    • Transfer open opportunities owned by the existing account owner — Check this if you also want to move Jordan’s open opportunities to Morgan.
    • Transfer closed opportunities owned by the existing account owner — Usually left unchecked. Closed deals should typically stay with the original owner for historical reporting.
    • Transfer open cases owned by the existing account owner — Check this to reassign open support cases.
    • Transfer closed cases owned by the existing account owner — Usually left unchecked.
    • Keep the existing account team — Check this if the rest of the account team should remain in place. Uncheck if you want the team cleared out.
    • Keep the existing opportunity team on open opportunities — Same logic as above.
  7. Click Find.
  8. Salesforce displays matching accounts. Review the list.
  9. Select the records you want to transfer (or use Select All on the current page).
  10. Click Transfer.

What Happens Behind the Scenes

  • Ownership changes on the Account cascade to related records depending on the options you selected.
  • Sharing recalculation fires after the transfer. If your org has complex sharing rules, role hierarchies, or territory management, this can take time.
  • Assignment rules do not fire during mass transfer — the records go directly to the specified new owner.
  • Workflow rules and Apex triggers that fire on ownership change will execute.
  • Field history tracking records the ownership change.

Transferring Leads

Mass Transfer for Leads works similarly but has fewer related-record options since Leads are standalone records (they do not have child opportunities or cases). The primary use case is territory realignment — when a marketing territory changes and all leads in a specific state or country need to move to a different rep.

Transferring Custom Object Records

If you have a custom object with an Owner field (as opposed to a master-detail relationship), you can use Mass Transfer to change ownership in bulk. The interface is the same — specify a Transfer From user, a Transfer To user, optionally filter, and transfer.

Limitations of Mass Transfer Records

LimitationDetails
One-to-one transferYou transfer from one specific owner to one specific new owner. You cannot redistribute records across multiple new owners in a single operation.
Page-by-page selectionSame as Mass Delete — no “select all across all pages” option.
Trigger executionOwnership-change triggers fire on each record. Watch for governor limits.
Sharing recalculationLarge transfers can cause significant sharing recalculation time. Plan transfers during off-peak hours.
No schedulingCannot be scheduled. Must be run manually.

When to Use Mass Transfer Records

Use Mass Transfer Records when:

  • A user is leaving the organization and their records need a new owner.
  • Territories are being realigned and records need to shift between reps.
  • You need to move records between owners along with related child records (opportunities, cases).
  • The number of records is moderate (hundreds to low thousands).

For very large transfers (tens of thousands of records) or complex multi-owner redistribution, consider using the Data Loader to update the OwnerId field directly via CSV.


Mass Transfer Approval Requests

When an approver goes on leave or changes roles, any pending approval requests assigned to them are stuck. Mass Transfer Approval Requests lets you move those pending approvals to a different user so that business processes keep moving.

Where to Find It

Setup > Data > Mass Transfer Approval Requests

Step-by-Step

  1. Navigate to Setup > Data > Mass Transfer Approval Requests.
  2. In the Transfer From field, select the current approver (the person who is unavailable).
  3. In the Transfer To field, select the new approver.
  4. Optionally filter by:
    • Object Type — Limit to approvals on a specific object (Opportunity, Discount Request, etc.).
    • Date Range — Limit to approvals submitted within a specific date window.
  5. Click Find.
  6. Review the list of pending approval requests.
  7. Select the requests you want to transfer.
  8. Click Transfer.

Key Details

  • Only pending approval requests can be transferred. Requests that have already been approved or rejected are not affected.
  • The transfer moves the approval step assignment, not the record itself. The record’s owner does not change.
  • This tool is essential for organizations with strict SLAs around approval turnaround times. If an approver is out sick and 20 discount approvals are waiting, this tool prevents a bottleneck.

Mass Reassign Account Teams

Account Teams let you associate multiple users with an Account — a sales engineer, a customer success manager, an executive sponsor, etc. When team members change roles or leave the company, you need to update those team memberships across many accounts at once.

Where to Find It

Setup > Data > Mass Reassign Account Teams

Step-by-Step

  1. Navigate to Setup > Data > Mass Reassign Account Teams.
  2. In the Existing Team Member field, select the user who is being removed or replaced.
  3. Choose one of the following actions:
    • Add a new team member — Adds a new user to all accounts where the existing member is found, without removing the existing member.
    • Replace existing team member with a new team member — Swaps the old member for a new one.
    • Remove existing team member — Removes the existing member from all accounts where they appear.
  4. If adding or replacing, specify:
    • New Team Member — The user who will be added.
    • Team Role — The role the new member will play (e.g., Sales Engineer, Executive Sponsor).
    • Account Access — The level of access the new member gets (Read Only, Read/Write).
    • Opportunity Access — Access level for opportunities on those accounts.
    • Case Access — Access level for cases on those accounts.
  5. Optionally filter by account criteria (e.g., only accounts in a specific region).
  6. Click Find.
  7. Review and select the accounts to update.
  8. Click Reassign (or Add / Remove depending on the action).

Why This Matters

Without this tool, you would need to open every single account record, navigate to the Account Team related list, and manually update the team member. For an organization with hundreds of accounts, that could take hours. Mass Reassign Account Teams does it in minutes.

Limitations

  • Only works with Account Teams. If your org uses custom team-like junction objects, this tool will not help.
  • Requires the Account Teams feature to be enabled in the org.
  • Page-by-page selection applies (same as other mass tools).

Mass Reassign Opportunity Teams

Opportunity Teams work similarly to Account Teams but at the Opportunity level. They track who is involved in each deal — the primary sales rep, the overlay rep, the presales consultant, etc.

Where to Find It

Setup > Data > Mass Reassign Opportunity Teams

Step-by-Step

The process mirrors Mass Reassign Account Teams:

  1. Navigate to Setup > Data > Mass Reassign Opportunity Teams.
  2. Select the Existing Team Member to replace or remove.
  3. Choose your action: Add, Replace, or Remove.
  4. If adding or replacing, specify the new team member, their team role, and their opportunity access level.
  5. Optionally filter by opportunity criteria (e.g., only open opportunities, only opportunities in a specific stage).
  6. Click Find.
  7. Review and select the opportunities to update.
  8. Click Reassign.

Key Differences from Account Teams

AspectAccount TeamsOpportunity Teams
ScopeAssociated with Account recordsAssociated with Opportunity records
Access levelsAccount, Opportunity, and Case accessOpportunity access only
SplitsNot applicableOpportunity Splits can be tied to team members for revenue attribution
Default teamsUsers can set a default account teamUsers can set a default opportunity team

When Opportunity Splits Are Involved

If your org uses Opportunity Splits (which divide credit for a deal among team members), reassigning opportunity team members can affect split percentages. After a mass reassignment, review the splits on affected opportunities to make sure revenue attribution is still correct.


Mass Update Addresses

Mass Update Addresses is a less well-known but very useful tool. It lets you update the billing and/or shipping address on multiple Account records at once. The classic use case is a company acquisition or office relocation where hundreds of accounts need their address updated.

Where to Find It

Setup > Data > Mass Update Addresses

Step-by-Step

  1. Navigate to Setup > Data > Mass Update Addresses.
  2. Define your filter criteria to find the accounts that need updating. For example:
    • Billing City equals San Francisco
    • Billing State equals CA
  3. Click Search to find matching accounts.
  4. Specify the new address values:
    • New Billing Street
    • New Billing City
    • New Billing State/Province
    • New Billing Zip/Postal Code
    • New Billing Country
    • You can update Shipping Address fields as well, or check the option to copy billing address to shipping address.
  5. Select the accounts to update.
  6. Click Update.

When to Use It

  • A customer’s corporate headquarters moves and you need to update the address on all related accounts.
  • Data cleanup reveals inconsistent city names (e.g., “SF” vs. “San Francisco”) and you want to standardize.
  • A merger or acquisition changes the address for an entire portfolio of accounts.

Limitations

  • Only works on Account addresses (billing and shipping). It does not update Contact mailing addresses.
  • Limited filter criteria (same five-criteria maximum as other mass tools).
  • For Contact address updates, use the Data Loader or a Flow.

The Data Import Wizard

The Data Import Wizard is Salesforce’s built-in, browser-based tool for importing data from CSV files. It supports a limited set of objects but provides a guided, user-friendly experience that does not require installing any software.

Where to Find It

Setup > Data > Data Import Wizard (or search “Data Import” in the Quick Find box)

Supported Objects

The Data Import Wizard supports the following standard objects:

ObjectNotes
Accounts and ContactsCan be imported together in a single operation
LeadsMost common use case for the wizard
SolutionsLegacy object; rarely used in modern orgs
Campaign MembersAdd contacts or leads to campaigns
Custom ObjectsAny custom object is supported

Not supported: Opportunities, Cases, Products, Price Book Entries, Tasks, Events, and most other standard objects. For those, use the Data Loader.

Step-by-Step: Importing Leads

  1. Navigate to Setup > Data > Data Import Wizard.
  2. Click Launch Wizard.
  3. Select the object type: Leads.
  4. Choose the operation:
    • Add new records — Inserts new leads. Duplicates are matched by email address (configurable).
    • Update existing records — Updates leads that already exist in Salesforce. Matched by Salesforce ID or email.
    • Add new and update existing records — An upsert operation. New records are inserted, existing matches are updated.
  5. Choose the matching criteria:
    • Email — Match by the lead’s email address.
    • Salesforce ID — Match by the record’s 15- or 18-character ID.
    • Name — Match by first and last name (less reliable due to duplicates).
  6. Choose how to handle duplicates:
    • Skip duplicates.
    • Update duplicates with imported data.
  7. Upload your CSV file. The file should have headers that correspond to Salesforce field API names or labels.
  8. The wizard displays a field mapping screen. Map each CSV column to a Salesforce field. The wizard auto-maps columns with matching names and lets you manually map the rest.
  9. Review the mapping summary.
  10. Click Start Import.
  11. The import runs asynchronously. You will receive an email notification when it completes, with a summary of successes and failures.

CSV File Preparation Tips

TipWhy
Use UTF-8 encodingPrevents character encoding issues with special characters and international names
Include column headersThe wizard uses headers for auto-mapping. Headerless files cannot be mapped.
Keep files under 50 MBThe wizard has a 50 MB file size limit
Keep records under 50,000The wizard supports a maximum of 50,000 records per import
Remove formulasExport CSVs from Excel as “CSV UTF-8” to strip formulas
Clean up blank rowsTrailing blank rows in the CSV create empty records
Validate required fieldsMake sure every row has values for required fields (e.g., Last Name for Leads)
Use Salesforce IDs for updatesWhen updating records, include the Salesforce Record ID for reliable matching

Limitations of the Data Import Wizard

LimitationDetails
Object supportDoes not support Opportunities, Cases, Products, Events, Tasks, or many standard objects
Record limitMaximum 50,000 records per import
File sizeMaximum 50 MB per CSV file
No delete operationCannot delete records. For bulk deletes, use Data Loader.
No exportCannot export data from Salesforce. One-way import only.
No schedulingImports cannot be scheduled or automated
No relationship linking for all objectsSome relationship fields cannot be mapped through the wizard

When to Use the Data Import Wizard

Use the Data Import Wizard when:

  • You are importing Leads, Accounts/Contacts, Solutions, Campaign Members, or custom object records.
  • The import volume is under 50,000 records.
  • You want a guided, browser-based experience with no software installation.
  • The operation is a one-time or occasional import (not a recurring automated job).

The Data Loader

The Data Loader is Salesforce’s most powerful bulk data tool. It is a desktop application (available for Windows and macOS) that can insert, update, upsert, delete, hard delete, and export records for any Salesforce object — standard or custom — with support for up to 5 million records per operation.

Every serious Salesforce administrator needs to know the Data Loader inside and out. It is the tool you will reach for most often for complex data operations.

Where to Get It

Setup > Data > Data Loader — Click the download link to get the installer for your operating system.

Alternatively, you can download it from the Salesforce Data Loader GitHub repository, which hosts the open-source version.

GUI vs. CLI

The Data Loader has two modes:

ModeBest ForDetails
GUI (Graphical User Interface)Interactive, one-time operationsPoint-and-click interface. Select an operation, choose an object, upload a CSV, map fields, and run.
CLI (Command Line Interface)Automated, scheduled, recurring operationsDriven by configuration files and command-line parameters. Can be integrated into scripts, cron jobs, and CI/CD pipelines.

Most administrators use the GUI for day-to-day tasks and set up the CLI for recurring automated jobs (like nightly data syncs).

Data Loader Operations

The Data Loader supports six core operations:

1. Insert

What it does: Creates new records in Salesforce.

When to use: You have a CSV of records that do not yet exist in Salesforce and you want to create them.

How it works:

  1. Open Data Loader and click Insert.
  2. Log in to your Salesforce org (production or sandbox).
  3. Select the target object (e.g., Account, Lead, Opportunity, Custom_Object__c).
  4. Upload your CSV file.
  5. Map CSV columns to Salesforce fields using the field mapping screen. You can auto-map (matches by API name) or manually map each column.
  6. Click Finish to start the operation.
  7. Data Loader processes the records in batches (default batch size is 200 records).
  8. When complete, Data Loader generates two output files:
    • Success file — Contains successfully inserted records with their new Salesforce IDs.
    • Error file — Contains records that failed, along with error messages explaining why.

Key point: Always save the success file. It contains the newly created Salesforce IDs, which you will need if you later want to update or delete those records.

2. Update

What it does: Modifies existing records in Salesforce.

When to use: You need to change field values on records that already exist. Your CSV must include the Salesforce Record ID for each record.

How it works:

  1. Click Update in Data Loader.
  2. Select the target object.
  3. Upload your CSV. The CSV must include a column with the Salesforce Record ID (the 15- or 18-character ID).
  4. Map the ID column to the Id field. Map other columns to the fields you want to update.
  5. Click Finish.
  6. Records are matched by ID and updated with the values in the CSV.

Important: If a field in your CSV is blank, Data Loader will overwrite the existing value in Salesforce with a blank value. This is one of the most common mistakes — accidentally blanking out data. To avoid this, only include columns in your CSV for fields you actually want to change.

3. Upsert

What it does: Combines Insert and Update. If a matching record is found, it updates it. If no match is found, it inserts a new record.

When to use: You have a CSV that may contain a mix of new and existing records, and you want Salesforce to figure out which is which.

How it works:

  1. Click Upsert in Data Loader.
  2. Select the target object.
  3. Choose the External ID field that Data Loader will use for matching. This must be a field marked as an External ID on the object. If no External ID fields exist, you can also use the standard Salesforce ID.
  4. Upload your CSV.
  5. Map columns, including the External ID column.
  6. Click Finish.
  7. For each row, Data Loader checks if a record exists with a matching External ID value:
    • If a match is found: the record is updated.
    • If no match is found: a new record is inserted.
    • If multiple matches are found: the row is rejected with an error.

Why External IDs matter: External IDs are custom fields with the “External ID” attribute checked. They are typically used to store identifiers from external systems (ERP IDs, legacy system IDs, etc.). Upsert relies on these fields to determine whether a record already exists.

4. Delete

What it does: Deletes records from Salesforce and sends them to the Recycle Bin.

When to use: You have a list of Salesforce Record IDs that need to be removed.

How it works:

  1. Click Delete in Data Loader.
  2. Select the target object.
  3. Upload a CSV that contains the Salesforce Record IDs of the records to delete.
  4. Map the ID column to the Id field.
  5. Click Finish.
  6. Records are deleted and moved to the Recycle Bin.

Tip: Before deleting, always export the records first (using Data Loader Export) so you have a backup in case you need to restore them.

5. Hard Delete

What it does: Permanently deletes records, bypassing the Recycle Bin entirely.

When to use: You are purging data that you are absolutely certain you will never need again (e.g., test data in a sandbox, data from a decommissioned integration).

Requirements:

  • The Bulk API Hard Delete permission must be enabled for the user’s profile.
  • This operation cannot be undone. There is no recovery once records are hard-deleted.

How it works: Same as Delete, but the records skip the Recycle Bin entirely. Use with extreme caution.

6. Export and Export All

What it does: Extracts records from Salesforce into a CSV file.

Two variants:

  • Export — Exports only active (non-deleted) records.
  • Export All — Exports both active records and records in the Recycle Bin (soft-deleted records).

How it works:

  1. Click Export (or Export All) in Data Loader.
  2. Select the source object.
  3. Write a SOQL query to define which records and fields to extract. For example:
    SELECT Id, Name, Industry, BillingCity, OwnerId
    FROM Account
    WHERE Industry = 'Technology'
  4. Click Finish.
  5. Data Loader executes the query and writes the results to a CSV file at the location you specify.

Tip: If you are not comfortable writing SOQL, the Data Loader’s query builder provides a point-and-click interface for selecting fields and adding filter conditions.

Data Loader Settings

Data Loader has several configurable settings that affect performance and behavior:

SettingDefaultDescription
Batch Size200Number of records processed per API call. Can be set from 1 to 200 (SOAP API) or up to 10,000 (Bulk API).
Use Bulk APIOffWhen enabled, uses the Bulk API instead of the SOAP API. Recommended for large volumes (more than 10,000 records).
Use Serial ModeOffWhen enabled with Bulk API, processes batches sequentially instead of in parallel. Useful for avoiding lock contention on shared data.
Insert Null ValuesOffWhen enabled, blank fields in the CSV will overwrite existing values in Salesforce with null. When off, blank fields are ignored.
Time ZoneSystem defaultThe time zone used for date/time field mapping.
Proxy SettingsNoneConfigure if your network requires a proxy server to reach the internet.

SOAP API vs. Bulk API

AspectSOAP APIBulk API
Best forSmall to medium volumes (under 10,000 records)Large volumes (10,000 to 5 million records)
Processing modelSynchronous — each batch is processed immediately and results are returnedAsynchronous — batches are queued and processed by the server in the background
Batch sizeUp to 200 records per batchUp to 10,000 records per batch
ConcurrencyBatches sent one at a time from the clientServer processes multiple batches in parallel (unless serial mode is enabled)
SpeedSlower for large volumesSignificantly faster for large volumes
Governor limitsStandard API limits applyBulk API has its own set of limits (daily batch limit, daily record limit)

Using the Data Loader CLI

The CLI mode is powerful for automating recurring data operations. Here is how to set it up:

Configuration Files

The CLI uses two key files:

  1. process-conf.xml — Defines the operation (insert, update, delete, etc.), the target object, the CSV file path, the field mapping file path, and other operation parameters.
  2. Field mapping file (.sdl) — Maps CSV column names to Salesforce field API names.

Example: Automated Nightly Account Export

Here is a simplified workflow for setting up a nightly export of Account records:

  1. Create a process-conf.xml entry that defines:
    • Operation: Extract
    • Object: Account
    • SOQL query: the fields and filters you want
    • Output file path: where the CSV will be saved
  2. Create the .sdl mapping file (for exports, this is usually auto-generated).
  3. Create a shell script (macOS/Linux) or batch file (Windows) that invokes the Data Loader CLI with the process name.
  4. Schedule the script using cron (macOS/Linux) or Task Scheduler (Windows).

CLI Benefits

  • Automation: No manual intervention required. Operations run on a schedule.
  • Reproducibility: Configuration files serve as documentation of exactly what the operation does.
  • Integration: Can be incorporated into larger ETL (Extract, Transform, Load) pipelines.
  • Auditability: Logs and success/error files provide a complete audit trail.

Data Loader Best Practices

Here is a comprehensive list of best practices for Data Loader operations:

Before the Operation

  1. Export a backup. Before any update or delete operation, export the records you are about to modify. This gives you a rollback path.
  2. Validate your CSV. Open the CSV in a text editor (not just Excel) to check for encoding issues, trailing commas, extra columns, or misaligned rows.
  3. Check required fields. Ensure your CSV includes values for all required fields on the target object. Missing required fields will cause row-level failures.
  4. Verify record IDs. For update and delete operations, double-check that your ID column contains valid 15- or 18-character Salesforce IDs.
  5. Test in a sandbox. Always run the operation in a sandbox first to catch errors before they affect production data.
  6. Check automation impact. Consider what flows, triggers, workflow rules, and validation rules will fire. Disable non-essential automation temporarily if needed.
  7. Review sharing implications. Ownership changes trigger sharing recalculation. Plan large ownership updates during off-peak hours.

During the Operation

  1. Use Bulk API for large volumes. If you are processing more than 10,000 records, enable Bulk API in Data Loader settings.
  2. Use Serial Mode when needed. If you are updating parent and child records, or records that share lookup relationships, serial mode prevents lock contention errors.
  3. Monitor batch progress. Watch the Data Loader progress bar and check for errors in real time.
  4. Keep batch sizes reasonable. For SOAP API, 200 is the maximum and default. For Bulk API, start with 5,000 and adjust based on performance.

After the Operation

  1. Review the success file. Confirm the expected number of records were processed.
  2. Review the error file. Investigate every error. Common causes include validation rule failures, required field violations, duplicate rule blocks, and trigger exceptions.
  3. Spot-check records in Salesforce. Open a few records in the UI to verify the data looks correct.
  4. Re-enable automation. If you temporarily disabled triggers or validation rules, re-enable them immediately.
  5. Communicate with stakeholders. Let users know the data operation is complete, especially if it involved ownership changes or record deletions.

Data Loader Limitations

LimitationDetails
Desktop installation requiredData Loader must be installed on a computer. It is not a browser-based tool.
No native scheduling in GUIThe GUI mode does not support scheduling. You must use the CLI with an external scheduler.
5 million record limitMaximum of 5 million records per operation. For larger volumes, split the CSV into multiple files.
API call consumptionEach batch consumes an API call. Large operations can deplete your org’s daily API limit. Monitor usage in Setup > Company Information.
No transformationData Loader does not transform data. You must prepare your CSV with the exact values you want in Salesforce. Use Excel, a script, or an ETL tool for transformations before loading.
Relationship handlingTo set lookup or master-detail relationships, you must include the related record’s Salesforce ID (or External ID for upsert) in your CSV.

Choosing the Right Tool

With all these tools available, how do you decide which one to use? Here is a decision framework:

Quick Reference Matrix

CriteriaMass DeleteMass TransferData Import WizardData Loader
OperationDelete onlyTransfer ownership onlyInsert, Update, UpsertInsert, Update, Upsert, Delete, Hard Delete, Export
Objects supported8 standard objectsAccounts, Leads, Service Contracts, Custom ObjectsLeads, Accounts/Contacts, Solutions, Campaign Members, Custom ObjectsAll standard and custom objects
Max recordsNo hard limit (page-by-page)No hard limit (page-by-page)50,0005,000,000
Requires CSVNoNoYesYes
Requires installationNo (browser-based)No (browser-based)No (browser-based)Yes (desktop app)
Can be automatedNoNoNoYes (CLI mode)
Skill levelBeginnerBeginnerBeginnerIntermediate
Export capabilityNoNoNoYes

Decision Flowchart

Ask yourself these questions in order:

  1. Do I need to delete records?

    • If the object is one of the eight supported by Mass Delete and the volume is small: Mass Delete.
    • Otherwise: Data Loader (Delete).
  2. Do I need to change record ownership?

    • If the transfer is from one user to one other user and involves Accounts, Leads, or Custom Objects: Mass Transfer Records.
    • If the redistribution is complex (multiple new owners, conditional logic): Data Loader (Update on OwnerId).
  3. Do I need to import new records?

    • If the object is supported by the Data Import Wizard and volume is under 50,000: Data Import Wizard.
    • If the object is not supported or volume exceeds 50,000: Data Loader (Insert).
  4. Do I need to update existing records?

    • If the update is a simple address change on Accounts: Mass Update Addresses.
    • For anything else: Data Loader (Update or Upsert).
  5. Do I need to export data?

    • Data Loader (Export) is the only built-in tool for this. (You can also use Report Export for smaller datasets.)
  6. Does the operation need to run automatically on a schedule?

    • Data Loader CLI is the only built-in option that supports scheduling.

Common Mistakes and How to Avoid Them

Mistake 1: Overwriting Data with Blank Values

What happens: You create an update CSV with 20 columns but only want to change two fields. The other 18 columns are blank. Data Loader updates all 20 fields, overwriting existing data with blanks.

How to avoid: Only include the ID column and the specific columns you want to update. Remove all other columns from the CSV.

Mistake 2: Forgetting to Disable Automation

What happens: You insert 50,000 Lead records. Each insert triggers a Flow that sends a welcome email. You just sent 50,000 emails.

How to avoid: Before large inserts or updates, review active Flows, Triggers, and Workflow Rules. Deactivate non-essential automation, run the data operation, then reactivate.

Mistake 3: Using the Wrong API

What happens: You try to insert 200,000 records using the SOAP API (batch size 200). Data Loader makes 1,000 API calls, takes hours, and may hit the daily API limit.

How to avoid: Enable Bulk API for any operation over 10,000 records. Bulk API processes batches of up to 10,000 records and is dramatically faster.

Mistake 4: Not Saving the Success File

What happens: You insert 10,000 records, close Data Loader, and later realize you need to update those records. But you do not have their Salesforce IDs because you did not save the success file.

How to avoid: Always save the success file to a known location. Name it descriptively (e.g., 2026-03-18_lead_insert_success.csv).

Mistake 5: Running in Production Without Testing

What happens: Your CSV has a formatting issue in row 5,001. The first 5,000 records load fine, but rows 5,001 onward fail. Now you have a partial load in production and need to figure out which records were created and which were not.

How to avoid: Always run the full operation in a sandbox first. Verify the results. Fix any issues. Then repeat in production with confidence.

Mistake 6: Ignoring Record Locking

What happens: You run a parallel Bulk API update that touches 100,000 Opportunity records. Multiple batches try to update Opportunities on the same Account simultaneously, causing lock contention and batch failures.

How to avoid: Sort your CSV by the parent record (e.g., AccountId for Opportunities) so that related records end up in the same batch. Alternatively, enable Serial Mode to process batches one at a time.


Third-Party Alternatives

While this post focuses on built-in Salesforce tools, it is worth knowing that several third-party tools exist for bulk data operations:

ToolKey Advantage
Dataloader.ioBrowser-based Data Loader alternative. No installation required. Supports scheduling. Free tier available.
JitterbitEnterprise ETL tool with native Salesforce connectors. Supports complex transformations.
Informatica CloudSalesforce’s recommended enterprise integration platform.
MuleSoftAPI-led integration platform (owned by Salesforce). Designed for complex multi-system integrations.
DemandToolsSpecialized data quality tool for Salesforce. Strong duplicate management and mass-update capabilities.
ApsonaBrowser-based tool for multi-object data operations with a spreadsheet-like interface.

These tools do not replace the need to understand Salesforce’s built-in tools. The exam will test you on Data Loader and Data Import Wizard, and your org may not have a budget for third-party licenses. But in enterprise environments, these tools can save significant time on complex, recurring data operations.


Permissions Required

A quick reference for which permissions are needed for each mass data tool:

ToolRequired Permission
Mass DeleteModify All Data
Mass Transfer RecordsModify All Data (or Transfer Record permission for specific objects)
Mass Transfer Approval RequestsManage Users or Modify All Data
Mass Reassign Account TeamsModify All Data
Mass Reassign Opportunity TeamsModify All Data
Mass Update AddressesModify All Data
Data Import WizardAppropriate object-level CRUD permissions. Does not require Modify All Data.
Data LoaderAPI Enabled permission plus appropriate object-level CRUD permissions

Key distinction: The Data Import Wizard and Data Loader do not require the “Modify All Data” system permission. They work with the user’s existing object-level permissions. This means you can give a marketing manager the ability to import leads via the Data Import Wizard without giving them admin-level access to the entire org.


Practical Scenario: Full Employee Offboarding Data Transfer

Let’s tie everything together with a realistic scenario. A sales rep named Alex Torres has resigned. Here is the complete data transfer checklist:

Step 1: Audit Alex’s Data

Use Data Loader Export to understand the scope:

SELECT Id, Name FROM Account WHERE OwnerId = '005XXXXXXXXXXXX'
SELECT Id, Name, StageName FROM Opportunity WHERE OwnerId = '005XXXXXXXXXXXX' AND IsClosed = false
SELECT Id, Subject FROM Case WHERE OwnerId = '005XXXXXXXXXXXX' AND IsClosed = false
SELECT Id, Name FROM Lead WHERE OwnerId = '005XXXXXXXXXXXX' AND IsConverted = false

Use Mass Transfer Records to transfer Alex’s accounts to the new owner. Check the options to also transfer open opportunities and open cases.

Step 3: Transfer Remaining Leads

Use Mass Transfer Records > Transfer Leads to move Alex’s unconverted leads to the new owner.

Step 4: Reassign Account Team Memberships

Use Mass Reassign Account Teams to replace Alex on any account teams where they are listed as a member.

Step 5: Reassign Opportunity Team Memberships

Use Mass Reassign Opportunity Teams to replace Alex on any opportunity teams.

Step 6: Transfer Pending Approvals

Use Mass Transfer Approval Requests to move any approval requests currently assigned to Alex to another approver.

Step 7: Verify

Spot-check several accounts, opportunities, and cases to confirm ownership transferred correctly. Run a report filtered by OwnerId to confirm no records still belong to Alex.

Step 8: Freeze and Deactivate

Freeze Alex’s user account (to prevent login) and then deactivate it. You cannot deactivate a user who still owns records, which is why Steps 2-6 must happen first.


Summary Table

ToolLocationObjectsOperationsMax RecordsCSV RequiredAutomatable
Mass DeleteSetup > Data8 standard objectsDeleteUnlimited (page-by-page)NoNo
Mass Transfer RecordsSetup > DataAccounts, Leads, Service Contracts, Custom ObjectsTransfer ownershipUnlimited (page-by-page)NoNo
Mass Transfer Approval RequestsSetup > DataAll objects with approval processesTransfer pending approvalsUnlimited (page-by-page)NoNo
Mass Reassign Account TeamsSetup > DataAccountsAdd/Replace/Remove team membersUnlimited (page-by-page)NoNo
Mass Reassign Opportunity TeamsSetup > DataOpportunitiesAdd/Replace/Remove team membersUnlimited (page-by-page)NoNo
Mass Update AddressesSetup > DataAccountsUpdate billing/shipping addressesUnlimited (page-by-page)NoNo
Data Import WizardSetup > DataLeads, Accounts/Contacts, Solutions, Campaign Members, Custom ObjectsInsert, Update, Upsert50,000YesNo
Data Loader (GUI)Desktop appAll objectsInsert, Update, Upsert, Delete, Hard Delete, Export5,000,000YesNo
Data Loader (CLI)Desktop app (CLI mode)All objectsInsert, Update, Upsert, Delete, Hard Delete, Export5,000,000YesYes

What’s Next?

In Part 34, we will explore Salesforce Offline Access — how the Salesforce mobile app handles offline scenarios, which data is cached, how conflicts are resolved when the device reconnects, and how administrators configure offline access for their users. Offline access is a critical capability for field reps and service technicians who work in areas with unreliable connectivity.

See you in the next post!