Back to The Times of Claw

How to Import Salesforce into DenchClaw

Import Salesforce contacts, accounts, leads, and opportunities into DenchClaw. Complete migration guide with Data Export, field mapping, and SQL validation.

Mark Rachapoom
Mark Rachapoom
·7 min read
How to Import Salesforce into DenchClaw

How to Import Salesforce into DenchClaw

Importing Salesforce data into DenchClaw is straightforward once you know how to use Salesforce's Data Export tool. Export your objects as CSV, map the fields, and import into DenchClaw's DuckDB-backed schema. This guide covers Contacts, Accounts, Leads, and Opportunities — the core of most Salesforce orgs.

What is DenchClaw? — local-first, open-source AI CRM. Your data stays on your machine in DuckDB. No Salesforce subscription fees, no cloud lock-in.

Why migrate from Salesforce?#

Salesforce is powerful. It's also expensive ($25–$300+ per user per month), notoriously complex to configure, and requires dedicated admins for any serious customization. For startups, consultants, and small teams, the cost-to-value ratio often stops making sense well before you hit enterprise scale.

DenchClaw is the alternative when you want:

  • Zero per-seat costs
  • Full SQL access to all your CRM data
  • Local storage (DuckDB) with no cloud vendor dependency
  • Browser agent automation that works without API setup
  • MIT license — fork it, extend it, own it

Before migrating, benchmark the differences: DenchClaw vs Salesforce.

Step 1: Export from Salesforce#

Salesforce has two export methods. Use Data Export for full migrations.

  1. Go to Setup → Data → Data Export
  2. Click Export Now (or Schedule Export for large orgs)
  3. Select objects: Contacts, Accounts, Leads, Opportunities, and any custom objects
  4. Check Include all data and Replace carriage returns
  5. Submit — Salesforce emails you a download link when ready (can take up to 30 minutes for large orgs)

You'll get a ZIP file with CSVs for each object plus related junction tables.

Option B: Reports (small datasets)#

For quick exports of specific record sets:

  1. Build a Salesforce report with all fields you need
  2. Export → Details Only → CSV

This is faster but only works well for datasets under ~10,000 rows.

Step 2: Understand Salesforce's export format#

Salesforce CSV exports use:

  • 18-character IDs for record references (e.g., 0031t000003A9ZnAAK)
  • Lookup fields as the related record's ID (not name)
  • Date format: YYYY-MM-DDTHH:MM:SS.000Z
  • Checkboxes: TRUE / FALSE
  • Multi-select picklists: Semicolon-separated (e.g., Value1;Value2)

Note the semicolon separator for multi-select — you'll need to handle this during import.

Step 3: Install DenchClaw#

npx denchclaw

Starts on port 19001, frontend at localhost:3100.

Step 4: Create DenchClaw objects#

Create your objects in dependency order:

  1. Accounts (no dependencies)
  2. Contacts (depends on Accounts)
  3. Leads (standalone, may relate to Accounts)
  4. Opportunities (depends on Accounts and Contacts)

Standard field mappings#

Accounts:

SalesforceDenchClaw type
Nametext
BillingCity, BillingState, BillingCountrytext
Phonephone
Websiteurl
Industryselect
AnnualRevenuenumber
NumberOfEmployeesnumber
Typeselect
OwnerIdtext (or relate to Users object)

Contacts:

SalesforceDenchClaw type
FirstName, LastNametext
Emailemail
Phone, MobilePhonephone
Titletext
Departmenttext
AccountIdrelation → Accounts
LeadSourceselect
MailingCity, MailingStatetext

Opportunities:

SalesforceDenchClaw type
Nametext
Amountnumber
StageNameselect (drives Kanban)
CloseDatedate
Probabilitynumber
AccountIdrelation → Accounts
LeadSourceselect
Typeselect
OwnerIdtext

Step 5: Pre-process the CSVs#

Before importing, clean up a few Salesforce-specific quirks:

Convert multi-select separators:

import pandas as pd
 
df = pd.read_csv('Contact.csv')
# Convert Salesforce semicolons to commas for DenchClaw multi-select
df['Multi_Select_Field__c'] = df['Multi_Select_Field__c'].str.replace(';', ', ')
df.to_csv('Contact_cleaned.csv', index=False)

Convert dates: Salesforce exports ISO 8601 datetime strings. DenchClaw's date fields accept YYYY-MM-DD — trim the time component if needed.

df['CloseDate'] = pd.to_datetime(df['CloseDate']).dt.strftime('%Y-%m-%d')

