Page tree
Skip to end of metadata
Go to start of metadata

Overview

cPanel & WHM provides hooks that allow developers to execute custom code when the system migrates to and from EasyApache 4. 

Note:

We introduced these hooks in cPanel & WHM version 58.

Available hooks

EasyApache 4's migration hooks only execute when you migrate a system to EasyApache 4, revert to EasyApache 3, or reinstall EasyApache 4 with either the /scripts/migrate_ea3_to_ea4 script or WHM's EasyApache 4 interface (WHM >> Home >> Software >> EasyApache 4). For more information, read our How to Install or Uninstall EasyApache 4 documentation. 

Note:

These hooks do not use the Standardized Hooks system.

To create an EasyApache 4 migration hook, perform the following steps on the command line as the root user:

  1. Create the /var/cpanel/ea4_migration_hooks/ directory if it does not already exist.
  2. Ensure that the directory has root:root ownership and 750 permissions.

  3. Write a script that specifies the actions that you wish to perform.

You can place more than one script into the hook directory, and the system executes all of them.  Place your script in one of the following directories:

Hook locationDescription
/var/cpanel/ea4_migration_hooks/pre_migration/This hook triggers before migration from EasyApache 3 to EasyApache 4.
/var/cpanel/ea4_migration_hooks/pre_reinstall/This hook triggers before you reinstall EasyApache 4.
/var/cpanel/ea4_migration_hooks/pre_revert/This hook triggers before you revert from EasyApache 4 to EasyApache 3.
/var/cpanel/ea4_migration_hooks/post_migration/This hook triggers after migration from EasyApache 3 to EasyApache 4.
/var/cpanel/ea4_migration_hooks/post_reinstall/This hook triggers after you reinstall EasyApache 4.
/var/cpanel/ea4_migration_hooks/post_revert/This hook triggers after you revert from EasyApache 4 to EasyApache 3.

Important:

  • Scripts must possess root:root ownership and 750 permissions.
  • If the system cannot execute the hook, then it will not run.
  • The post hooks only run if the system will exit the migration script cleanly.

Additional documentation