2 min read

How to Migrate WooCommerce Orders Between Stores

An order migration needs a reviewable source file, a test import, and verification in the target store. In Shirely, order export and import use WooCommerce order APIs, so the workflow supports both HPOS and legacy order storage.

Before you start

  1. Back up both stores and work on a test copy first.
  2. Import the catalog before orders. Order line items resolve a product by SKU or numeric product ID.
  3. Import customers if you need orders to connect to accounts in the new store. Missing customer accounts become guest orders and are reported as warnings.
  4. Export a small sample of source orders and review the file before moving the full history.

Export from the source store

Export Orders to CSV. Filter by status and date where that makes the migration easier to verify. The export has one row per order and includes the order ID, provenance reference, dates, totals, billing and shipping fields, line items, and refunds.

Keep order_id and origin_ref unchanged. A bare order number is not globally safe: a number can refer to a different order in the destination store.

Test, then import

Import a small batch first. Check the preview, then verify representative orders in WooCommerce: a multi-item order, a refunded order, and records from different dates and statuses.

The importer writes non-empty fields supplied in the CSV. Existing line items remain when line_items is absent or empty; a non-empty value replaces them. Refund data uses amount:reason; Shirely skips it for a target order that already has refunds, preventing a repeat import from creating another refund.

Verify provenance and warnings

Shirely uses origin_ref to recognize a re-import from the same source. If it cannot verify an incoming row against an existing target order, or the source number collides with an order from another store, it skips the row rather than overwrite data. Resolve warnings before treating the migration as complete.

Do not rely on a row count alone. Compare a sample of dates, totals, addresses, line items, refunds, and customer connections in the target store.

FAQ

Does the process support HPOS?
Yes. Shirely uses WooCommerce order objects and queries for order import and export.

Will it overwrite an unrelated order with the same number?
No. When provenance cannot be verified or a foreign source number collides, the importer skips the row and reports it.

Do I need to migrate products first?
Yes, if the orders contain line items. The referenced product must exist for the line item to resolve.

Are coupons included?
Coupon data is a separate entity. Plan and test it separately rather than assuming it moves with order rows.

Use the order export guide and the order import guide for the exact CSV structure.