Introducing Locomotive
When it comes to batch processing WordPress data there aren’t a ton of options available. Yet, we often find ourselves needing to query large amounts of data, and perform simple and repetitive tasks on them. This might mean moving unapproved comments into an approved status, converting users from one role to another, or migrating posts from one content structure to another. Instances where manual effort won’t get the job done without some serious work.
Think about any time you’ve wanted to pull a large amount of posts and perform a simple action on them. Or maybe you want to manipulate users, comments, terms, or any of the other built-in WordPress post types. Writing a single function that performs a query and makes the data changes works…to a point.
But we often work with sites with thousands of posts. One query would be too much to load at once, so the query needs to be broken up. Then, it’s just a matter of setting the right offset, catching errors, performing the steps asynchronously, and pretty soon the complexity skyrockets.
In the last few years, WP-CLI has helped a lot with these kinds of tasks. But there are still hosting environments that don’t
Source: https://managewp.org/articles/14343/introducing-locomotive

source https://williechiu40.wordpress.com/2017/02/07/introducing-locomotive/