Lockin-Breaker-Studio
SALESFORCE RELATIONAL INTEGRITY · 15/18-CHAR IDS

Salesforce 15-Char vs 18-Char ID & Orphan Foreign Key Migration

Salesforce Data Loader exports 18-character case-insensitive IDs, while Salesforce Reports export 15-character case-sensitive IDs. Loading both into SQLite or PostgreSQL without canonicalization causes catastrophic silent join collisions where 001000000000abc merges with 001000000000ABC. Lockin-Breaker-Studio normalizes Salesforce IDs deterministically and audits every foreign key prior to commit.

ID Collision Risk
0%
Deterministic 15->18 Base-32 parity
Encoding Support
4-Stage Cascade
utf-8-sig -> utf-8 -> cp1252 -> latin-1
3-Yr Salesforce Savings
$362,481.00
50 seats -> self-hosted PG/SQLite
Rollback Guarantee
Atomic + $0
Zero billing if any FK or hash fails

3-Year TCO & Migration Economics Breakdown

Cost Component (36-Month Horizon) SaaS Lock-In Spend Self-Hosted + Studio Engineering Impact
Salesforce Consultant Data Cleansing (120 hrs)$24,000.00$0.00Automated ID & FK normalizer
Middleware ETL Connectors (MuleSoft/Fivetran)$36,000.00$0.00Direct SQLite/Postgres DDL output
Salesforce API Overage & Sandbox Packs$70,200.00$0.00Zero per-call or sandbox tolls
Self-Hosted Postgres/SQLite Infrastructure$0.00$4,320.00Standard SQL foreign keys
Lockin-Breaker-Studio Multi-App Pack$0.00$399.00One-time flat fee · zero seat tax
3-Year Total (Excluding Base Seats)$130,200.00$4,719.00Saves $125,481.00 before seat cuts

Export Failure Modes & Deterministic Remedies

SaaS Export Trap Why Standard Importers Fail Lockin-Breaker-Studio Deterministic Fix
15-char case-sensitive vs 18-char case-safe IDs Report CSVs (15 chars) fail exact-match joins against API/Data Loader CSVs (18 chars), creating phantom orphan deals. Computes the deterministic 3-character Base-32 uppercase-bit suffix to promote every 15-char ID to its exact 18-char equivalent.
Orphan OwnerId references to deactivated reps Exporting Opportunities without inactive User records breaks FOREIGN KEY (owner_id) constraints. Detects every dangling 005... owner ID in Stage 2 dry-run and emits a stubbed legacy_owners table or warning manifest.
Accounting negative notation ($12,500.00) Credit memos formatted with parentheses parse as opaque TEXT strings instead of negative NUMERIC decimals. Converts accounting parentheses to signed Decimal strings (-12500.00) with zero precision loss.
Windows-1252 punctuation & embedded CRLF Smart quotes (0x93/0x94) and multiline opportunity descriptions break naive line-based importers. Decodes cp1252 cleanly and uses RFC 4180 multiline CSV parsing before per-row SHA-256 verification.

Canonical Salesforce Multi-Table SQLite/Postgres Schema

CREATE TABLE sf_accounts (
  account_id_18 TEXT PRIMARY KEY CHECK (length(account_id_18) = 18),
  account_name TEXT NOT NULL,
  annual_revenue_usd NUMERIC(18, 2)
);

CREATE TABLE sf_opportunities (
  opportunity_id_18 TEXT PRIMARY KEY CHECK (length(opportunity_id_18) = 18),
  account_id_18 TEXT NOT NULL REFERENCES sf_accounts(account_id_18),
  owner_id_18 TEXT NOT NULL,
  amount_usd NUMERIC(18, 2) NOT NULL,
  close_date_utc TEXT NOT NULL,
  stage_name TEXT NOT NULL
);

Step-by-Step Escape Workflow

  1. Run Stage 2 Dry-Run Conflict Scan: Submit Salesforce CSV tables to POST /v1/escape/dry-run to detect 15-char IDs, cp1252 bytes, and orphan OwnerId FKs.
  2. Normalize & Migrate Atomically: Execute POST /v1/escape/migrate to emit canonical 18-char IDs, Decimal NUMERIC amounts, and SQLite + PostgreSQL DDL.
  3. Confirm Per-Row SHA-256 Parity: Verify every migrated opportunity and contact row via POST /v1/escape/verify-parity.

Dry-Run Salesforce ID Normalization & Orphan FK Audit

curl -sS -X POST https://escape.fastmesh.dev/v1/escape/dry-run \
  -H "Content-Type: application/json" \
  -d '{
    "platform": "salesforce",
    "table_name": "sf_opportunities",
    "source_data": "Id,AccountId,OwnerId,Amount,CloseDate,StageName\n0068d00000Aa1Bb,0018d00000Xx9Yy,0058d00000Usr01,"$48,500.00",2026-12-01,Closed Won\n0068d00000Aa2Cc,0018d00000Xx9Yy,0058d00000Orphn,"($1,250.50)",2026-12-15,Credit Memo"
  }'

Every migration runs strictly in memory or ephemeral request-scoped storage (zero customer database retention, zero resale, zero model training). Any empty/corrupt export, dropped row, or 1-byte SHA-256 parity mismatch triggers atomic rollback with billable_usd: "0.00" and charge_micros: 0.

Frequently Asked Questions

How is a 15-character Salesforce ID converted to 18 characters?

The 15 characters are split into three 5-character chunks; each chunk's uppercase bitmask maps to a 32-character alphabet (A-Z, 0-5) producing the exact 3-character checksum suffix.

Does Lockin-Breaker-Studio alter original source IDs silently?

No. Dry-run reports every normalized ID explicitly and maps both raw and canonical 18-char keys so audit trails remain transparent.

What if an opportunity export contains corrupted UTF-8 bytes?

Our 4-stage decoder handles utf-8-sig, utf-8, cp1252, and latin-1 deterministically; unparseable binary junk returns an error with $0.00 billed.

Break Free in 5 Seconds — Zero Signup Required
Paste your export into the live Try-Now Studio or connect via POST /mcp. One-time flat-fee packs: $149 Single Escape · $399 Multi-App · $999 Enterprise Studio.