简体   繁体   中英

Wordpress bulk products upload (woocommerce) - 650K

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?

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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM