## How to run Batch Operation from hook_update_n()?
hook_update_n() runs before config import and before deploy (when using drush
deploy) Full documentation about hook_update_n()
hook_update_n() runs before config import before hook_post_update() and before deploy (when using drush deploy) They live in any module's install file. (MY_MODULE_NAME.install.php) Full documentation about hook_update_n()
## How to run Batch Operation from hook_post_update()?
Post update runs after all the hook_update_N have run. Post update hooks live in their own file (MY_MODULE_NAME.post_update.php). Hook_post_updates are not sequentially numbered, though they could be. They are suffixed with a name. I suggest using the same name as your BatchOp script or anything else that is meaningful.
1. In whatever local/custom module you want to run this Batch Operation, add
or use the existing MY_MODULE_NAME.post_update.php add the following
hook_post_update functions are only ever run once. The function name is tracked, but is not sequential. Drupal is more stable and fully operationnal than it is during hook_update_N().
## FAQs
- How do I run my script and have it keep going if there are errors?