mjda
Well-known member
I have an add-on with two different tables (Entities). One is for xf_addon_data and one for xf_addon_data_archive. I'm wanting to move all the records from xf_addon_data_archive to the xf_addon_data table in the Setup.php when I upgrade the add-on. However, I worry about doing a simple foreach because, in my case, there are well over 25,000 records in the archive and I'm worried it could time-out.
I know how to create a Job for that, and I could run it from the Tools->Rebuild caches page, but that doesn't seem like the right way to do it. I think it makes much more sense to do what I'm wanting to do during the upgrade so there isn't an additional step that must be done after the upgrade.
My question is, is there a way to run the Job from Setup.php, or is there a different/better way to do these in batches to prevent it from timing out?
I know how to create a Job for that, and I could run it from the Tools->Rebuild caches page, but that doesn't seem like the right way to do it. I think it makes much more sense to do what I'm wanting to do during the upgrade so there isn't an additional step that must be done after the upgrade.
My question is, is there a way to run the Job from Setup.php, or is there a different/better way to do these in batches to prevent it from timing out?