• Hi, after moving a Woocommerce store, the Client History data (on Order pages) is incorrect. Some show multiple purchases where there should be only one, some show NO purchases where there should be at least the current one.

    Is there any way to rebuild/recalculate this type of data?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Support LovingBro (woo-hc)

    (@lovingbro)

    Hi @ravanh,

    Thanks for reaching out about this. That does sound unusual, especially if the customer purchase counts changed after the store migration.

    WooCommerce calculates the “Customer history” data based on the orders linked to a customer account or billing email, so if something changed during the migration, such as user IDs, order associations, or duplicated data, it could affect the counts being shown.

    To help narrow this down, could you let us know:

    1. Was the site migrated to a new domain, server, or both?
    2. Did you use a migration plugin or restore from a backup?
    3. Have you already tried a conflict test by temporarily disabling all plugins except WooCommerce and switching to a default theme like Twenty Twenty-Four to see if the counts change?
    4. Are the affected orders linked to registered customer accounts, guest orders, or both?

    Also, please share your WooCommerce System Status Report so we can take a closer look: https://woocommerce.com/document/understanding-the-woocommerce-system-status-report/

    You can paste it via https://pastebin.com or https://quickforget.com and share the link here.

    Thread Starter Rolf Allard van Hagen

    (@ravanh)

    Hi,

    1. Was the site migrated to a new domain, server, or both?

    New server.

    1. Did you use a migration plugin or restore from a backup?

    Restore from a backup, but also a manual import of latest orders that occurred during the migration. I suspect it went wrong there…

    1. Have you already tried a conflict test by temporarily disabling all plugins except WooCommerce and switching to a default theme like Twenty Twenty-Four to see if the counts change?

    I tried the Health Check & Troubleshooting plugin, with only Woocommerce reactivated. The History calculations are still wrong then. The weird thing: only 922 of the current 1430 orders appear on the Orders admin page. Is this a hint of what could be wrong?

    1. Are the affected orders linked to registered customer accounts, guest orders, or both?

    Both. I notice guest orders often show 0 orders in their history while registered show too many. But even for those that have the correct order number, the average and total amounts are wrong.

    My report on pastebin https://pastebin.com/7dv6btGy

    Plugin Support LovingBro (woo-hc)

    (@lovingbro)

    Hi @ravanh,

    Thanks for sharing those additional details and the System Status Report. The fact that only 922 out of 1430 orders are appearing in the Orders admin page is definitely a strong clue here, especially combined with the incorrect customer history calculations.

    From what you described, it does sound possible that the manual order import during the migration may have caused inconsistencies between the WooCommerce order tables and the lookup tables WooCommerce uses for customer statistics and order history.

    I also noticed from your report that HPOS is enabled on the site. Since HPOS stores orders in dedicated WooCommerce tables, partial imports or mismatched sync data can sometimes lead to symptoms like:

    • Incorrect customer order counts
    • Wrong average or total spent values
    • Guest orders not being linked correctly
    • Missing orders in the admin Orders list

    To start narrowing this down further, could you please check the following:

    1. Go to WooCommerce → Status → Tools
    2. Run these tools one at a time:
      • Regenerate the product lookup tables
      • Recount terms
      • Clear analytics cache
    3. Then check under: WooCommerce → Settings → Advanced → Features

    Please temporarily disable HPOS compatibility mode if enabled, save changes, then re-enable it and allow WooCommerce to resync the order data.

    1. Also, can you confirm:
      • Were the manually imported orders imported directly into the database, or through a plugin/tool?
      • Do the “missing” orders still exist in the wp_wc_orders table and wp_posts table, or only one of them?

    Since the issue persists even in Health Check troubleshooting mode, this is looking less like a plugin conflict and more like a data synchronization or migration inconsistency.

    Let us know what you find after the above checks and we’ll continue from there.

    Ok, I ran the Tools and disabled HPOS Data Caching option (is that what you meant with HPOS compatibility mode?) but the order history calculations are still off.

    I do remember that we switched from Legacy to High-performance order storage after the move. Could that have caused this?

    HPOS Data Caching was switched on because there is a Redis Object Cache on the new hosting environment.

    We did a manual db import of the woocommerce order and customer tables but also a export/import via the WordPress export tool because we noticed a weird issue where some of the latest orders could not be selected (no check box) on the Orders overview admin page.

    About the “missing” orders on the Orders overview admin page: this only happens when in Health Check troubleshooting mode. Then there appear only (today) 923 orders instead of 1,431 without troubleshooting mode.

    I compared the wp_wc_orders table and wp_posts tables:

    • wp_posts has 1524 entries with post type shop_order
    • wc_orders has 1431 entries with type shop_order

    The orders that go missing in Health Check troubleshooting mode, are present in both the wp_wc_orders table and wp_posts tables. In fact, there appear to be 93 more in the wp_posts table. This may well correspond with the number of orders that occurred between the first and the final export/import before switching to the new hosting platform… No idea though, how they would be “doubled” during the process.

Viewing 4 replies - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.