Step 6: Import CSVs into DenchClaw#

  1. Open the object in Table view
  2. Import → CSV
  3. Upload your cleaned CSV
  4. Map columns to fields
  5. Preview and confirm

Import in order: Accounts → Contacts → Leads → Opportunities.

Step 7: Resolve Salesforce ID relationships#

Salesforce lookup fields export as 18-character IDs. After importing, you need to reconnect relations by matching these IDs to the imported records.

Here's the pattern:

-- After importing Contacts and Accounts:
-- Contacts have 'account_sf_id' (the raw Salesforce AccountId)
-- Accounts have 'sf_id' (the raw Salesforce Id)
 
UPDATE entry_fields ef
SET value = (
  SELECT e2.id
  FROM entries e2
  JOIN entry_fields ef2 ON ef2.entry_id = e2.id
  JOIN fields f2 ON f2.id = ef2.field_id
  WHERE f2.key = 'sf_id'
  AND ef2.value = ef.value
  AND e2.object_id = (SELECT id FROM objects WHERE name = 'Accounts')
  LIMIT 1
)
FROM entries e
JOIN entry_fields ef_check ON ef_check.entry_id = e.id
JOIN fields f ON f.id = ef.field_id
WHERE f.key = 'account_id'
AND e.object_id = (SELECT id FROM objects WHERE name = 'Contacts');

Tip: Add a temporary sf_id text field to each object during migration. Populate it with the Salesforce ID during CSV import. Use it to resolve all relations. Delete it after you've validated everything.

Step 8: Set up the Opportunities Kanban#

Salesforce's Opportunity stages map directly to a DenchClaw Kanban:

Typical Salesforce stages:

  • Prospecting
  • Qualification
  • Needs Analysis
  • Value Proposition
  • Id. Decision Makers
  • Perception Analysis
  • Proposal/Price Quote
  • Negotiation/Review
  • Closed Won
  • Closed Lost

In DenchClaw, switch your Opportunities to Kanban view, set Group by = stage_name, and you're done.

Step 9: Handle Activities and Tasks#

Salesforce Activities (Tasks and Events) are the hardest part of any migration. The Task object in Salesforce exports separately.

Options:

  1. Import as a separate Activities object with relation fields back to Contacts and Opportunities
  2. Append key notes to entry documents (DenchClaw's per-entry markdown files)
  3. Skip if stale — most activity history older than 6 months isn't operationally valuable

For option 2:

# Append activity summary to an entry document
echo "## Activity History (imported from Salesforce)\n\n- 2025-11-01: Demo call (45 min)\n- 2025-12-15: Proposal sent" >> ~/.denchclaw/entries/contacts/142.md

Step 10: Validate#

-- Record count validation
SELECT 
  'accounts' as object, COUNT(*) FROM v_accounts
UNION ALL
SELECT 'contacts', COUNT(*) FROM v_contacts
UNION ALL  
SELECT 'opportunities', COUNT(*) FROM v_opportunities;
 
-- Orphaned contacts (no account link)
SELECT id, name FROM v_contacts WHERE account_id IS NULL;
 
-- Pipeline value by stage
SELECT stage_name, COUNT(*) as deals, SUM(amount) as pipeline_value
FROM v_opportunities
WHERE stage_name NOT IN ('Closed Won', 'Closed Lost')
GROUP BY stage_name
ORDER BY SUM(amount) DESC;

Also see how to import from HubSpot for additional import patterns and browser automation for CRM for automating future data syncs.

FAQ#

Does DenchClaw support Salesforce's custom objects? Yes. Create a new object in DenchClaw for each Salesforce custom object. Map the __c fields to DenchClaw field types. The EAV schema handles any number of custom fields.

What about Salesforce reports and dashboards? DenchClaw has its own views (Table, Kanban, Calendar, Timeline, Gallery). For complex analytics, use the App Builder to create custom dashboard apps backed by DuckDB SQL queries.

Can I import Salesforce chatter/activity feeds? Not natively. The most practical approach is to use the browser agent to scrape key Chatter posts or export them via Salesforce's API and append them to entry documents.

What about Salesforce flows and triggers? These don't migrate. In DenchClaw, recreate business logic as action fields (server-side scripts triggered by buttons) or skills.

I have 500,000+ records. Is DenchClaw fast enough? DuckDB handles millions of rows with no performance degradation. Imports at this scale are best done via direct DuckDB SQL inserts rather than the CSV importer UI.

Ready to try DenchClaw? Install in one command: npx denchclaw. Full setup guide →

Mark Rachapoom

Written by

Mark Rachapoom

Building the future of AI CRM software.

Continue reading

DENCH

© 2026 DenchHQ · San Francisco, CA