Skip to content

[5.x]: craft up doesn't apply project config changes after importing older DB #16668

@MangoMarcus

Description

@MangoMarcus

What happened?

Description

Following on from #15322 (comment)

Running craft up does not apply project config changes after importing an older DB because the config files haven't changed since they were last changed, even though they are now out of sync with the DB. This is due to the modified time of config/project/project.yaml being cached in storage/runtime/cache, and can be avoided by running craft clear-caches/data before running craft up.

Steps to reproduce

  1. Import a DB from production
  2. Run craft pc/apply in case your branch isn't in sync with the DB
  3. Run craft db/backup
  4. Make a project config change - eg. change a section's handle
  5. Restore the DB from step 3
  6. Run craft up

Expected behavior

Section's handle should be updated, craft up should output something like

Checking for pending Craft and plugin migrations ...
No new migrations found. Your system is up to date.

Applying changes from your project config files ...
- updating sections.2fe89ea4-87e0-476a-b167-ada05b0d3313 ... done
- updating dateModified ... done
Finished applying changes

Checking for pending content migrations ...
No new migrations found. Your system is up-to-date.

Actual behavior

Section's handle isn't updated, craft up outputs

Checking for pending Craft and plugin migrations ...
No new migrations found. Your system is up to date.

Checking for pending content migrations ...
No new migrations found. Your system is up-to-date.

Running craft pc/diff also shows no differences until you run craft clear-caches/data

Craft CMS version

5.5.0.1

PHP version

8.2.20

Operating system and version

No response

Database type and version

No response

Image driver and version

No response

Installed plugins and versions

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions