Magento large import jobs

@Recently i got the task at work to create a Magento job, to process a large amount of products. And update each products attributes and group pricing.

The job was to process 2000 products and updating 4 attributes and to set the group pricing for each product at the store scope.

The first result

By using Magento’s standards logic to fetch and save the products ended up in failure, after running for about 20 minutes and reaching product 1000. It failed because a memory leakage and would probably fail in execution time later on.

Cleary this didn’t work, and after some googling i found a lot of different solutions.

So after some experimenting with the different solutions i found, and by adding some of my own logic i managed to get the job to run under 1 minute.

Here is how i basically solved my problem by splitting it up in 2 solutions.

Saving attributes

A bit of a warning, if you save a value of ´null´ to a attribute it will be deleted for all stores. i had to do a special solution for this.

Saving group prices

If someone has any better solutions please post a comment below.

About author View all posts

Martin Lundberg

Traveler. Lifelong learner. Coder.
When i'm not working, i'm planning the next dream travel!

Leave a Reply