We are using D8's Configuration Management for our site. When we delete fields in our local development environment the corresponding content type and field yml files are updated to reflect the change. However when we deploy these changes to our production environment, the field is not deleted. It is simply moved to the hidden (Disabled) spot for the content type under manage fields.

As a result we have to manually go in and delete the field in production. How can we delete the fields on production when new configuration files are deployed?

Deployment process:

  1. In our local environment, make the changes by deleting the fields
  2. Export config into the config/sync folder and commit into git
  3. Deploy branch with latest updates to config/sync folder to Cloud environment such as production
  4. run drush config-import and select the vcs option (to import from git)
  5. navigate to the content type and verify changes
  6. observe that the field is hidden, not deleted.
  • Are you sure you emptied the config/sync directory on production before copying & importing? Deleting a field means (at least) one less file, so you need to make sure not just to overwrite existing files, but also to remove obsolete files. – Hudri Mar 8 '18 at 0:27
  • Yes, either delete the config/sync folder fist or use rsync --delete. – Berdir Mar 8 '18 at 11:28
  • @Hudri yes - the file is deleted in git and removed from the config/sync directory. – usernameabc Mar 8 '18 at 18:55
  • @Berdir not sure i understand what you are saying Yes to (my question or Hudri's comment), but i will try rsync --delete – usernameabc Mar 8 '18 at 18:56
  • To his comment. rsync --delete is only relevant if you're already using rsync to copy the config files around. If the file is not in the sync folder then it will be deleted, guaranteed, I've done that dozens of times. Something with your deploy process is not right it seems, but you need to provide more details, e.g. the exact steps/commands that you run – Berdir Mar 9 '18 at 2:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.