1
nona42
6y

[Prestashop question / rant]

Yes, it's not StackOverflow here, neither is it prestashop support forum - but I trust u people most :)

Proper solution for working with big(?) import of products from XML (2,5MB, ~8600 items) to MySQL(InnoDB) within prestashop backoffice module (OR standalone cronjob)

"solutions" I read about so far:
- Up php's max execution time/max memory limit to infinity and hope it's enough
- Run import as a cronjob
- Use MySQL XML parsing procedure and just supply raw xml file to it
- Convert to CSV and use prestashop import functionality (most unreliable so far)
- Instead of using ObjectModel, assemble raw sql queries for chunks of items
- Buy a pre-made module to just handle import (meh)

Maybe an expert on the topic could recommend something?

Comments
  • 0
    Which one have you tried ?
  • 0
    That doesn't seem big.

    I don't know Prestashop so you'll have to figure the details yourself.

    You want to ensure is that objects are not inserted one by one, but with a batch query.
  • 0
    My course of action would be:

    - just use whatever feature that allows import on your local or dev server (you DO have at least one of those, right?)

    - time the execution, and check what queries are being made (you do have the means to do that right?)

    - if there are too many queries, optimize that (you can modify all the code in your dependencies, right?)

    - if it takes too much time, optimize that. Please note that if it's too complicated, you might have to code the XML to query parser yourself. Or use a worker that don't have any execution time limit and just don't care about that.

    - repeat until execution time and number of queries are good enough

    - make a back-up of the prod site, put it on maintenance mode, run the thing. If anything fails, roll-back to back-up, and go back to testing on dev.
Add Comment