Problem
New fabrics are created by duplicating a product, which sends them to the default warehouse. Orders were assigned to the wrong location and shipping labels were bought for the wrong address. An order's location could not be changed, because the variant was not stocked anywhere else. The scale was over 500 products and tens of thousands of variants in a live store.
Solution
A command-line tool on the Admin API with backup, dry run, pilot, log, resume, verify and restore. Each change is planned from a snapshot, tried on one product with a rollback test, then run in batches with a log and a read-back from the store. Flow workflows now fix new fabrics and furniture the moment they are created or get a new variant.
Key decisions
Chose a tool with backup, pilot and restore over hand edits or one bulk mutation
Why It is a live store with orders, so there had to be a way back. Restore re-sets stock quantities too, not only the activation.
Chose to keep the tool outside the theme repository
Why Backups contain order data and do not belong in git.
Chose batches of twenty aliased mutations per request
Why The mutation handles one item per call, and aliases give a steady pace and an exact log per item.
Chose to call out every deviation from the spec before writing
Why A strict reading would have skipped almost all the variants, so the change was agreed explicitly.