• Hello.

    Pretty simple question: Where are the woocommerce orders stored in the database?

    I would like a solution to this: If my webserver for some reason goes down, I will have no back-up of my orders? These are pretty important for the accounting (which law states that I need). In other words: I am screwed if my site/database goes down for some reason.

    Are these stored in the database? If yes, where? Because then it’s just a question of getting backups of my database once in a while.

    https://www.ads-software.com/extend/plugins/woocommerce/

Viewing 15 replies - 1 through 15 (of 22 total)
  • Plugin Contributor royho

    (@royho)

    HMmm, you should backup the whole database instead of just worrying about the purchase log. You can setup “cron” jobs on your server to do daily backups if you want. Best to ask your host how to achieve this. Or I believe there are also backup plugins you can use where it can also setup an interval function to do backups.

    Thread Starter JKNN

    (@jknn)

    Thanks for the answer. But will my orders and customers be safe then?

    Plugin Contributor royho

    (@royho)

    Yes, the WordPress database includes everything.

    SimplyMarkB

    (@smartguyus)

    Holy cow.. I can’t get an answer to this question anywhere.. LOL!! Where DOES it store orders? What tables can I execute a query on to create a custom report!??

    Its funny because I have found blogs where other people ask similar questions and the responses NEVER answer the question.

    Can anyone please tell me where this is in the DB? And please don’t respond by suggesting plugins to create reports. NONE of them do what I need. I just want the question above answered.. anyone?

    Thanks in advance..
    -mark

    Plugin Contributor royho

    (@royho)

    It’s in wp_posts table and probably postmeta as well for the contents.

    SimplyMarkB

    (@smartguyus)

    Thank you sir!

    HelgaTheViking

    (@helgatheviking)

    yes, “orders” are just a custom post type, so all the orders are stored in wp_posts. there is definitely order info in wp_postmeta and “order_status” is a taxonomy, so you’d need all the various “terms” tables. I’d say you are best served doing a full backup… a plugin like WP DB manager can be automated to email you backups regularly.

    ManusH

    (@manush)

    Orders stored in “wp_posts” table where the “post_type = shop_order”.
    But that only stores the basic info as Order’s Title and Date with an “ID”.
    All the details of that order stored in “wp_postmeta” table using that “post_id” of the order.

    SimplyMarkB

    (@smartguyus)

    Thanks to helgatheviking & ManusH. I need to create custom queries to allow our order processor to see custom reports on the magazine subscription orders that come through. This should help a lot.

    -M

    And it stores the order status in table wp_term_relationships and wp_terms

    I had imported sample data when I got new theme, but I did not know it would reset my order data as well.I did not backup.Is there some way to get the order data back? Please it would be great if anyone can help, like where I should look for it exactly..

    To be clear, in WooCommerce 2.x, orders are stored in the post table, postmeta table, woocommerce_order_items, and woocommerce_order_itemmeta tables. Various parts of an order are stored in different tables.

    In WooCommerce 1.x, there were woocommerce_order_items woocommerce_order_itemmeta tables.

    @prettina: Without a backup there’s no way to recover the data. Ask your hosting company if they have a backup. Most good hosting companies do their own backups that you may not know about.

    Correction since I can no longer edit my post:

    In WooCommerce 1.x, there were NO woocommerce_order_items woocommerce_order_itemmeta tables.

    Thanks, I suppose my hosting company was in the “good” list. Just saved me from trouble.
    I really am thankful to you because I was not aware that they keep backup.

Viewing 15 replies - 1 through 15 (of 22 total)
  • The topic ‘Where are the woocommerce orders stored in the database?’ is closed to new replies.