I created a product (catalog) import module for magento2. I know there is a import module out of the box in magento2 but this does not serve my needs. All my data is stored in sepperate csv files (this data is updated hourly)

  • articles.csv (7000 products)
  • categories.csv
  • attributes.csv
  • article_attributes.csv

So all this data needs to be imported into magento2.

The import module is executed via the Index controller (mysite.url/import). This works fine and I can see that my products are being imported but it takes very long. After around 10mins I get a 504 Gateway Time-out error

This is my code http://pastebin.com/t3z37X7a

How could I improve my code to reduce the execution time? Or should I try to work with Import classes from magento2 ?

  • 1
    Maybe better to process you csv file and convert it to magento format – KAndy Jun 8 '16 at 18:10
  • By magento format you mean, convert it to one csv file that could be imported by magento ? – Joachim Vanthuyne Jun 9 '16 at 6:39
  • Yes, exectly. It's simplest way – KAndy Jun 9 '16 at 17:35
  • 1
    Sorry for bothering you again, but is there a workaround on the max 2M file limit ? Magento gives me this message: Make sure your file isn't more than 2M. – Joachim Vanthuyne Jun 10 '16 at 11:41
  • 1
    This limits is set also on the mysql parameter because magento import csv data into a import table. – Franck Garnier Dec 6 '16 at 8:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.