<p>Thanks, August, you’re explanation of how sites are stored helped me to solve the problem. I did nor grasp before that sites config is stored in a separate folder. It was already included in the git repository (a good hint however) and a <code>--force</code> did not change anything in the repo – but: the config wasn’t applied when running <code>php craft up</code>. My solution was to run <code>php craft cache/flush-all</code> before applying the config.</p>

CC BY-SA 4.0
2023-11-01T18:16:57.503Z
`--force` when used with `project-config/apply` just reapplies everything stored in YAML. If you want to write out YAML from the environment you consider to be the source of truth, use `project-config/rebuild`. See [Troubleshooting Project Config](https://craftcms.com/docs/4.x/project-config.html#troubleshooting-trivia) for more info!
August Miller
CC BY-SA 4.0
2023-11-03T22:50:54.787Z
Thanks for your clarification. In my case the source environment files were fully in line with Craft so a rebuild was not necessary (I did it, to be save, but nothing changed).The cache flush solved the problem.
Moritz
CC BY-SA 4.0
2023-11-01T13:17:24.513Z
2023-11-01T13:17:24.513Z
Moritz
<p>Today I installed a Craft project (Craft version 4.5.9) onto a new server (git pull, manualy copy of web/assets, composer install, db dump import, craft up). Everything runs fine except one thing:</p>
<p>The installation has to sites (setting › sites). On the new installation both sites were present but the not default one had the same title and slug as the default site. I had to change it manually.</p>
<p>I checked the <code>project.yaml</code>: The sites are not stored in it. Neither in the original installation nor in the new one.</p>
<p>I understand that all project settings should be saved in the <code>project.yaml</code>. Have I found a bug or did I forget one necessary step? Thank you for ideas!</p>

CC BY-SA 4.0
2023-10-31T19:20:42.580Z
Sites should _definitely_ be written out as part of Project Config—but in a subdirectory named `sites/`. Each site will be in a separate file, with a format like `{handle}--{uuid}.yaml`. Is it possible that this directory matches a `.gitignore` rule?
August Miller
CC BY-SA 4.0
2023-10-31T19:24:47.257Z
I misunderstood, originally—both sites are _created_, but they have unexpected names? You may need to do `php craft project-config/apply --force` to reapply all project config values in the new environment. It sounds like something got out of sync, and Craft doesn't see the updates due to matching timestamps in the YAML files and the database.
August Miller
<multi-site><projectconfig><project.yaml>
Craft sites not stored in project.yaml
# Craft sites not stored in project.yaml

(Asked by: username_0 on 2023-10-31)

Today I installed a Craft project (Craft version 4.5.9) onto a new server (git pull, manualy copy of web/assets, composer install, db dump import, craft up). Everything runs fine except one thing:

The installation has to sites (setting › sites). On the new installation both sites were present but the not default one had the same title and slug as the default site. I had to change it manually.

I checked the `project.yaml`: The sites are not stored in it. Neither in the original installation nor in the new one.

I understand that all project settings should be saved in the `project.yaml`. Have I found a bug or did I forget one necessary step? Thank you for ideas!

**Tags:** multi-site, projectconfig, project.yaml
> **Comments:**
> **username_1**: Sites should _definitely_ be written out as part of Project Config—but in a subdirectory named `sites/`. Each site will be in a separate file, with a format like `{handle}--{uuid}.yaml`. Is it possible that this directory matches a `.gitignore` rule?  
> **username_1**: I misunderstood, originally—both sites are _created_, but they have unexpected names? You may need to do `php craft project-config/apply --force` to reapply all project config values in the new environment. It sounds like something got out of sync, and Craft doesn't see the updates due to matching timestamps in the YAML files and the database.  

---

## 1 answers

### Answer by username_0 on 2023-11-01. Score: 2

Thanks, August, you’re explanation of how sites are stored helped me to solve the problem. I did nor grasp before that sites config is stored in a separate folder. It was already included in the git repository (a good hint however) and a `--force` did not change anything in the repo – but: the config wasn’t applied when running `php craft up`. My solution was to run `php craft cache/flush-all` before applying the config.

> **Comments:**
> **username_1**: `--force` when used with `project-config/apply` just reapplies everything stored in YAML. If you want to write out YAML from the environment you consider to be the source of truth, use `project-config/rebuild`. See [Troubleshooting Project Config](https://craftcms.com/docs/4.x/project-config.html#troubleshooting-trivia) for more info!  
> **username_0**: Thanks for your clarification. In my case the source environment files were fully in line with Craft so a rebuild was not necessary (I did it, to be save, but nothing changed).The cache flush solved the problem.  

---

