intercom-migration-deep-dive
Execute major Intercom data migrations and re-platforming with the contacts, conversations, and articles APIs. Use when migrating from Zendesk/Freshdesk to Intercom, bulk-importing contacts, or re-platforming to Intercom. Trigger with phrases like "migrate to intercom", "intercom migration", "import contacts to intercom", "switch to intercom", "zendesk to intercom", "intercom data import".
What this skill does
# Intercom Migration Deep Dive
## Overview
Comprehensive guide for migrating to Intercom from other platforms (Zendesk, Freshdesk, HelpScout) or bulk-importing data. Covers contact import, conversation history, Help Center articles, tags, and companies.
## Prerequisites
- Intercom workspace with access token
- Source system data exported (CSV or API access)
- Feature flag infrastructure for gradual cutover
- Rollback strategy tested
## Migration Types
| Type | Complexity | Duration | Risk |
|------|-----------|----------|------|
| Contact import | Low | Hours | Low |
| Zendesk/Freshdesk migration | Medium | 1-2 weeks | Medium |
| Full re-platform (with history) | High | 2-4 weeks | High |
| Help Center migration | Medium | Days | Low |
## Instructions
### Step 1: Contact Import
```typescript
import { IntercomClient, IntercomError } from "intercom-client";
const client = new IntercomClient({
token: process.env.INTERCOM_ACCESS_TOKEN!,
});
interface SourceContact {
id: string;
email: string;
name: string;
phone?: string;
plan?: string;
company?: string;
created_at: string;
custom_fields?: Record<string, any>;
}
async function importContacts(
contacts: SourceContact[]
): Promise<{ created: number; updated: number; failed: number; errors: any[] }> {
const stats = { created: 0, updated: 0, failed: 0, errors: [] as any[] };
for (const contact of contacts) {
try {
// Search for existing contact by external_id or email
const existing = await client.contacts.search({
query: {
operator: "OR",
value: [
{ field: "external_id", operator: "=", value: contact.id },
{ field: "email", operator: "=", value: contact.email },
],
},
});
if (existing.data.length > 0) {
// Update existing contact
await client.contacts.update({
contactId: existing.data[0].id,
name: contact.name,
phone: contact.phone,
customAttributes: {
...contact.custom_fields,
plan: contact.plan,
migrated_from: "source_system",
migration_date: new Date().toISOString(),
},
});
stats.updated++;
} else {
// Create new contact
await client.contacts.create({
role: "user",
externalId: contact.id,
email: contact.email,
name: contact.name,
phone: contact.phone,
signedUpAt: Math.floor(new Date(contact.created_at).getTime() / 1000),
customAttributes: {
...contact.custom_fields,
plan: contact.plan,
migrated_from: "source_system",
migration_date: new Date().toISOString(),
},
});
stats.created++;
}
// Rate limit: pause every 50 contacts
if ((stats.created + stats.updated) % 50 === 0) {
console.log(`Progress: ${stats.created} created, ${stats.updated} updated`);
await new Promise(r => setTimeout(r, 500));
}
} catch (err) {
stats.failed++;
stats.errors.push({
contact_id: contact.id,
email: contact.email,
error: err instanceof IntercomError
? `${err.statusCode}: ${err.message}`
: (err as Error).message,
});
}
}
return stats;
}
```
### Step 2: Company Import
```typescript
async function importCompanies(
companies: Array<{ id: string; name: string; plan?: string; size?: number }>
): Promise<void> {
for (const company of companies) {
await client.companies.create({
companyId: company.id,
name: company.name,
plan: company.plan,
size: company.size,
customAttributes: {
migrated_from: "source_system",
},
});
await new Promise(r => setTimeout(r, 100)); // Rate limit
}
}
// Attach contacts to companies
async function attachContactToCompany(
contactId: string,
companyId: string
): Promise<void> {
await client.contacts.attachCompany({
contactId,
companyId,
});
}
```
### Step 3: Tag Migration
```typescript
async function migrateTags(
tagMappings: Array<{ sourceName: string; contactIds: string[] }>
): Promise<void> {
for (const mapping of tagMappings) {
// Create tag if it doesn't exist
const tag = await client.tags.create({ name: mapping.sourceName });
// Apply tag to contacts
for (const contactId of mapping.contactIds) {
try {
await client.contacts.tag({ contactId, id: tag.id });
} catch (err) {
if (err instanceof IntercomError && err.statusCode === 404) {
console.warn(`Contact ${contactId} not found, skipping tag`);
continue;
}
throw err;
}
}
console.log(`Tagged ${mapping.contactIds.length} contacts with "${mapping.sourceName}"`);
}
}
```
### Step 4: Help Center Article Migration
```typescript
async function migrateArticles(
articles: Array<{
title: string;
body: string; // HTML content
category: string;
state: "published" | "draft";
}>,
authorId: string // Admin ID who will be the author
): Promise<void> {
// Create or find collections for categories
const collections = new Map<string, string>();
for (const article of articles) {
// Create collection if needed
if (!collections.has(article.category)) {
const collection = await client.helpCenter.createCollection({
name: article.category,
});
collections.set(article.category, collection.id);
}
// Create article in collection
await client.articles.create({
title: article.title,
body: article.body,
authorId,
parentId: collections.get(article.category),
state: article.state,
});
console.log(`Migrated article: ${article.title}`);
await new Promise(r => setTimeout(r, 200)); // Rate limit
}
}
```
### Step 5: Migration Orchestrator
```typescript
interface MigrationPlan {
contacts: SourceContact[];
companies: Array<{ id: string; name: string; plan?: string }>;
tags: Array<{ sourceName: string; contactIds: string[] }>;
articles: Array<{ title: string; body: string; category: string; state: "published" | "draft" }>;
}
async function executeMigration(plan: MigrationPlan): Promise<void> {
console.log("=== Starting Intercom Migration ===");
const startTime = Date.now();
// Phase 1: Companies (contacts reference these)
console.log(`\n[Phase 1] Importing ${plan.companies.length} companies...`);
await importCompanies(plan.companies);
// Phase 2: Contacts
console.log(`\n[Phase 2] Importing ${plan.contacts.length} contacts...`);
const contactStats = await importContacts(plan.contacts);
console.log(` Created: ${contactStats.created}, Updated: ${contactStats.updated}, Failed: ${contactStats.failed}`);
// Phase 3: Tags
console.log(`\n[Phase 3] Migrating ${plan.tags.length} tags...`);
await migrateTags(plan.tags);
// Phase 4: Articles
const adminList = await client.admins.list();
const authorId = adminList.admins[0].id;
console.log(`\n[Phase 4] Migrating ${plan.articles.length} articles...`);
await migrateArticles(plan.articles, authorId);
const duration = ((Date.now() - startTime) / 1000 / 60).toFixed(1);
console.log(`\n=== Migration complete in ${duration} minutes ===`);
if (contactStats.errors.length > 0) {
console.log(`\nFailed contacts: ${contactStats.errors.length}`);
for (const err of contactStats.errors.slice(0, 10)) {
console.log(` ${err.email}: ${err.error}`);
}
}
}
```
### Step 6: Post-Migration Validation
```typescript
async function validateMigration(
expectedCounts: { contacts: number; companies: number; tags: number; articles: number }
): Promise<{ passed: boolean; checks: any[] }> {
const checks = [];
// Check contact count
const contacts = await client.contacts.list({ perPage: 1 });
checks.push({
name: "Contact count",
expected: expectedCountRelated in General
modeling-omnistudio-epc-catalog
IncludedSalesforce Industries CME EPC product-modeling skill for Product2-based catalog creation. Use when creating EPC products, configuring product attributes, building offer bundles with Product Child Items, or reviewing EPC DataPack JSON metadata for product catalog changes. TRIGGER when: user creates or updates Product2 EPC records, AttributeAssignment payloads, AttributeMetadata/AttributeDefaultValues, Offer bundles, or ProductChildItem relationships. DO NOT TRIGGER when: designing OmniScripts/FlexCards/Integration Procedures (use building-omnistudio-omniscript, building-omnistudio-flexcard, or building-omnistudio-integration-procedure), implementing Apex business logic (use generating-apex), or troubleshooting deployment pipelines (use deploying-metadata).
relationship-science-coach
IncludedUse this skill for direct, practical adult relationship coaching: couples conflict, repair, trust, marriage, dating, flirting, attachment patterns, emotional connection, sex, desire differences, eroticism, kink negotiation, affection, love languages, breakups, and long-term passion. Draw on Gottman, EFT and Hold Me Tight, attachment science, modern sex research, Perel, Nagoski, Kerner, Schnarch, Love and Stosny, and flexible love-language tools. Be concrete and low-hedge. Redirect only for imminent danger, abuse, coercive control, minors, non-consent, self-harm, stalking, or medical/legal/psychiatric decisions.
building-sf-integrations
IncludedSalesforce integration architecture and runtime plumbing with 120-point scoring. Use this skill to set up Named Credentials, External Credentials, External Services, REST/SOAP callout patterns, Platform Events, and Change Data Capture. TRIGGER when: user sets up Named Credentials, External Services, REST/SOAP callouts, Platform Events, CDC, or touches .namedCredential-meta.xml files. DO NOT TRIGGER when: Connected App/OAuth config (use configuring-connected-apps), Apex-only logic (use generating-apex), or data import/export (use handling-sf-data).
venue-templates
IncludedAccess comprehensive LaTeX templates, formatting requirements, and submission guidelines for major scientific publication venues (Nature, Science, PLOS, IEEE, ACM), academic conferences (NeurIPS, ICML, CVPR, CHI), research posters, and grant proposals (NSF, NIH, DOE, DARPA). This skill should be used when preparing manuscripts for journal submission, conference papers, research posters, or grant proposals and need venue-specific formatting requirements and templates.
let-fate-decide
IncludedDraws the 12 Houses of the Zodiac Tarot spread to inject entropy into planning when prompts are vague, ambiguous, or casually delegated. Interprets the spread to guide next steps. Use when the user says 'let fate decide', 'YOLO', 'whatever', 'idk', or other nonchalant phrases, makes Yu-Gi-Oh references, or when you are about to arbitrarily pick between multiple reasonable approaches. Prefer over ask-questions-if-underspecified when the user's tone is casual or playful rather than precision-seeking.
net-ops
IncludedCross-platform network troubleshooting (Windows, macOS, Linux) via local or remote shell. Use for: DNS broken, can't resolve hostnames, nslookup/dig works but apps fail, NRPT, WFP, scutil, /etc/resolver, systemd-resolved, /etc/resolv.conf, NetworkManager, VPN DNS leak residue (ProtonVPN/Mullvad/WireGuard/AnyConnect), AV/firewall blocking DNS or DoH, Tailscale DNS interaction, intermittent connectivity, remote diagnostics over SSH.