技能创建器
skill-creator
创建、改进和评估自定义技能,把专业流程转化为可重复使用的 AI 能力。
shopify-migration-deep-dive【数据与研究】Migrate e-commerce data to Shopify using bulk operations, product imports, and the strangler fig pattern for gradual platform migration. Use when replatforming to Shopify, importing product catalogs, or migrating customer and order data from another e-commerce system. Trigger with phrases like "migrate to shopify", "shopify data migration", "import p…
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
name: shopify-migration-deep-dive description: 'Migrate e-commerce data to Shopify using bulk operations, product imports,
and the strangler fig pattern for gradual platform migration.
Use when replatforming to Shopify, importing product catalogs, or migrating customer and order data from another e-commerce system.
Trigger with phrases like "migrate to shopify", "shopify data migration",
"import products shopify", "shopify replatform", "move to shopify".
' allowed-tools: Read, Write, Edit, Bash(npm:), Bash(node:), Bash(curl:*) version: 2.7.0 license: MIT author: Jeremy Longshore jeremy@intentsolutions.io tags:
Migrate product catalogs, customers, and orders to Shopify using the GraphQL Admin API bulk mutations, CSV imports, and incremental migration patterns.
write_products, write_customers, write_orders, write_inventory| Data Type | Shopify Import Method | Complexity |
|---|---|---|
| Products + variants | productSet mutation (upsert) | Low |
| Product images | productCreateMedia mutation | Low |
| Customers | Customer CSV import or customerCreate | Medium |
| Historical orders | draftOrderCreate + draftOrderComplete | High |
| Inventory levels | inventorySetQuantities mutation | Medium |
| Collections | collectionCreate mutation | Low |
| Redirects (URLs) | urlRedirectCreate mutation | Low |
| Metafields | Included in product/customer mutations | Medium |
productSet is idempotent — it creates or updates based on handle, making it perfect for migrations. Handles variants, metafields, and all product attributes in a single mutation.
See Product Set Migration for the complete migration function.
For importing thousands of products, use Shopify's staged uploads combined with bulk mutation to avoid rate limit issues.
See Bulk Operations Import for the staged upload and bulk mutation workflow.
After products are created, set inventory quantities at each location and create URL redirects to preserve SEO from the old platform.
See Inventory and Redirects for both mutation implementations.
Automated validation that compares expected source counts against actual Shopify counts for products, customers, and other data types.
See Post-Migration Validation for the validation script.
| Issue | Cause | Solution |
|---|---|---|
TAKEN on product handle | Duplicate handle | Append suffix or use productSet for upsert |
| Rate limited during import | Too many sequential calls | Use bulk operations or add delays |
| Image upload fails | URL not publicly accessible | Use staged uploads for private images |
| Inventory not updating | Wrong inventoryItemId | Query variant's inventoryItem.id first |
# Count products in source vs Shopify
echo "Shopify product count:"
curl -sf -H "X-Shopify-Access-Token: $TOKEN" \
-H "Content-Type: application/json" \
-d '{"query": "{ productsCount { count } }"}' \
"https://$STORE/admin/api/${SHOPIFY_API_VERSION:-2025-04}/graphql.json" \
| jq '.data.productsCount.count'