Drush cmd to export/import terms

This project is not covered by Drupal’s security advisory policy.

User Scenario

There are a couple of modules providing Taxonomy terms exporting/importing.
However, we need to export and import terms and their translations at the same time.
Therefore, we build this module.

Drupal 8 and Drupal 9 compatible

❯ drush en term_trans_ex_im

❯ pwd
/var/www/drupal.dev

❯ drush ttei-exp zh-hans

*** Exported '4' records of Taxonomy terms to the file /var/www/drupal.dev/web/sites/default/files/taxonomy-terms-ouput__zh-hans.csv successully. ***


❯ cat web/sites/default/files/taxonomy-terms-ouput__zh-hans.csv
 1,tags,,en,Gung,,zh-hans,"Gung zh-hans",
 2,tags,,en,Wang,,zh-hans,"Wang zh-hans",
 3,tags,,en,IT,,zh-hans,"IT zh-hans",
 4,tags,,en,Software,,zh-hans,"Software zh-hans",
 
 ❯ drush ttei-imp taxonomy-terms-ouput__zh-hans.csv
*** Imported '4' terms successully. ***

Exported CSV file sample:

46,content_domain,,en,"Help and Support",,fr-ca,"Aide et soutien",
61,industries,,en,"Automotive and Mobility","<p>This needed&nbsp;a description.&nbsp; It has one now</p>",fr-ca,"Automobile et mobilité","<p>This needs a description.</p>"
66,industries,,en,"Buildings and Construction","<p>This needs a description.</p>",fr-ca,"Construction et bâtiment","<p>This needs a description.</p>"
71,industries,,en,"Chemicals and Materials","<p>This needs a description.</p>",fr-ca,"Produits et substances chimiques","<p>This needs a description.</p>"
76,industries,,en,"Energy and Utilities","<p>This needs a description.</p>",fr-ca,"Énergie et services publics

CSV Data format and meaning:

|0    1                  2      3         4              5             6         7                    8               |
|tid |vid               |parent|langcode|name          | description  |lang_tran|name_tran           |description_tran|
| 421|article_categories|  NULL|en      |Help Article..| <p>This is ..|fr-ca    |Article d'aide    ..|<p>This is for..|
| 811|article_categories|   421|en      |Industry Ins..| <p>For crea..|fr-ca    |Industry Insight F..|<p>Fr-ca For c..|
Install the module via composer.
composer require "drupal/term_trans_ex_im"

Organization: UL Solutions

Project information

  • caution Maintenance fixes only
    Considered feature-complete by its maintainers.
  • Module categories: Site Structure
  • Created by Gung Wang on , updated
  • shield alertThis project is not covered by the security advisory policy.
    Use at your own risk! It may have publicly disclosed vulnerabilities.

Releases