0

So when i try to manually import configs (/admin/config/development/configuration) i get these messages:

  • Entities exist of type Media and Media type Image. These entities need to be deleted before importing.
  • Entities exist of type Media and Media type File. These entities need to be deleted before importing.
  • Entities exist of type Content and Content type Media tester. These entities need to be deleted before importing.

Core is 8.6.1

Anyone know how to solve this? Btw this is prod, so deleting content is a no go.

1

This is tricky to solve. And with the limited data provided in the question, there are a few steps that I would suggest you take:

  1. Backup!!! No need to emphasize more as this is production environment. The following steps should be carried out on your local setup and not production.
  2. Find out what changed in the entities. The change should most probably be in the field settings for one or more fields in the entity types listed in the messages. Check with the developer if you are not sure about the changes. If the changes are not desired, simply export the current configuration using drush cex and push it. If this is the case, then it will be ideal for all. If not continue to next step.
  3. Since deleting the fields is not an option as it would delete the data, create a new field with exactly the same label but different machine name. These fields could have desired settings.
  4. Write a script (update hook, migration, drush command - recommended, etc) which will copy the data from the original fields' to the new field with the correct settings.
  5. This script could also then delete the field with the older setting which was preventing the config import.

Note: You need to consider the usage of the field at the implementation level and make sure you handle those. Like:

  1. In any view mode for the entities.
  2. In any view.
  3. Any preprocess function.
  4. If the field template has been overridden.

The data is very crucial here. So TEST, TEST, and TEST! Everything would be easy if there are a limited amount of entities with values in the conflicting fields and that the data could be handled manually by deleting the fields.

  • Thought also that this might be related to Media which went into core. Maybe there are some certain steps to perform (including to get rid of the old Media contrib modules). – leymannx Oct 12 '18 at 18:49

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.