Migration done in batches because of query timeout