• Resolved atoweb

    (@atoweb)


    Hello

    I have to insert over a million products from XML files.
    I have a script using WC_Product_Simple() , set_name(), set_description(), add_meta_data() etc.
    But this script only imports 5 products/minute. It would take months…
    It is only the insertion part that is slow, reading the XML is very fast.

    So I wonder if it wouldn’t be more efficient to directly insert the products in mysql without using WooCommerce functions?
    If so, how to do it ? What would be the table schema?

    Thanks for your help !

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

    (@babylon1999)

    Hello @atoweb,

    But this script only imports 5 products/minute. It would take months…
    It is only the insertion part that is slow, reading the XML is very fast.

    I understand you want to bulk import products to the database, correct.

    Have you considered using the default bulk importer? It definitely exceeds the 5 products per minute rate your current script is limited to. :?)

    For more information, feel free to browse through this guide: https://woocommerce.com/document/product-csv-importer-exporter/

    Look forward to hearing back from you.

    Thread Starter atoweb

    (@atoweb)

    Even with already more than 150,000 products in the database?
    I could try it indeed, but it would first have to convert XML to CSV to try.

    Saif

    (@babylon1999)

    Even with already more than 150,000 products in the database?

    Absolutely, as far as I know, there’s no set limit.

    However, if your CSV file size goes beyond your server’s upload limit, you might need to increase your server’s upload_max_filesize.

    Let us know how it goes! :?)

    Thread Starter atoweb

    (@atoweb)

    I created the CSV files and indeed the import (via WpAllImport plugin for example) is much faster, about 30 products/min I would say.

    Plugin Support Shameem R. a11n

    (@shameemreza)

    Hi @atoweb

    It seems that this has been marked as resolved. Have you managed to get this sorted, or do you still need help resolving this?

    We’ll be happy to assist further should the issue persist.

    Also, if the issue has been resolved, Please create a new topic if you need further help with WooCommerce core.

    Thanks!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Insert products directly into mysql’ is closed to new replies.