is it possible to export a taxonomy tree with its tid/vid and import it on another drupal with the tid/vid? this for example could be useful if you want to reimport a vocabulary.

Comments

Daniel_KM’s picture

Version: 7.x-5.10 » 7.x-5.x-dev

Hi,

Not totally: no for the first import, but yes for update.

  • For export, the last dev release allow you to export terms with tid and vid, the structure and all fields.
  • But for import, the process can't create terms with a specific tid and vocabulary with a specific vid, because new terms and vocabularies are autoincremented in the database, and the module uses only the Drupal API and doesn't access directly to database.

There is a way to work around this limit: to create vocabulary and tids directly in the database of the second Drupal site before true import.

  • For the vocabulary, you need to create it in the taxonomy_vocabulary table with vid key you want. There is no problem as long as there is no term in it, as long as the vocabulary is not used.
  • For the terms, you need to create a list of pseudo terms with the tids you want in the "taxonomy_term_data" table.

Then, you can use the Taxonomy CSV import page to update them with the file you exported.
If other taxonomy modules are installed, you need to disable them before the creation of the vocabulary and to reenable them after import process.

Sincerely,

Daniel Berthereau
Infodoc & Knowledge management

marcoka’s picture

Component: Code » Documentation
Status: Active » Closed (works as designed)

sounds good thanks.