WordPress.org

Ready to get started?Download WordPress

Forums

WooCommerce - excelling eCommerce
Where are the woocommerce orders stored in the database? (23 posts)

  1. JKNN
    Member
    Posted 1 year ago #

    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.

    http://wordpress.org/extend/plugins/woocommerce/

  2. royho
    Member
    Posted 1 year ago #

    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.

  3. JKNN
    Member
    Posted 1 year ago #

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

  4. royho
    Member
    Posted 1 year ago #

    Yes, the WordPress database includes everything.

  5. SimplyMarkB
    Member
    Posted 1 year ago #

    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

  6. royho
    Member
    Posted 1 year ago #

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

  7. SimplyMarkB
    Member
    Posted 1 year ago #

    Thank you sir!

  8. helgatheviking
    Member
    Posted 1 year ago #

    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.

  9. ManusH
    Member
    Posted 1 year ago #

    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.

  10. SimplyMarkB
    Member
    Posted 1 year ago #

    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

  11. Gapz
    Member
    Posted 1 year ago #

    And it stores the order status in table wp_term_relationships and wp_terms

  12. prettina
    Member
    Posted 1 year ago #

    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..

  13. IgniteWoo
    Member
    Posted 1 year ago #

    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.

  14. IgniteWoo
    Member
    Posted 1 year ago #

    @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.

  15. IgniteWoo
    Member
    Posted 1 year ago #

    Correction since I can no longer edit my post:

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

  16. prettina
    Member
    Posted 1 year ago #

    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.

  17. Permarad
    Member
    Posted 1 year ago #

    @IgniteWoo: do you know where in WooCommerce 1.x the order items are stored in the database?

    Nevermind, order data can be found in wp_postmeta under the meta_key, _order_items.

  18. IgniteWoo
    Member
    Posted 1 year ago #

    @Permarad, ya, in WooCommerce 1.x order items are in postmeta associated with a specific order ID. In 2.x they have their own tables, so code written for 1.x related to order items won't operate correctly with 2.x

  19. jefferytodd
    Member
    Posted 1 year ago #

    How can you get the emails out of the database to use them for a mailing list?

  20. prettina
    Member
    Posted 1 year ago #

    @jefferytodd You need to login to your cpanel and there you can find phpMyAdmin .Once you click that , you can find all corresponding tables.For the emails it will be wp_users table.

  21. jefferytodd
    Member
    Posted 1 year ago #

    Thanks prettina

  22. jefferytodd
    Member
    Posted 1 year ago #

    Is there any way for the owner to get access to those then, it just has to be through the server. That doesn't seem very efficient. Hmm.

  23. Gethin Coles
    Member
    Posted 1 year ago #

    is there a way to ditch all the order that are currently in the DB?
    I loaded example data, and just discovered there are 700 order I need to ditch.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic