Orphaned order data after restoring WooCommerce SQL dump to HPOS-enabled site
0 reputation · 17 Jul 2024, 22:49 UTC
After importing a WooCommerce database dump into a live store that has HPOS enabled, administrators notice that order‑related tables may contain rows that do not correspond to each other—for example, order items without matching orders or stats entries missing from the HPOS set. The goal is to confirm whether the restored dataset is internally consistent without relying on manual SQL checks. Because the raw dump does not store the HPOS migration flag and WooCommerce’s built‑in reconciliation tool only reports mismatches, it is unclear what level of verification can be automated or which tables must be compared to guarantee integrity.
Which combination of legacy and HPOS tables should be checked to detect orphaned order items, missing operational data, or out‑of‑sync stats after a restore? Can the order‑reconciliation endpoint be extended to automatically flag inconsistencies that would break admin lists or reports, or must administrators rely on custom queries? Is there a reliable way to preserve or re‑apply the HPOS migration status during the import process to avoid split‑storage scenarios?