I have a multiselect
field like:
Tags: Item A, Item B ...
This field needs to be changed to a structured field to add more context like so:
Tags:
--
Note: Hello World
Tags: Item A
--
Note: Hi
Tags: Item B
Basically I thought to grab the collection of pages this needs to run on and use the addToStructure
function as per How to Programatically Add Entries to Structure Field - #3 by pedroborges
The problem is that this takes about 2-3s to execute per page, and there are thousands of pages which results in a very long execution time. Somewhat sloppily, I had my migration bound to a route in a plugin function and was trying to run it by curl’ing the endpoint with no timeout. I increased my PHP execution time to something massive like 90 minutes, but things still aren’t working properly (probably nginx issues in between).
In Avoid Php script timeout @lukasbestle mentions running scripts in the commandline instead and was wondering how to best go about doing something like this?
As @bnomei was part of that conversation and is the author of Kirby Janitor, have I answered my own question?