skip to Main Content

I’m using WordPress + Woocommerce for one project. The problem is that the CSV file from the client has over 650k records for products and I have to upload all these products to woocommerce store.

WordPress using 2 tables (wp_posts, wp_postmeta) for products and 3 tables(wp_terms, wp_term_taxonomy, wp_term_relationships) for categories and tags. All products should be uploaded as just simple woocommerce products.

Not sure what could be the best option for such data migration.

I tried to use a WordPress import plugin for this (WP All Import) but it was taking too much time.

By using this script (largeCSV2mySQL) I was able to import 650k products info to the database table in less than 10s. Is there anyway to import all those 650k products to woocommerce store in such a fast way?

What could be the best experience to handle such huge data?

2

Answers


  1. I recommend creating a function that retrieves the data from the file and sends it to WordPress/Woocommerce with wp_insert_post and the post_type ‘product’.

    Login or Signup to reply.
  2. I highly recommend using the Woocommerce REST API to perform the population of the data. You’ll definitely need to write code to process your file by utilizing the CRUD actions available to you. The REST API handles most of the heavy lifting, all you need to do is read the data from your file and fit it to the API.

    If you do have a large number of products to import, and it’s all in a single file, try composing your importer to only process a range of lines (can do with with command line parameters). That would allow you to run the import in multiple terminals and split the load, rather than having to write something that’s multithreaded using pthreads.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search