shopify-migration-deep-dive
Migrate e-commerce data to Shopify using bulk operations, product imports, and the strangler fig pattern for gradual platform migration. Trigger with phrases like "migrate to shopify", "shopify data migration", "import products shopify", "shopify replatform", "move to shopify".
Best use case
shopify-migration-deep-dive is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Migrate e-commerce data to Shopify using bulk operations, product imports, and the strangler fig pattern for gradual platform migration. Trigger with phrases like "migrate to shopify", "shopify data migration", "import products shopify", "shopify replatform", "move to shopify".
Teams using shopify-migration-deep-dive should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/shopify-migration-deep-dive/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How shopify-migration-deep-dive Compares
| Feature / Agent | shopify-migration-deep-dive | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Migrate e-commerce data to Shopify using bulk operations, product imports, and the strangler fig pattern for gradual platform migration. Trigger with phrases like "migrate to shopify", "shopify data migration", "import products shopify", "shopify replatform", "move to shopify".
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
Related Guides
Best AI Skills for Claude
Explore the best AI skills for Claude and Claude Code across coding, research, workflow automation, documentation, and agent operations.
ChatGPT vs Claude for Agent Skills
Compare ChatGPT and Claude for AI agent skills across coding, writing, research, and reusable workflow execution.
SKILL.md Source
# Shopify Migration Deep Dive
## Overview
Migrate product catalogs, customers, and orders to Shopify using the GraphQL Admin API bulk mutations, CSV imports, and incremental migration patterns.
## Prerequisites
- Source platform data exported (CSV, JSON, or API access)
- Shopify store with appropriate access scopes
- Scopes needed: `write_products`, `write_customers`, `write_orders`, `write_inventory`
## Instructions
### Step 1: Assess Migration Scope
| 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 |
### Step 2: Bulk Product Import with productSet
`productSet` is idempotent — it creates or updates based on `handle`. Perfect for migrations.
```typescript
const PRODUCT_SET = `
mutation productSet($input: ProductSetInput!) {
productSet(input: $input) {
product {
id
title
handle
variants(first: 50) {
edges {
node { id sku price inventoryQuantity }
}
}
}
userErrors { field message code }
}
}
`;
// Migrate products in batches
async function migrateProducts(sourceProducts: SourceProduct[]): Promise<MigrationResult> {
const results: MigrationResult = { success: 0, errors: [] };
for (const product of sourceProducts) {
try {
const response = await client.request(PRODUCT_SET, {
variables: {
input: {
title: product.name,
handle: product.slug, // unique identifier for upsert
descriptionHtml: product.description,
vendor: product.brand,
productType: product.category,
tags: product.tags,
status: "DRAFT", // Keep as draft until verified
variants: product.variants.map((v) => ({
price: String(v.price),
sku: v.sku,
barcode: v.barcode,
optionValues: v.options.map((opt) => ({
optionName: opt.name,
name: opt.value,
})),
})),
metafields: product.metadata?.map((m) => ({
namespace: "migration",
key: m.key,
value: m.value,
type: "single_line_text_field",
})),
},
},
});
if (response.data.productSet.userErrors.length > 0) {
results.errors.push({
product: product.name,
errors: response.data.productSet.userErrors,
});
} else {
results.success++;
}
} catch (error) {
results.errors.push({ product: product.name, errors: [{ message: (error as Error).message }] });
}
// Respect rate limits — pause between batches
await new Promise((r) => setTimeout(r, 200));
}
return results;
}
```
### Step 3: Bulk Operations for Large Imports
For importing thousands of products, use Shopify's staged uploads + bulk mutation:
```typescript
// Step 1: Create a staged upload target
const STAGED_UPLOAD = `
mutation stagedUploadsCreate($input: [StagedUploadInput!]!) {
stagedUploadsCreate(input: $input) {
stagedTargets {
url
resourceUrl
parameters { name value }
}
userErrors { field message }
}
}
`;
const uploadTarget = await client.request(STAGED_UPLOAD, {
variables: {
input: [{
resource: "BULK_MUTATION_VARIABLES",
filename: "products.jsonl",
mimeType: "text/jsonl",
httpMethod: "POST",
}],
},
});
// Step 2: Upload JSONL file to the staged target
// Each line is the variables for one mutation call
const jsonlContent = products.map((p) =>
JSON.stringify({ input: { title: p.name, handle: p.slug } })
).join("\n");
// Upload to the staged target URL...
// Step 3: Run bulk mutation
const BULK_MUTATION = `
mutation bulkOperationRunMutation($mutation: String!, $stagedUploadPath: String!) {
bulkOperationRunMutation(mutation: $mutation, stagedUploadPath: $stagedUploadPath) {
bulkOperation { id status }
userErrors { field message }
}
}
`;
```
### Step 4: Set Inventory Levels
```typescript
// After products are created, set inventory quantities
const SET_INVENTORY = `
mutation inventorySetQuantities($input: InventorySetQuantitiesInput!) {
inventorySetQuantities(input: $input) {
inventoryAdjustmentGroup {
reason
changes {
name
delta
quantityAfterChange
}
}
userErrors { field message }
}
}
`;
await client.request(SET_INVENTORY, {
variables: {
input: {
reason: "correction",
name: "available",
quantities: [
{
inventoryItemId: "gid://shopify/InventoryItem/12345",
locationId: "gid://shopify/Location/67890",
quantity: 100,
},
],
},
},
});
```
### Step 5: URL Redirects (SEO Preservation)
```typescript
// Preserve old URLs by creating redirects
const CREATE_REDIRECT = `
mutation urlRedirectCreate($urlRedirect: UrlRedirectInput!) {
urlRedirectCreate(urlRedirect: $urlRedirect) {
urlRedirect { id path target }
userErrors { field message }
}
}
`;
// Map old URLs to new Shopify URLs
for (const redirect of urlMappings) {
await client.request(CREATE_REDIRECT, {
variables: {
urlRedirect: {
path: redirect.oldPath, // "/old-product-page"
target: redirect.newPath, // "/products/new-handle"
},
},
});
}
```
### Step 6: Post-Migration Validation
```typescript
async function validateMigration(expectedCounts: Record<string, number>): Promise<void> {
const checks = [
{
name: "Products",
query: "{ productsCount { count } }",
path: "productsCount.count",
expected: expectedCounts.products,
},
{
name: "Customers",
query: "{ customersCount { count } }",
path: "customersCount.count",
expected: expectedCounts.customers,
},
];
for (const check of checks) {
const response = await client.request(check.query);
const actual = check.path.split(".").reduce((obj: any, k) => obj[k], response.data);
const status = actual >= check.expected ? "PASS" : "FAIL";
console.log(`${status}: ${check.name} — expected ${check.expected}, got ${actual}`);
}
}
```
## Output
- Products migrated with variants, images, and metafields
- Inventory levels set at correct locations
- URL redirects preserving SEO
- Migration validated against source counts
## Error Handling
| 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 |
## Examples
### Quick Migration Status
```bash
# 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/2024-10/graphql.json" \
| jq '.data.productsCount.count'
```
## Resources
- [productSet Mutation (Upsert)](https://shopify.dev/docs/api/admin-graphql/latest/mutations/productSet)
- [Bulk Operations Mutations](https://shopify.dev/docs/api/usage/bulk-operations/imports)
- [Inventory Management](https://shopify.dev/docs/apps/build/orders-fulfillment/inventory-management-apps)
- [URL Redirects](https://shopify.dev/docs/api/admin-graphql/latest/mutations/urlRedirectCreate)
## Next Steps
For advanced troubleshooting, see `shopify-advanced-troubleshooting`.Related Skills
workhuman-upgrade-migration
Workhuman upgrade migration for employee recognition and rewards API. Use when integrating Workhuman Social Recognition, or building recognition workflows with HRIS systems. Trigger: "workhuman upgrade migration".
wispr-upgrade-migration
Wispr Flow upgrade migration for voice-to-text API integration. Use when integrating Wispr Flow dictation, WebSocket streaming, or building voice-powered applications. Trigger: "wispr upgrade migration".
windsurf-upgrade-migration
Upgrade Windsurf IDE, migrate settings from VS Code or Cursor, and handle breaking changes. Use when upgrading Windsurf versions, migrating from another editor, or handling configuration changes after updates. Trigger with phrases like "upgrade windsurf", "windsurf update", "migrate to windsurf", "windsurf from cursor", "windsurf from vscode".
windsurf-migration-deep-dive
Migrate to Windsurf from VS Code, Cursor, or other AI IDEs with full configuration transfer. Use when migrating a team to Windsurf, transferring Cursor rules, or evaluating Windsurf against other AI editors. Trigger with phrases like "migrate to windsurf", "switch to windsurf", "windsurf from cursor", "windsurf from copilot", "windsurf evaluation".
webflow-upgrade-migration
Analyze, plan, and execute Webflow SDK upgrades (webflow-api v1 to v3) with breaking change detection, API v1-to-v2 migration, and deprecation handling. Trigger with phrases like "upgrade webflow", "webflow migration", "webflow breaking changes", "update webflow SDK", "webflow v1 to v2".
webflow-migration-deep-dive
Execute major Webflow migrations — from other CMS platforms to Webflow CMS, between Webflow sites, or large-scale content re-architecture using the Data API v2 bulk endpoints, strangler fig pattern, and data validation. Trigger with phrases like "migrate to webflow", "webflow migration", "import into webflow", "webflow replatform", "move content to webflow", "webflow bulk import", "wordpress to webflow".
vercel-upgrade-migration
Upgrade Vercel CLI, Node.js runtime, and Next.js framework versions with breaking change detection. Use when upgrading Vercel CLI versions, migrating Node.js runtimes, or updating Next.js between major versions on Vercel. Trigger with phrases like "upgrade vercel", "vercel migration", "vercel breaking changes", "update vercel CLI", "next.js upgrade on vercel".
vercel-migration-deep-dive
Migrate to Vercel from other platforms or re-architecture existing Vercel deployments. Use when migrating from Netlify, AWS, or Cloudflare to Vercel, or when re-platforming an existing Vercel application. Trigger with phrases like "migrate to vercel", "vercel migration", "switch to vercel", "netlify to vercel", "aws to vercel", "vercel replatform".
veeva-upgrade-migration
Veeva Vault upgrade migration for REST API and clinical operations. Use when working with Veeva Vault document management and CRM. Trigger: "veeva upgrade migration".
veeva-migration-deep-dive
Veeva Vault migration deep dive for enterprise operations. Use when implementing advanced Veeva Vault patterns. Trigger: "veeva migration deep dive".
vastai-upgrade-migration
Upgrade Vast.ai CLI, migrate API versions, and handle breaking changes. Use when upgrading vastai CLI, detecting deprecations, or migrating between API versions. Trigger with phrases like "upgrade vastai", "vastai migration", "vastai breaking changes", "update vastai CLI".
vastai-migration-deep-dive
Migrate GPU workloads to or from Vast.ai, or between GPU providers. Use when switching from AWS/GCP/Azure GPU instances to Vast.ai, migrating between GPU types, or re-platforming ML infrastructure. Trigger with phrases like "migrate to vastai", "vastai migration", "switch to vastai", "vastai from aws", "vastai from lambda".