1

I'm trying to upgrade an old Site from Craft 2.9.x. The goal is to eventually upgrade to Craft 4.x, but I thought it would be easier to first update to Craft 3.x. When trying to Finish up my database, I always get the following error:

Not Supported: Changes to the project config are not possible while in read-only mode.
Migration: craft\migrations\m180521_173000_initial_yml_and_snapshot

I tried upgrading to Craft 3.2.x and 3.7.x with the same result. I have never heard of any read-only mode in Craft. I found this thread which seems to have a similar issue, but I don't find any working solution in this thread. I know that the error comes from the first time all the YAML files get created (from Craft 3.1.x), but I don't get how I could fix this error. Any inputs?

1 Answer 1

3

The goal is to eventually upgrade to Craft 4.x, but I thought it would be easier to first update to Craft 3.x

Not just easier; upgrading to the latest 3.x release is a prerequisite for upgrading to Craft 4. But FWIW, it should be completely possible to migrate straight from 2.9.2 to the latest 3.7.x release; I did it just the other day.

Not Supported: Changes to the project config are not possible while in read-only mode.

That error message will appear if something (a migration, in this case) is trying to change something that's tracked in project config, in an environment where the allowAdminChanges config setting is set to false.

To fix the error, make sure that this setting is set to true in the config/general.php file. When you've completed the upgrade, the setting should be set to false in all environments except local/dev.

1
  • 2
    Thanks Mats! I knew about allowAdminChanges and was 99% sure that I had it set to true. Turns out that I defined it as a conditional env variable ($isDev = App::env('ENVIRONMENT') === 'dev';). This normally works perfectly fine, but it seems like the update really didn't like the condition. When setting allowAdminChanges to a fixed value of true the update ran perfectly. Thanks!
    – Sandro
    Commented Mar 2, 2023 at 7:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.