Support

Home Forums Event Espresso Premium Registrations Export Time out

Registrations Export Time out

Posted: October 28, 2015 at 10:22 am


Mike Amado

October 28, 2015 at 10:22 am

I am getting a timeout when attempting to export registrations from one of my events when using the export to csv.

There are 4127 registrations on this particular event.

it seems as if it is timing out before it can export all registrations. is there a way to increase the timeout or to manually export via PHPmyadmin?


Lorenzo Orlando Caum

  • Support Staff

October 28, 2015 at 11:25 am

Hi there Mike,

We do have a workaround available that will let you generate that information in batches.

Please take a look at this support post:

https://eventespresso.com/topic/fatal-error-downloading-csv/#post-177907

Then you can download the site specific plugin that will handle this here:

https://gist.github.com/Pebblo/976ed35816bd3b9a6d03

There is a link in the bottom right corner of the page that will allow you to download the site specific plugin. Afterwards, you can go to your WordPress dashboard and upload and activate it.

You could then adjust the array through the plugin editor through the WP dashboard.


Lorenzo


Mike Amado

October 29, 2015 at 2:22 pm

Great article. I’d like to take it a step further to automate the process. (the customer wont want to get the limits after each round) Essentially break down the exports still but loop until an upper limit say 5000 total.

I threw some code together but I’m not too well versed in PHP. Maybe you could help?

I attempted to take your code and loop it out. Basically break down the exports in parts of 900 and then loop all the way to an upper limit of 5000. If my math is right it should loop around 6 times.

Side note, I tested it out and surprise it did NOT work. Think you can help? See the (sloppy) modified code below.

add_filter( ‘FHEE__EE_Export__report_registration_for_event’, ‘ee_custom_export_limits’, 10, 1 );

function ee_custom_export_limits($current_query) {

// The query limit is set here.
$x = 1;
$a = 0;

while ($x < 2){
if ($a <= 5400) {
$current_query[‘limit’] = array($a,900);
$a = $a + 900;
return $current_query;
}
else {
$x = 3
}
}
//array({offset}, {limit})
//Offest = the row to start from
//Limit = the amount of rows to pull in, starting from the offset value.
//So to export 1200 registrations you can break this down into:
//array(0,400); (then run the export and save the file)
//array(400, 400); (again run the export and save the file)
//array(800, 400); (run the final export and save the file)
}


Tony

  • Support Staff

October 29, 2015 at 2:42 pm

We have an open ticket to create a batch system that will loop through the export and save the results of each export to file then send that file to the browser when finished.

The code you have provided will not work as you are not saving the output of export anywhere, or is this part of another function that is looping through and saving each step?

Either way its more complicated than it seems 😉 you can’t just loop through and run the query multiple times, you need to save the output to file on each export, then run the next batch and continue to do so without an ‘upper limit’ (5400 in your case) then when finished send that file as a csv to the browser for the user to download.


Mike Amado

November 3, 2015 at 2:00 pm

Tony,

I appreciate the response! I see exactly what you are saying and it makes total sense, I guess I was not even close hah. It is not part of another function. You said you have an open ticket for a batch system? any way I follow that or see what’s going on with that?


Lorenzo Orlando Caum

  • Support Staff

November 3, 2015 at 4:41 pm

Hi Mike, this is in our internal bug tracker. We’ll let you know once something is available for testing on the repository on GitHub.


Lorenzo


Lorenzo Orlando Caum

  • Support Staff

December 31, 2015 at 12:22 pm

Hello again Mike,

A current version of Event Espresso 4 introduces a batching feature where the records are retrieved in the background and then combined into one file. This will help with events with thousands of events.

You can see the changelog here:

https://eventespresso.com/wiki/ee4-changelog/

Be sure to backup your WordPress site (https://eventespresso.com/wiki/how-to-back-up-your-site/) before making changes.

If you have any other questions about Event Espresso 4, then please create a new support post in our support forums:

https://eventespresso.com/support/forums/

Thanks and have a happy new year!


Lorenzo

The support post ‘Registrations Export Time out’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Event Espresso