Answers.Body: <p>I suggest adopting one environment as the primary, in your case it's probably production, and then use that database and config files as your starting point.</p>
  <p>The Craft CMS docs walk through it here: <a href="https://craftcms.com/docs/4.x/project-config.html#adopting-project-config" rel="nofollow noreferrer">https://craftcms.com/docs/4.x/project-config.html#adopting-project-config</a></p>
  <p>The Craft CMS team created project config to make it simpler to move configuration and settings between environments. Practically speaking, this means you can create a new section and fields in your local development environment, saved in your project config files, and then deploy those changes to another environment without needing to redo work in other environments. Craft checks the config files and applies changes (or you can run a console command to apply them on deploy).</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-10-19T16:49:40.513Z
Answers.Text: Hey, thanks for answering. I suppose indeed re-forking the development database and project.yaml from production is the best way to move forward now. Just to make sure: next time, I should apply the changes in the development admin CP, pull the project.yaml into production and Craft will automatically apply them (including the content)?
Answers.UserDisplayName: gleerman
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-10-19T16:17:27.653Z
Answers.LastActivityDate: 2022-10-19T16:17:27.653Z
Answers.UserDisplayName: CraftQuest
Body: <p>I recently started a project where I inherited a fully functional website and the owner asked me to perform some tweaks. I started by making a duplicate of both the codebase and the database into a separate environment for development.</p>
  <p>One of the features was to create a new page and add it to the navigation. So I went like this:</p>
  <ol>
  <li>Configure the stuff in my development admin panel</li>
  <li>Have them validated</li>
  <li>Configured the same stuff in the production admin panel</li>
  <li>Publish them. Everybody happy</li>
  </ol>
  <p><em>(I am aware that we are skipping a part where a testing environment would be suitable, but that's beyond the point)</em></p>
  <p>On to the next feature, which included some code changes. Upon starting to code, I noticed a change in my <code>project.yaml</code> file from the last feature. So I committed it into Git, since someone from P&amp;T <a href="https://craftcms.stackexchange.com/a/36780">posted</a> that's what I should do :)</p>
  <p>So, here I am, applying the change in <code>project.yaml</code> to my production environment (overwriting the file there), and I get this error with the stacktrace pointing to <code>craft\web\Application-&gt;_processConfigSyncLogic()</code>. Luckily I have a backup from which I can restore, and then the site is operational again.</p>
  <p>I guess I introduced a conflict somewhere by applying the changes both in the production admin portal and in the <code>project.yaml</code>, resulting in different identifiers in the databases and such. This makes sense in retrospect (although I don't like the redundancy that we have here), but since I am still finding my way around Craft CMS,
  it's a mistake I was bound made and I want to fix.</p>
  <p>Could anyone please give me some pointers on how to resolve my problem?
  Thanks a lot!</p>
  <p>EDIT: maybe I should mention that the current CraftCMS version is 3.3.15 - should this issue have been resolved in an update since then. Updating the Craft CMS is on the roadmap after having the urgencies fixed.</p>
  
Tags: <projectconfig><project.yaml>
Title: Project config in Git, conflicting with changes already applied in admin CP
ThreadText: # Project config in Git, conflicting with changes already applied in admin CP
  
  (Asked by: username_0 on 2022-10-19)
  
  I recently started a project where I inherited a fully functional website and the owner asked me to perform some tweaks. I started by making a duplicate of both the codebase and the database into a separate environment for development.
  
  One of the features was to create a new page and add it to the navigation. So I went like this:
  
  1. Configure the stuff in my development admin panel
  2. Have them validated
  3. Configured the same stuff in the production admin panel
  4. Publish them. Everybody happy
  
  *(I am aware that we are skipping a part where a testing environment would be suitable, but that's beyond the point)*
  
  On to the next feature, which included some code changes. Upon starting to code, I noticed a change in my `project.yaml` file from the last feature. So I committed it into Git, since someone from P&T [posted](https://craftcms.stackexchange.com/a/36780) that's what I should do :)
  
  So, here I am, applying the change in `project.yaml` to my production environment (overwriting the file there), and I get this error with the stacktrace pointing to `craft\web\Application->_processConfigSyncLogic()`. Luckily I have a backup from which I can restore, and then the site is operational again.
  
  I guess I introduced a conflict somewhere by applying the changes both in the production admin portal and in the `project.yaml`, resulting in different identifiers in the databases and such. This makes sense in retrospect (although I don't like the redundancy that we have here), but since I am still finding my way around Craft CMS,
  it's a mistake I was bound made and I want to fix.
  
  Could anyone please give me some pointers on how to resolve my problem?
  Thanks a lot!
  
  EDIT: maybe I should mention that the current CraftCMS version is 3.3.15 - should this issue have been resolved in an update since then. Updating the Craft CMS is on the roadmap after having the urgencies fixed.
  
  **Tags:** projectconfig, project.yaml
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2022-10-19. Score: 2 | Accepted answer
  
  I suggest adopting one environment as the primary, in your case it's probably production, and then use that database and config files as your starting point.
  
  The Craft CMS docs walk through it here: <https://craftcms.com/docs/4.x/project-config.html#adopting-project-config>
  
  The Craft CMS team created project config to make it simpler to move configuration and settings between environments. Practically speaking, this means you can create a new section and fields in your local development environment, saved in your project config files, and then deploy those changes to another environment without needing to redo work in other environments. Craft checks the config files and applies changes (or you can run a console command to apply them on deploy).
  
  > **Comments:**
  > **username_0**: Hey, thanks for answering. I suppose indeed re-forking the development database and project.yaml from production is the best way to move forward now. Just to make sure: next time, I should apply the changes in the development admin CP, pull the project.yaml into production and Craft will automatically apply them (including the content)?  
  
  ---
  
  