Answers.Body: <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>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-11-01T18:16:57.503Z
Answers.Text: `--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!
Answers.UserDisplayName: August Miller
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-11-03T22:50:54.787Z
Answers.Text: 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.
Answers.UserDisplayName: Moritz
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-11-01T13:17:24.513Z
Answers.LastActivityDate: 2023-11-01T13:17:24.513Z
Answers.UserDisplayName: Moritz
Body: <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>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-10-31T19:20:42.580Z
Comments.Text: 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?
Comments.UserDisplayName: August Miller
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-10-31T19:24:47.257Z
Comments.Text: 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.
Comments.UserDisplayName: August Miller
Tags: <multi-site><projectconfig><project.yaml>
Title: Craft sites not stored in project.yaml
ThreadText: # 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, username_1, 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.  
  
  ---
  
  