Recently WooCommerce introduced “High-Performance Order Storage” [HPOS] for WooCommerce orders as a beta feature, which you can activate to save WooCommerce orders data into separate database tables with the following names:
This guide explains how you can make use of this feature to prevent orders in the staging site from replacing orders on the live site whenever you push a staging site to the live site. To do that, follow these steps:
Enable HPOS on Both the Live and Staging site:
Note: HPOS is heavily developed and still work in progress. You find a more detailed instruction on the official WooCommerce HPOS article.
Go to (WooCommerce > Settings > Advanced > Features) and check the “Enable the high performance order storage feature” box as in this screenshot on both the staging and live sites.
Go to (WooCommerce > Settings > Advanced > Custom data stores) and check the “Keep the posts table and the orders tables synchronized” box (you have to enable this for the first time during the setup, then you should be able to turn it off if you want) and click on “Save Changes” as in this screenshot:
After this step WooCommerce will start to sync orders from the regular _posts table to the new _wc_orders table, wait a few minutes then refresh the page and when the synchronization is done, you will see this:
Now you need to choose “Use the WooCommerce orders tables” option as in the screenshot above, and you can enable/disable “Keep the posts table and the orders tables synchronized” as mentioned.
Again, it’s a must to do these steps on both the live and staging sites.
Exclude WooCommerce Orders Tables During The Pushing Process
Now when it comes to pushing a staging site to the live site, you can exclude these tables:
And your live site’s WooCommerce orders will remain the same after the push and not replaced with the staging site’s ones.