Need to create thousands of objects and save to DB programmatically

I have code that reads an XML file and uses it to create and update objects.  The problem is that I need it to create/update 12,000 objects at a time.  How can I use batch database inserts in Elgg to handle this? Or is there another way (that doesn't time out)? 

  • Time outs are not a problem so far as I know as that can be extended with the php set_time_limit() function.

    A larger concern is memory leaks in core Elgg. I have found that doing more than a few hundred large profile inserts at once consumes too much memory. I know Brett was looking into this a while back but for now, I suggest that you structure your code as a cron job that does a few hundred inserts at a time. Probably 500 would be safe.

  • Thanks very much for the insights and suggestions!