2

I've been trying to find a smart way of exporting content type and all its fields from one installation of Drupal to another. The core "Configuration synchronization" export only export the content type, but not its fields and configuration.

So far I have not met anything applicable for Drupal 8. All I can find is mentions of this functionality is possible in Drupal 7 module called Bundle Copy, which was never ported properly for 8.

I've also tried this, however I cannot find any good documenation on how the "drupal config:import" or "drupal config:import:single" works.

Is it really so hard to export and import content types between environments or have I missed something essential?

  • What do you mean with "between environments", the same Drupal site on dev and prod or two completely different sites? – 4k4 Jan 10 at 13:03
  • I usually use drush cex to export the config in my local enviroment and drush cim to import this config in other enviroment. I do not know if it's what you're looking for, you can export content types, fields, forms... – SilviaGDLR Jan 10 at 14:04
3

You're on the right track with the configuration export but i'm guessing you did the single export option for the content type? Each field on your content type has several configuration items that would need to be exported too.

An alternative is to use the Features module https://www.drupal.org/project/features

That will allow you to select your content type and it will automatically gather up all the required configuration items for export

Your Answer

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

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