本文へスキップ

Shopify variant IDs changed and inventory reset to 0 after a CSV import

Shopify keeps an existing variant only when its option values stay the same. If an overwrite import changes Option1, Option2 or Option3 value, Shopify deletes the variant and creates a new one with a new ID. In our tests that happened even when only the capitalization changed, and the new variant's inventory was 0. Copy option values exactly from a store export.

起きること

  • Apps, marketplace or ad feeds, or other integrations that store variant IDs stop finding some variants or show errors.
  • Some variants show 0 in stock right after the import.
  • A variant that was in the store is gone.
  • A product now has a single default variant instead of its sizes or colors.
  • The order of variants on the product page changed.

原因

  • Shopify's documentation says that changing data in the Option1 value, Option2 value or Option3 value columns deletes existing variant IDs and creates new ones, which can break third-party dependencies on variant IDs.
  • Keeping the same SKU doesn't help. Based on our tests on a Shopify development store in November 2026, renaming size M to Medium with the SKU unchanged gave the variant a new ID, and its stock went from 5 to 0. Compare-at price and weight were taken from the file.
  • Changing only the capitalization counts as a change. In our tests, changing m to M and l to L gave both variants new IDs.
  • The file has variant columns such as SKU but no Option1 name and Option1 value columns. Shopify's documentation says existing variants are then deleted and a new default variant is created.
  • A variant row is missing from the file. In our tests, an overwrite import deleted a variant that wasn't in the file, even though Shopify's documentation says CSV files can't be used to delete products.
  • Rows are in a different order. In our tests, reordering the rows to L / M / S changed the display order on the product, while the variant IDs stayed the same.

修正方法

  1. Find the affected products. Product exports don't include variant IDs, so compare an export taken before the import with a fresh one in Skuvera's catalog diff: it matches variants by option values and marks variants that were removed or recreated.
  2. Re-enter stock for recreated variants in the admin, or with an inventory CSV if your store has several locations. Shopify's product CSV Inventory quantity column only applies to stores with a single location.
  3. Check other variant details on the new variants, such as cost, barcode and weight, against your backup export.
  4. Update the apps and integrations that rely on variant IDs: re-sync or remap the variants in marketplace, feed, review or subscription apps, and update any saved links that point to a specific variant.
  5. If a variant was deleted by mistake, add its row back and import again. It comes back as a new variant with a new ID, so repeat the stock and integration checks.
  6. If only the order changed, move the rows back into the order you want and import again, or reorder the variants in the admin.

例

修正前
URL handle,Title,Option1 name,Option1 value,SKU,Price
cotton-tee,Cotton tee,Size,S,TEE-S,19.00
cotton-tee,,Size,Medium,TEE-M,19.00
cotton-tee,,Size,l,TEE-L,19.00
修正後
URL handle,Title,Option1 name,Option1 value,SKU,Price
cotton-tee,Cotton tee,Size,S,TEE-S,19.00
cotton-tee,,Size,M,TEE-M,19.00
cotton-tee,,Size,L,TEE-L,19.00

The store has sizes S, M and L. In the new file, “Medium” and the lowercase “l” don't match the store's values, so Shopify would delete those two variants and create new ones with new IDs and, in our tests, zero stock. Copying the values exactly from the store export keeps the existing variants.

予防方法

  • Start from a fresh store export and never retype option values. Keep spelling, spaces and capitalization exactly as exported.
  • Keep every variant row of each product in the file unless you really want to delete that variant.
  • Whenever the file has variant columns such as SKU, price or weight, include Option1 name and Option1 value too.
  • If you do need to rename an option value, plan for it: note the current stock, and tell whoever runs apps that use variant IDs.
  • Compare the store export with the new file in a catalog diff before importing. It flags recreated variants, including capitalization-only changes, deleted variants, rebuilt default variants and order changes. These can't be fixed automatically, so the safe import file lists them for you to handle by hand.

インポートで何が変わるかを確認

ストアのエクスポートと、これからインポートする CSV を比較します。Skuvera はインポート前に、空になる項目、作り直されるバリエーション、スキップされる商品を表示します。無料、ブラウザで動作。

よくある質問

Does changing a price or SKU change the variant ID?
Not in our tests. Changing the price of one variant kept all three variant IDs. What matters is the option values.
Does adding a new variant change the IDs of the existing ones?
No. In our tests, adding size L to a product with S and M kept the IDs of S and M.
Can I keep the stock by putting the old quantity in the CSV?
Don't rely on it. The Inventory quantity column only applies to stores with a single location, and in our development store the product CSV didn't change any stock, so we couldn't confirm it. Check the stock in the admin after importing, or use the inventory CSV.
Can the safe import file prevent variants from being recreated?
No. Whether a variant is kept depends on the option values you want to change, so Skuvera can't decide for you. The catalog diff shows which variants would be recreated or deleted, and the safe import file can leave those products out so you can handle them separately.

出典

その他のデータ問題

2026年11月2日 更新