• Resolved yandoos

    (@yandoos)


    Hello

    I was hoping for some sage council on sql tables. Using phpmyadmin I need to manually insert orders to the database. The info includes the order, product and user. All users have an account on the websites. They are coming from a completely different system so I will modify the existing data structure to work with Woocommerce tables. I was hoping you could tell me what tables I will need to insert to. From my understanding it is:

    _posts
    _postmeta
    _woocommerce_order_items
    _woocommerce_order_itemmeta

    Can you please advise if there are any tables I am missing or can exclude please? Is there any other considerations I need to know for this to work without breaking the site. I assume I don’t need to insert into the look up tables because this can be regenerated from with Woocommerce?

    Thank you!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Saif

    (@babylon1999)

    Hello @yandoos,

    Thank you for reaching out!

    Dealing with the database directly will be challenging, especially when it comes to orders, as you have the option to import them as posts or via the dedicated order table (HPOS).

    For more details on HPOS, you can refer to: https://woo.com/document/high-performance-order-storage/

    I suggest using a plugin like Import Export Suite for WooCommerce instead. It allows for CSV import, possibly necessitating only minor edits to column names and data rearrangements from your existing platform. :?)

    I suggest you give it a try (we don’t offer trials but we have a 30 day refund policy). If this extension turns out to be not what you were looking for, please reach out to us via email and we’ll be more than happy to help find alternatives.

    Hope this helps!

    Thread Starter yandoos

    (@yandoos)

    Thanks for getting back to me. I’ve had a look at the documentation which doesn’t say anything about remapping fields on import. I think I’d need this functionality so wp all import/export might be a better fit? That being said I’m not even sure if I can export the data into anything other than a mysql dump. I could write a script to format the data and structure so it fits with Woocommerce so it would be of interest to know what tables I would need to insert into to create orders. If you could please advise that would be awesome!

    Thank you!

    Saif

    (@babylon1999)

    I could write a script to format the data and structure so it fits with Woocommerce so it would be of interest to know what tables I would need to insert into to create orders.

    As mentioned earlier, it’s not one single table. You’ll need to first check if HPOS is enabled. If the site still uses the WP posts (legacy) method, this guide can provide insight into the structure: Legacy Method Structure Guide

    With HPOS it’s a different story. For detailed information on High-Performance Order Storage (HPOS) and backward compatibility, refer to this resource: HPOS Guide

    I’ve had a look at the documentation which doesn’t say anything about remapping fields on import

    I tested this briefly, and seems like with Advance mode you can remap things however you like. :?)


    Link to image: https://d.pr/i/SzAZv0

    If you have any questions about this please open a new ticket from WooCommerce.com > MY profile > Support.

    Hope this helps!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Manually insert Orders to DB’ is closed to new replies.