Redactor migration might fail with allowAdminChanges & useProjectConfigFile false One of the recent Craft updates (something close to 3.1.25) also brought a redactor migration (https://github.com/craftcms/redactor/blob/v2/src/migrations/m190225_003922_split_cleanup_html_settings.php), which fails when those 2 configs are disabled:

'allowAdminChanges' =&gt; false,
'useProjectConfigFile' =&gt; false,


The reason why it fails is that the migration tries to do something with projectConfig, which is read only when allowAdminChanges is disabled.
According to P&amp;T this is expected behavior. Their solution is to put this in config/app.php:

'components' =&gt; [
    'projectConfig' =&gt; function() {
        $config = craft\helpers\App::projectConfigConfig();
        $config['readOnly'] = false;
        return Craft::createObject($config);
    },
],


(Thanks Oli, Brandon, Andris!)

Since I do all migration via Craft's console commands, this shorter solution works for me:

'allowAdminChanges' =&gt; (php_sapi_name() === 'cli')


It simply enables admin changes when using the console command.