9

I did a drush config-export staging on a local version of my site then a drush config-import staging on the server. It imported all the taxonomy vocabulary but no terms. I also tried it via the UI (Configuration->Development->Configuration Synchronization). Is this a bug or just the unfinished nature of Drupal 8?

12

Configuration management is exporting exactly what it was designed to do: Export the configuration settings. The actual taxonomy terms themselves are sitting in the taxonomy_term_field_data table in the database.

  • 1
    I see. So terms are not considered part of the site configuration? – Rooster242 Aug 27 '15 at 16:38
  • 4
    Not at the moment, but if you created your own config module and stored them in the configuration for it, then they would be part of the configuration settings for the new module. I did that when I first created the advanced tour module so that things other than text could be used, like Intermedia video. – Craig Bowman Aug 27 '15 at 17:02
  • 4
    Terms are content entities because they are fieldable whereas vocabularies are not so they are configuration entities, hence only they are exportable. – user21641 Aug 27 '15 at 18:37
  • 4
    If someone's looking for an example module to help with turning terms into configuration, I think Config Menu Link might be a good one. – colan Dec 23 '15 at 19:23
  • 1
    @CraigBowman — Any tips on how to "store [terms] in the configuration for [your own config module]"? I'm creating my own custom module and exporting a taxonomy vocabulary; would also like its terms exported along with it. I have the ability to edit the taxonomy.vocabulary.*.yml file (Drupal 8) by hand if need be. Please add this to your answer if you would be so kind. Thanks! – chharvey May 8 '17 at 17:22
5

This is by design as taxonomy terms is the content, not configuration.

Features deals exclusively with configuration and so won't include support for content entities such as taxonomy terms.

Source: Exporting of Taxonomy terms.


However you can use other modules which may work with content such as Default Content module which supports taxonomy terms. Or check Deploy module for content staging.

For example check out this patch for Default Content module: Drush comand to export all items, once applied, you can export all terms from the specific vocabulary using drush, e.g.

drush dcer taxonomy_term vid my_vocabulary --folder=dest/

See also: How do I export my site structure?

4

We have just released a module to solve this issue: https://www.drupal.org/project/structure_sync

It can synchronize taxonomy terms, menu links and custom blocks that are normally considered content but have a tendency to also be used for a sites structure that needs to be synchronized between environments.

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.