Data Loader Pointed at Production Instead of Sandbox
“Forgot to check the Sandbox checkbox. Updated 30,000 records in production instead of sandbox.”
What Happened
Friday afternoon. I was testing a data migration in sandbox. Or so I thought. Data Loader defaults to production login. I forgot to check the Sandbox checkbox in Settings. Ran an update on 30,000 Contact records in production. Changed their MailingState to a test value. The client's Friday email campaign went out with garbage addresses. I got the call at 6 PM and my stomach dropped when I opened Data Loader and saw it pointed at login.salesforce.com, not test.salesforce.com.
The Wrong Way
// Data Loader Settings: // Server Host: login.salesforce.com ← PRODUCTION // ☐ Sandbox (UNCHECKED) // // You THINK you're in sandbox. // You're in production. // You just updated 30,000 Contacts with test data. // On a Friday. Before a campaign send.
The Right Way
// Data Loader Settings: // ☑ Sandbox → Server Host: test.salesforce.com // // Better yet, use SFDX for data operations: // sf org display --target-org MySandbox // ALWAYS verify which org you're connected to. // // Pro tip: Create separate Data Loader profiles // for each environment. Name them clearly: // "PROD - DO NOT USE FOR TESTING" // "Sandbox - Safe for testing" // // Or use Salesforce CLI: // sf data import tree --target-org sandbox-alias // The alias makes it explicit.
The Lesson
Always verify your target org before running Data Loader. Set up separate profiles for prod and sandbox. Better yet, use Salesforce CLI with named orgs so you always know where you're pointing.
Enjoyed this? Get more like it.
Glen's Musings — AI, investing, and building things. Occasional. Free.
More Data Mistakes
Mass Update With No Backup: The 'Undo' Button That Doesn't Exist
Ran a mass update on 50,000 records without exporting them first. Client asked to revert. I had nothing.
Read morePainfulNo Duplicate Rules: 14,000 Duplicate Accounts Later
Launched an org without duplicate matching rules. Users created duplicates for a year. Cleanup took three months.
Read morePainfulHard Delete When Soft Delete Would Do
Used Hard Delete in Data Loader. Records bypassed the Recycle Bin. Permanent deletion. No recovery.
Read more