[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M793M0ZEEPHJSQ3HSYF5509F":3,"skill-same:01M793M0ZEEPHJSQ3HSYF5509F":56},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":33,"commitSha":34,"skillDirectory":35,"forksCount":36,"repositoryHtmlUrl":37,"repositoryHomepageUrl":6,"ownerHtmlUrl":38,"ownerBlogUrl":39,"ownerDescription":40,"updatedAt":41,"install":42,"resources":55},"01M793M0ZEEPHJSQ3HSYF5509F","notion-migration-deep-dive",null,"Migrate data to\u002Ffrom Notion or between Notion workspaces with data mapping and validation.\nUse when migrating data into Notion databases, exporting from Notion, syncing between\nworkspaces, or building ETL pipelines with Notion as source or destination.\nTrigger with phrases like \"migrate notion\", \"notion migration\", \"import to notion\",\n\"export from notion\", \"notion data migration\", \"notion ETL\".","jukeyman\u002Fjukeyman-skills","jukeyman","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F142960420?v=4","01M78FR4Y3DHMMCBCC0GXXNB3F","RICK JEFFERSON","01M78FR4Z8RVQRAD31Y5J7V6EB",1,"MIT","https:\u002F\u002Fgithub.com\u002Fjukeyman\u002Fjukeyman-skills\u002Fblob\u002Fmain\u002Fskills\u002Fsaas-packs--notion-pack--notion-migration-deep-dive\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: notion-migration-deep-dive\ndescription: |\n  Migrate data to\u002Ffrom Notion or between Notion workspaces with data mapping and validation.\n  Use when migrating data into Notion databases, exporting from Notion, syncing between\n  workspaces, or building ETL pipelines with Notion as source or destination.\n  Trigger with phrases like \"migrate notion\", \"notion migration\", \"import to notion\",\n  \"export from notion\", \"notion data migration\", \"notion ETL\".\nallowed-tools: Read, Write, Edit, Bash(npm:*), Bash(node:*), Bash(kubectl:*)\nversion: 1.0.0\nlicense: MIT\nauthor: Jeremy Longshore \u003Cjeremy@intentsolutions.io>\ntags: [saas, productivity, notion]\ncompatible-with: claude-code\n---\n\n# Notion Migration Deep Dive\n\n## Overview\n\nComprehensive migration patterns for moving data to, from, and between Notion workspaces. This covers rate-limited bulk import from CSV\u002FJSON with property mapping, full database export with pagination and block content extraction, cross-database sync with duplicate detection, data transformation patterns for Confluence and Google Docs content, and post-migration validation with integrity checks. All patterns respect Notion's 3 requests\u002Fsecond rate limit.\n\n## Prerequisites\n\n- `@notionhq\u002Fclient` v2+ installed (`npm install @notionhq\u002Fclient`)\n- Python alternative: `notion-client` (`pip install notion-client`)\n- `p-queue` for rate-limited concurrency (`npm install p-queue`)\n- Source data access (CSV files, Confluence API, Google Docs API, etc.)\n- Target Notion database(s) created with matching property schema\n\n## Instructions\n\n### Step 1: Import CSV\u002FJSON into Notion Database\n\nMap source data fields to Notion property types, create pages with rate limiting:\n\n```typescript\nimport { Client } from '@notionhq\u002Fclient';\nimport { readFileSync } from 'fs';\nimport { parse } from 'csv-parse\u002Fsync';\nimport PQueue from 'p-queue';\n\nconst notion = new Client({ auth: process.env.NOTION_TOKEN! });\n\n\u002F\u002F Rate-limited queue: 3 requests\u002Fsecond (Notion's documented limit)\nconst queue = new PQueue({ concurrency: 3, interval: 1000, intervalCap: 3 });\n\ninterface SourceRecord {\n  name: string;\n  status: string;\n  priority: string;\n  dueDate: string;\n  tags: string;       \u002F\u002F Comma-separated\n  assigneeEmail: string;\n  description: string;\n}\n\n\u002F\u002F Map source fields to Notion property value objects\nfunction mapToNotionProperties(record: SourceRecord) {\n  const properties: Record\u003Cstring, any> = {\n    \u002F\u002F Title property (required — every database has exactly one)\n    Name: { title: [{ text: { content: record.name || 'Untitled' } }] },\n\n    \u002F\u002F Select — auto-creates options if they don't exist\n    Status: { select: { name: record.status || 'Not Started' } },\n    Priority: { select: { name: record.priority || 'Medium' } },\n\n    \u002F\u002F Multi-select from comma-separated values\n    Tags: {\n      multi_select: record.tags\n        .split(',')\n        .map(t => t.trim())\n        .filter(Boolean)\n        .map(name => ({ name })),\n    },\n\n    \u002F\u002F Rich text (max 2000 characters per text block)\n    Description: {\n      rich_text: [{ text: { content: (record.description || '').slice(0, 2000) } }],\n    },\n\n    \u002F\u002F Email\n    'Assignee Email': record.assigneeEmail\n      ? { email: record.assigneeEmail }\n      : { email: null },\n  };\n\n  \u002F\u002F Date (only add if valid)\n  if (record.dueDate && !isNaN(Date.parse(record.dueDate))) {\n    properties['Due Date'] = { date: { start: record.dueDate } };\n  }\n\n  return properties;\n}\n\nasync function importFromCSV(csvPath: string, databaseId: string) {\n  const csv = readFileSync(csvPath, 'utf-8');\n  const records = parse(csv, { columns: true, skip_empty_lines: true }) as SourceRecord[];\n\n  console.log(`Importing ${records.length} records into database ${databaseId}...`);\n  const results = { created: 0, failed: 0, errors: [] as string[] };\n\n  \u002F\u002F Validate database schema before importing\n  const db = await notion.databases.retrieve({ database_id: databaseId });\n  const dbProps = Object.keys(db.properties);\n  console.log(`Database properties: ${dbProps.join(', ')}`);\n\n  await Promise.all(records.map((record, index) =>\n    queue.add(async () => {\n      try {\n        const properties = mapToNotionProperties(record);\n\n        \u002F\u002F Remove properties not in database schema\n        for (const key of Object.keys(properties)) {\n          if (!dbProps.includes(key)) delete properties[key];\n        }\n\n        await notion.pages.create({\n          parent: { database_id: databaseId },\n          properties,\n        });\n\n        results.created++;\n        if (results.created % 50 === 0) {\n          console.log(`Progress: ${results.created}\u002F${records.length}`);\n        }\n      } catch (error: any) {\n        results.failed++;\n        results.errors.push(`Row ${index + 1} (\"${record.name}\"): ${error.message}`);\n      }\n    })\n  ));\n\n  console.log(`\\nImport complete: ${results.created} created, ${results.failed} failed`);\n  if (results.errors.length > 0) {\n    console.log('First 10 errors:');\n    results.errors.slice(0, 10).forEach(e => console.log(`  ${e}`));\n  }\n\n  return results;\n}\n```\n\n**Python — CSV import:**\n\n```python\nimport csv\nimport time\nfrom notion_client import Client\n\nclient = Client(auth=os.environ[\"NOTION_TOKEN\"])\n\ndef import_csv(csv_path: str, database_id: str):\n    with open(csv_path) as f:\n        reader = csv.DictReader(f)\n        rows = list(reader)\n\n    created, failed = 0, 0\n    for i, row in enumerate(rows):\n        try:\n            client.pages.create(\n                parent={\"database_id\": database_id},\n                properties={\n                    \"Name\": {\"title\": [{\"text\": {\"content\": row.get(\"name\", \"Untitled\")}}]},\n                    \"Status\": {\"select\": {\"name\": row.get(\"status\", \"Not Started\")}},\n                    \"Tags\": {\"multi_select\": [\n                        {\"name\": t.strip()} for t in row.get(\"tags\", \"\").split(\",\") if t.strip()\n                    ]},\n                },\n            )\n            created += 1\n        except Exception as e:\n            failed += 1\n            print(f\"Row {i+1}: {e}\")\n\n        # Rate limit: 3 requests\u002Fsecond\n        if (created + failed) % 3 == 0:\n            time.sleep(1.1)\n\n    print(f\"Done: {created} created, {failed} failed\")\n```\n\n### Step 2: Export from Notion to JSON\u002FCSV\n\nFull database export with pagination, property extraction, and optional block content:\n\n```typescript\nimport type { PageObjectResponse } from '@notionhq\u002Fclient\u002Fbuild\u002Fsrc\u002Fapi-endpoints';\n\n\u002F\u002F Extract a flat record from a Notion page's properties\nfunction extractProperties(page: PageObjectResponse): Record\u003Cstring, any> {\n  const row: Record\u003Cstring, any> = {\n    id: page.id,\n    url: page.url,\n    created_time: page.created_time,\n    last_edited_time: page.last_edited_time,\n  };\n\n  for (const [name, prop] of Object.entries(page.properties)) {\n    switch (prop.type) {\n      case 'title':\n        row[name] = prop.title.map(t => t.plain_text).join('');\n        break;\n      case 'rich_text':\n        row[name] = prop.rich_text.map(t => t.plain_text).join('');\n        break;\n      case 'number':\n        row[name] = prop.number;\n        break;\n      case 'select':\n        row[name] = prop.select?.name ?? null;\n        break;\n      case 'multi_select':\n        row[name] = prop.multi_select.map(s => s.name).join(', ');\n        break;\n      case 'date':\n        row[name] = prop.date?.start ?? null;\n        break;\n      case 'checkbox':\n        row[name] = prop.checkbox;\n        break;\n      case 'url':\n        row[name] = prop.url;\n        break;\n      case 'email':\n        row[name] = prop.email;\n        break;\n      case 'phone_number':\n        row[name] = prop.phone_number;\n        break;\n      case 'people':\n        row[name] = prop.people.map(p => ('name' in p ? p.name : p.id)).join(', ');\n        break;\n      case 'relation':\n        row[name] = prop.relation.map(r => r.id).join(', ');\n        break;\n      default:\n        row[name] = `[${prop.type}]`;\n    }\n  }\n\n  return row;\n}\n\n\u002F\u002F Export entire database with automatic pagination\nasync function exportDatabase(databaseId: string): Promise\u003CRecord\u003Cstring, any>[]> {\n  const allRows: Record\u003Cstring, any>[] = [];\n  let cursor: string | undefined;\n  let pageCount = 0;\n\n  do {\n    const response = await notion.databases.query({\n      database_id: databaseId,\n      page_size: 100,\n      start_cursor: cursor,\n    });\n\n    for (const page of response.results) {\n      if ('properties' in page) {\n        allRows.push(extractProperties(page as PageObjectResponse));\n      }\n    }\n\n    pageCount++;\n    console.log(`Fetched page ${pageCount} (${allRows.length} total records)`);\n    cursor = response.has_more ? response.next_cursor ?? undefined : undefined;\n  } while (cursor);\n\n  return allRows;\n}\n\n\u002F\u002F Export page with its block content (for rich content migration)\nasync function exportPageWithContent(pageId: string) {\n  const page = await notion.pages.retrieve({ page_id: pageId });\n  const blocks = await getAllBlocks(pageId);\n\n  return {\n    page,\n    content: blocks.map(block => ({\n      type: (block as any).type,\n      text: getBlockPlainText(block as any),\n      hasChildren: (block as any).has_children,\n    })),\n  };\n}\n\nasync function getAllBlocks(blockId: string) {\n  const blocks: any[] = [];\n  let cursor: string | undefined;\n\n  do {\n    const response = await notion.blocks.children.list({\n      block_id: blockId,\n      page_size: 100,\n      start_cursor: cursor,\n    });\n    blocks.push(...response.results);\n    cursor = response.has_more ? response.next_cursor ?? undefined : undefined;\n  } while (cursor);\n\n  return blocks;\n}\n\nfunction getBlockPlainText(block: any): string {\n  const content = block[block.type];\n  if (content?.rich_text) {\n    return content.rich_text.map((t: any) => t.plain_text).join('');\n  }\n  return '';\n}\n```\n\n### Step 3: Cross-Platform Migration and Validation\n\nSee [cross-platform migration patterns](references\u002Fcross-platform-migration.md) for HTML\u002FMarkdown to Notion block conversion, batch content appending, and post-migration validation with integrity checks.\n\n## Output\n\n- Rate-limited CSV\u002FJSON import with property mapping and schema validation\n- Full database export with pagination and property extraction (all property types)\n- Page content export (block-level) for rich content migration\n- HTML\u002FMarkdown to Notion block conversion for Confluence\u002FGoogle Docs content\n- Cross-database sync with duplicate detection\n- Post-migration validation comparing source and target with integrity checks\n- Dual language support (TypeScript and Python)\n\n## Error Handling\n\n| Issue | Cause | Solution |\n|-------|-------|----------|\n| `validation_error` on import | Property name mismatch | Retrieve database schema first with `databases.retrieve` |\n| Rate limited during bulk import | Exceeding 3 req\u002Fs | Use PQueue with `intervalCap: 3, interval: 1000` |\n| Empty title error | Missing required title field | Default to `'Untitled'` for empty names |\n| Select option not found | New option value | Notion auto-creates new select options (not an error) |\n| Relation import fails | Target pages don't exist yet | Import referenced pages first, then create relations |\n| Rich text truncated | Text exceeds 2000 char limit | Split into multiple text blocks |\n| Block append fails | More than 100 blocks | Batch blocks in groups of 100 |\n\n## Examples\n\n### One-Line CSV Import\n\n```bash\n# Quick import with Node.js script\nnode -e \"\nconst { Client } = require('@notionhq\u002Fclient');\nconst { parse } = require('csv-parse\u002Fsync');\nconst fs = require('fs');\nconst notion = new Client({ auth: process.env.NOTION_TOKEN });\nconst rows = parse(fs.readFileSync('data.csv', 'utf-8'), { columns: true });\n(async () => {\n  for (const row of rows) {\n    await notion.pages.create({\n      parent: { database_id: process.env.NOTION_DB_ID },\n      properties: { Name: { title: [{ text: { content: row.name } }] } }\n    });\n    await new Promise(r => setTimeout(r, 350));\n  }\n  console.log('Done:', rows.length, 'imported');\n})();\n\"\n```\n\n### Export to JSON File\n\n```typescript\nconst data = await exportDatabase(process.env.NOTION_DB_ID!);\nwriteFileSync('export.json', JSON.stringify(data, null, 2));\nconsole.log(`Exported ${data.length} records to export.json`);\n```\n\n## Resources\n\n- [Create a Page](https:\u002F\u002Fdevelopers.notion.com\u002Freference\u002Fpost-page) — import endpoint\n- [Query a Database](https:\u002F\u002Fdevelopers.notion.com\u002Freference\u002Fpost-database-query) — export with pagination\n- [Append Block Children](https:\u002F\u002Fdevelopers.notion.com\u002Freference\u002Fpatch-block-children) — add content blocks\n- [Property Value Object](https:\u002F\u002Fdevelopers.notion.com\u002Freference\u002Fproperty-value-object) — all property types\n- [Request Limits](https:\u002F\u002Fdevelopers.notion.com\u002Freference\u002Frequest-limits) — 3 req\u002Fs average\n- [Block Types](https:\u002F\u002Fdevelopers.notion.com\u002Freference\u002Fblock) — paragraph, heading, list, code, etc.\n\n## Next Steps\n\nFor advanced debugging of migration issues, see `notion-advanced-troubleshooting`.\n","# Notion Migration Deep Dive\n\n## Overview\n\nComprehensive migration patterns for moving data to, from, and between Notion workspaces. This covers rate-limited bulk import from CSV\u002FJSON with property mapping, full database export with pagination and block content extraction, cross-database sync with duplicate detection, data transformation patterns for Confluence and Google Docs content, and post-migration validation with integrity checks. All patterns respect Notion's 3 requests\u002Fsecond rate limit.\n\n## Prerequisites\n\n- `@notionhq\u002Fclient` v2+ installed (`npm install @notionhq\u002Fclient`)\n- Python alternative: `notion-client` (`pip install notion-client`)\n- `p-queue` for rate-limited concurrency (`npm install p-queue`)\n- Source data access (CSV files, Confluence API, Google Docs API, etc.)\n- Target Notion database(s) created with matching property schema\n\n## Instructions\n\n### Step 1: Import CSV\u002FJSON into Notion Database\n\nMap source data fields to Notion property types, create pages with rate limiting:\n\n```typescript\nimport { Client } from '@notionhq\u002Fclient';\nimport { readFileSync } from 'fs';\nimport { parse } from 'csv-parse\u002Fsync';\nimport PQueue from 'p-queue';\n\nconst notion = new Client({ auth: process.env.NOTION_TOKEN! });\n\n\u002F\u002F Rate-limited queue: 3 requests\u002Fsecond (Notion's documented limit)\nconst queue = new PQueue({ concurrency: 3, interval: 1000, intervalCap: 3 });\n\ninterface SourceRecord {\n  name: string;\n  status: string;\n  priority: string;\n  dueDate: string;\n  tags: string;       \u002F\u002F Comma-separated\n  assigneeEmail: string;\n  description: string;\n}\n\n\u002F\u002F Map source fields to Notion property value objects\nfunction mapToNotionProperties(record: SourceRecord) {\n  const properties: Record\u003Cstring, any> = {\n    \u002F\u002F Title property (required — every database has exactly one)\n    Name: { title: [{ text: { content: record.name || 'Untitled' } }] },\n\n    \u002F\u002F Select — auto-creates options if they don't exist\n    Status: { select: { name: record.status || 'Not Started' } },\n    Priority: { select: { name: record.priority || 'Medium' } },\n\n    \u002F\u002F Multi-select from comma-separated values\n    Tags: {\n      multi_select: record.tags\n        .split(',')\n        .map(t => t.trim())\n        .filter(Boolean)\n        .map(name => ({ name })),\n    },\n\n    \u002F\u002F Rich text (max 2000 characters per text block)\n    Description: {\n      rich_text: [{ text: { content: (record.description || '').slice(0, 2000) } }],\n    },\n\n    \u002F\u002F Email\n    'Assignee Email': record.assigneeEmail\n      ? { email: record.assigneeEmail }\n      : { email: null },\n  };\n\n  \u002F\u002F Date (only add if valid)\n  if (record.dueDate && !isNaN(Date.parse(record.dueDate))) {\n    properties['Due Date'] = { date: { start: record.dueDate } };\n  }\n\n  return properties;\n}\n\nasync function importFromCSV(csvPath: string, databaseId: string) {\n  const csv = readFileSync(csvPath, 'utf-8');\n  const records = parse(csv, { columns: true, skip_empty_lines: true }) as SourceRecord[];\n\n  console.log(`Importing ${records.length} records into database ${databaseId}...`);\n  const results = { created: 0, failed: 0, errors: [] as string[] };\n\n  \u002F\u002F Validate database schema before importing\n  const db = await notion.databases.retrieve({ database_id: databaseId });\n  const dbProps = Object.keys(db.properties);\n  console.log(`Database properties: ${dbProps.join(', ')}`);\n\n  await Promise.all(records.map((record, index) =>\n    queue.add(async () => {\n      try {\n        const properties = mapToNotionProperties(record);\n\n        \u002F\u002F Remove properties not in database schema\n        for (const key of Object.keys(properties)) {\n          if (!dbProps.includes(key)) delete properties[key];\n        }\n\n        await notion.pages.create({\n          parent: { database_id: databaseId },\n          properties,\n        });\n\n        results.created++;\n        if (results.created % 50 === 0) {\n          console.log(`Progress: ${results.created}\u002F${records.length}`);\n        }\n      } catch (error: any) {\n        results.failed++;\n        results.errors.push(`Row ${index + 1} (\"${record.name}\"): ${error.message}`);\n      }\n    })\n  ));\n\n  console.log(`\\nImport complete: ${results.created} created, ${results.failed} failed`);\n  if (results.errors.length > 0) {\n    console.log('First 10 errors:');\n    results.errors.slice(0, 10).forEach(e => console.log(`  ${e}`));\n  }\n\n  return results;\n}\n```\n\n**Python — CSV import:**\n\n```python\nimport csv\nimport time\nfrom notion_client import Client\n\nclient = Client(auth=os.environ[\"NOTION_TOKEN\"])\n\ndef import_csv(csv_path: str, database_id: str):\n    with open(csv_path) as f:\n        reader = csv.DictReader(f)\n        rows = list(reader)\n\n    created, failed = 0, 0\n    for i, row in enumerate(rows):\n        try:\n            client.pages.create(\n                parent={\"database_id\": database_id},\n                properties={\n                    \"Name\": {\"title\": [{\"text\": {\"content\": row.get(\"name\", \"Untitled\")}}]},\n                    \"Status\": {\"select\": {\"name\": row.get(\"status\", \"Not Started\")}},\n                    \"Tags\": {\"multi_select\": [\n                        {\"name\": t.strip()} for t in row.get(\"tags\", \"\").split(\",\") if t.strip()\n                    ]},\n                },\n            )\n            created += 1\n        except Exception as e:\n            failed += 1\n            print(f\"Row {i+1}: {e}\")\n\n        # Rate limit: 3 requests\u002Fsecond\n        if (created + failed) % 3 == 0:\n            time.sleep(1.1)\n\n    print(f\"Done: {created} created, {failed} failed\")\n```\n\n### Step 2: Export from Notion to JSON\u002FCSV\n\nFull database export with pagination, property extraction, and optional block content:\n\n```typescript\nimport type { PageObjectResponse } from '@notionhq\u002Fclient\u002Fbuild\u002Fsrc\u002Fapi-endpoints';\n\n\u002F\u002F Extract a flat record from a Notion page's properties\nfunction extractProperties(page: PageObjectResponse): Record\u003Cstring, any> {\n  const row: Record\u003Cstring, any> = {\n    id: page.id,\n    url: page.url,\n    created_time: page.created_time,\n    last_edited_time: page.last_edited_time,\n  };\n\n  for (const [name, prop] of Object.entries(page.properties)) {\n    switch (prop.type) {\n      case 'title':\n        row[name] = prop.title.map(t => t.plain_text).join('');\n        break;\n      case 'rich_text':\n        row[name] = prop.rich_text.map(t => t.plain_text).join('');\n        break;\n      case 'number':\n        row[name] = prop.number;\n        break;\n      case 'select':\n        row[name] = prop.select?.name ?? null;\n        break;\n      case 'multi_select':\n        row[name] = prop.multi_select.map(s => s.name).join(', ');\n        break;\n      case 'date':\n        row[name] = prop.date?.start ?? null;\n        break;\n      case 'checkbox':\n        row[name] = prop.checkbox;\n        break;\n      case 'url':\n        row[name] = prop.url;\n        break;\n      case 'email':\n        row[name] = prop.email;\n        break;\n      case 'phone_number':\n        row[name] = prop.phone_number;\n        break;\n      case 'people':\n        row[name] = prop.people.map(p => ('name' in p ? p.name : p.id)).join(', ');\n        break;\n      case 'relation':\n        row[name] = prop.relation.map(r => r.id).join(', ');\n        break;\n      default:\n        row[name] = `[${prop.type}]`;\n    }\n  }\n\n  return row;\n}\n\n\u002F\u002F Export entire database with automatic pagination\nasync function exportDatabase(databaseId: string): Promise\u003CRecord\u003Cstring, any>[]> {\n  const allRows: Record\u003Cstring, any>[] = [];\n  let cursor: string | undefined;\n  let pageCount = 0;\n\n  do {\n    const response = await notion.databases.query({\n      database_id: databaseId,\n      page_size: 100,\n      start_cursor: cursor,\n    });\n\n    for (const page of response.results) {\n      if ('properties' in page) {\n        allRows.push(extractProperties(page as PageObjectResponse));\n      }\n    }\n\n    pageCount++;\n    console.log(`Fetched page ${pageCount} (${allRows.length} total records)`);\n    cursor = response.has_more ? response.next_cursor ?? undefined : undefined;\n  } while (cursor);\n\n  return allRows;\n}\n\n\u002F\u002F Export page with its block content (for rich content migration)\nasync function exportPageWithContent(pageId: string) {\n  const page = await notion.pages.retrieve({ page_id: pageId });\n  const blocks = await getAllBlocks(pageId);\n\n  return {\n    page,\n    content: blocks.map(block => ({\n      type: (block as any).type,\n      text: getBlockPlainText(block as any),\n      hasChildren: (block as any).has_children,\n    })),\n  };\n}\n\nasync function getAllBlocks(blockId: string) {\n  const blocks: any[] = [];\n  let cursor: string | undefined;\n\n  do {\n    const response = await notion.blocks.children.list({\n      block_id: blockId,\n      page_size: 100,\n      start_cursor: cursor,\n    });\n    blocks.push(...response.results);\n    cursor = response.has_more ? response.next_cursor ?? undefined : undefined;\n  } while (cursor);\n\n  return blocks;\n}\n\nfunction getBlockPlainText(block: any): string {\n  const content = block[block.type];\n  if (content?.rich_text) {\n    return content.rich_text.map((t: any) => t.plain_text).join('');\n  }\n  return '';\n}\n```\n\n### Step 3: Cross-Platform Migration and Validation\n\nSee [cross-platform migration patterns](references\u002Fcross-platform-migration.md) for HTML\u002FMarkdown to Notion block conversion, batch content appending, and post-migration validation with integrity checks.\n\n## Output\n\n- Rate-limited CSV\u002FJSON import with property mapping and schema validation\n- Full database export with pagination and property extraction (all property types)\n- Page content export (block-level) for rich content migration\n- HTML\u002FMarkdown to Notion block conversion for Confluence\u002FGoogle Docs content\n- Cross-database sync with duplicate detection\n- Post-migration validation comparing source and target with integrity checks\n- Dual language support (TypeScript and Python)\n\n## Error Handling\n\n| Issue | Cause | Solution |\n|-------|-------|----------|\n| `validation_error` on import | Property name mismatch | Retrieve database schema first with `databases.retrieve` |\n| Rate limited during bulk import | Exceeding 3 req\u002Fs | Use PQueue with `intervalCap: 3, interval: 1000` |\n| Empty title error | Missing required title field | Default to `'Untitled'` for empty names |\n| Select option not found | New option value | Notion auto-creates new select options (not an error) |\n| Relation import fails | Target pages don't exist yet | Import referenced pages first, then create relations |\n| Rich text truncated | Text exceeds 2000 char limit | Split into multiple text blocks |\n| Block append fails | More than 100 blocks | Batch blocks in groups of 100 |\n\n## Examples\n\n### One-Line CSV Import\n\n```bash\n# Quick import with Node.js script\nnode -e \"\nconst { Client } = require('@notionhq\u002Fclient');\nconst { parse } = require('csv-parse\u002Fsync');\nconst fs = require('fs');\nconst notion = new Client({ auth: process.env.NOTION_TOKEN });\nconst rows = parse(fs.readFileSync('data.csv', 'utf-8'), { columns: true });\n(async () => {\n  for (const row of rows) {\n    await notion.pages.create({\n      parent: { database_id: process.env.NOTION_DB_ID },\n      properties: { Name: { title: [{ text: { content: row.name } }] } }\n    });\n    await new Promise(r => setTimeout(r, 350));\n  }\n  console.log('Done:', rows.length, 'imported');\n})();\n\"\n```\n\n### Export to JSON File\n\n```typescript\nconst data = await exportDatabase(process.env.NOTION_DB_ID!);\nwriteFileSync('export.json', JSON.stringify(data, null, 2));\nconsole.log(`Exported ${data.length} records to export.json`);\n```\n\n## Resources\n\n- [Create a Page](https:\u002F\u002Fdevelopers.notion.com\u002Freference\u002Fpost-page) — import endpoint\n- [Query a Database](https:\u002F\u002Fdevelopers.notion.com\u002Freference\u002Fpost-database-query) — export with pagination\n- [Append Block Children](https:\u002F\u002Fdevelopers.notion.com\u002Freference\u002Fpatch-block-children) — add content blocks\n- [Property Value Object](https:\u002F\u002Fdevelopers.notion.com\u002Freference\u002Fproperty-value-object) — all property types\n- [Request Limits](https:\u002F\u002Fdevelopers.notion.com\u002Freference\u002Frequest-limits) — 3 req\u002Fs average\n- [Block Types](https:\u002F\u002Fdevelopers.notion.com\u002Freference\u002Fblock) — paragraph, heading, list, code, etc.\n\n## Next Steps\n\nFor advanced debugging of migration issues, see `notion-advanced-troubleshooting`.\n",{"name":5,"tags":24,"author":28,"license":15,"version":29,"description":30,"allowed-tools":31,"compatible-with":32},[25,26,27],"saas","productivity","notion","Jeremy Longshore \u003Cjeremy@intentsolutions.io>","1.0.0","Migrate data to\u002Ffrom Notion or between Notion workspaces with data mapping and validation.\nUse when migrating data into Notion databases, exporting from Notion, syncing between\nworkspaces, or building ETL pipelines with Notion as source or destination.\nTrigger with phrases like \"migrate notion\", \"notion migration\", \"import to notion\",\n\"export from notion\", \"notion data migration\", \"notion ETL\".\n","Read, Write, Edit, Bash(npm:*), Bash(node:*), Bash(kubectl:*)","claude-code","main","99825ad3f3bcc6597ddcc7294a14e6e922f2b67b","skills\u002Fsaas-packs--notion-pack--notion-migration-deep-dive",0,"https:\u002F\u002Fgithub.com\u002Fjukeyman\u002Fjukeyman-skills","https:\u002F\u002Fgithub.com\u002Fjukeyman","https:\u002F\u002FRJBUSINESSSOLUTIONS.ORG","Credit and Finance Expert | Developer\r\n\r\nI'm Rick Jefferson, a seasoned credit and finance expert with over a decade of experience in financial literacy,","2026-07-13 07:03:29",{"source":8,"skillName":5,"commands":43,"prompt":53,"zipAvailable":54},[44,47,50],{"tool":45,"command":46},"npx","npx skills add jukeyman\u002Fjukeyman-skills --skill notion-migration-deep-dive",{"tool":48,"command":49},"bunx","bunx skills add jukeyman\u002Fjukeyman-skills --skill notion-migration-deep-dive",{"tool":51,"command":52},"pnpm","pnpm dlx skills add jukeyman\u002Fjukeyman-skills --skill notion-migration-deep-dive","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fjukeyman\u002Fjukeyman-skills\u002Fblob\u002Fmain\u002Fskills\u002Fsaas-packs--notion-pack--notion-migration-deep-dive\u002FSKILL.md",true,[],[57,64,71,78,85,93],{"skillNo":58,"name":59,"nameZh":6,"description":60,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":61,"categories":62,"keywords":63,"publishedAt":19},"01M79ANS2SM329NEP5ZCX106RR","zustand-store-creator","Create zustand store creator operations. Auto-activating skill for Frontend Development.\nTriggers on: zustand store creator, zustand store creator\nPart of the Frontend Development skill category. Use when working with zustand store creator functionality. Trigger with phrases like \"zustand store creator\", \"zustand creator\", \"zustand\".","https:\u002F\u002Fgithub.com\u002Fjukeyman\u002Fjukeyman-skills\u002Fblob\u002Fmain\u002Fskills\u002Fzustand-store-creator\u002FSKILL.md",[],[],{"skillNo":65,"name":66,"nameZh":6,"description":67,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":68,"categories":69,"keywords":70,"publishedAt":19},"01M79AMZKP4YDEZ7EHG1Y7PP74","zero-trust-config-helper","Configure with zero trust config helper operations. Auto-activating skill for Security Advanced.\nTriggers on: zero trust config helper, zero trust config helper\nPart of the Security Advanced skill category. Use when configuring systems or services. Trigger with phrases like \"zero trust config helper\", \"zero helper\", \"zero\".","https:\u002F\u002Fgithub.com\u002Fjukeyman\u002Fjukeyman-skills\u002Fblob\u002Fmain\u002Fskills\u002Fzero-trust-config-helper\u002FSKILL.md",[],[],{"skillNo":72,"name":73,"nameZh":6,"description":74,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":75,"categories":76,"keywords":77,"publishedAt":19},"01M79AMJSBCEJQNBTYNAHYN5HM","zapier-integration-helper","Assist with zapier integration helper operations. Auto-activating skill for Business Automation.\nTriggers on: zapier integration helper, zapier integration helper\nPart of the Business Automation skill category. Use when working with APIs or building integrations. Trigger with phrases like \"zapier integration helper\", \"zapier helper\", \"zapier\".","https:\u002F\u002Fgithub.com\u002Fjukeyman\u002Fjukeyman-skills\u002Fblob\u002Fmain\u002Fskills\u002Fzapier-integration-helper\u002FSKILL.md",[],[],{"skillNo":79,"name":80,"nameZh":6,"description":81,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":82,"categories":83,"keywords":84,"publishedAt":19},"01M79AHJZGVMARS13VFQYRR1MP","yaml-config-validator","Validate yaml config validator operations. Auto-activating skill for DevOps Basics.\nTriggers on: yaml config validator, yaml config validator\nPart of the DevOps Basics skill category. Use when configuring systems or services. Trigger with phrases like \"yaml config validator\", \"yaml validator\", \"yaml\".","https:\u002F\u002Fgithub.com\u002Fjukeyman\u002Fjukeyman-skills\u002Fblob\u002Fmain\u002Fskills\u002Fyaml-config-validator\u002FSKILL.md",[],[],{"skillNo":86,"name":87,"nameZh":6,"description":88,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":89,"sourceHtmlUrl":90,"categories":91,"keywords":92,"publishedAt":19},"01M79AHGDZRN0020RDQSQDPAM8","xvary-stock-research","Thesis-driven equity analysis from public SEC EDGAR and market data; \u002Fanalyze, \u002Fscore, \u002Fcompare workflows with bundled Python tools (Claude Code, Cursor, Codex).","https:\u002F\u002Fgithub.com\u002Fjukeyman\u002Fjukeyman-skills\u002Fblob\u002Fmain\u002Fskills\u002Fxvary-stock-research\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fjukeyman\u002Fjukeyman-skills\u002Fblob\u002Fmain\u002Fskills\u002Fxvary-stock-research\u002FSKILL.md",[],[],{"skillNo":94,"name":95,"nameZh":6,"description":96,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":97,"categories":98,"keywords":99,"publishedAt":19},"01M79AHCYJ9FV9RMHQ24HDRN33","xss-vulnerability-scanner","Scan xss vulnerability scanner operations. Auto-activating skill for Security Fundamentals.\nTriggers on: xss vulnerability scanner, xss vulnerability scanner\nPart of the Security Fundamentals skill category. Use when working with xss vulnerability scanner functionality. Trigger with phrases like \"xss vulnerability scanner\", \"xss scanner\", \"xss\".","https:\u002F\u002Fgithub.com\u002Fjukeyman\u002Fjukeyman-skills\u002Fblob\u002Fmain\u002Fskills\u002Fxss-vulnerability-scanner\u002FSKILL.md",[],[]]