Which runs first, install-upgrade script or data-upgrade script?

The order is

  1. install
  2. install upgrade script
  3. data script
  4. data upgrade script

More info can be found here: http://inchoo.net/magento/magento-install-install-upgrade-data-and-data-upgrade-scripts/

or http://www.sitepoint.com/magento-install-upgrade-data-scripts-explained/

Or thanks to @RickBuczynski the following link: http://vinaikopp.com/2014/11/03/magento-setup-scripts/

Addition: If you have modules that depend on each other, you should know that when several modules are installed/updated at once, first all normal upgrade scripts run, then all data upgrade scripts. Each in the order how the module are loaded, i.e. with regards to dependencies.


the magento follow this order

  1. install
  2. install upgrade script
  3. data script
  4. data upgrade script

the interesting starts if

in 1st script you insert data (create website)

and in 2nd script you read that data (category finds website)

  1. magento install scripts are run within one transaction
  2. magento upgrade scripts are run in other transaction
  3. the default mysql transaction isolation level REPEATABLE READ

have fun