0

I created some simple products programatically. I need to create nearly 70k products programmatically only. Now it is taking so much time(nearly about 40 hours). So please give some solution to reduce the time. Thank you in advance.

1
  • Please give us more detail. why only programtically? so we can give you some suggest. 1 option is create shell script and run thorugh ssh but it will also take time.
    – Kul
    Commented Nov 22, 2016 at 13:06

3 Answers 3

1

This is not a fully working solution, but an idea.
Instead of creating products by going through $model->save() which takes about 2 eternities you can try a different approach.
You can try to simulate an import.
Not sure if it will work for 70k products at once but you can do it in batches.
Now the approach.
You obviously don't want to create csv files and upload them manually. But you can do this once for a file with 2 or 3 products and see what happens.
From what I remember, the import script parses the file and inserts the data into a table in a json format (importexport_importdata table).
You can try to short-circuit this process and generate a json with some products and insert it into that table.
Then run the script that is executed when you press the import button.
This should take the batch from the db and create the actual products.

Here is some code I wrote 2.5 years ago for a similar problem, but unfortunately I don't remember much about it.

0
0

If you want to create 70k product from script then it will take time, there is no other way for this.

But you can create a script which create 100 products at a time and set that script file in cron to run every 10 min. Then it will create all the product as per your requirement.

0

Try to use shell scripts for upload the bulk products in magento. But make sure your server was supported the shell scripts.

Thanks

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.