Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hi,
trying to export a vocabulary with "Hierarchical tree structure with term ids and names".
But when I see the output of this export, I only see the parent term id and the child term id. No names, no description.
Thanks a lot in advance for going into this. I use latest .dev version of the module.
Would love to be able to export a complete vocabulary, because on one site it is corrupt, and I am not able to get it exported another way.
Greetings, Martijn
Comments
Comment #1
Daniel_KM CreditAttribution: Daniel_KM commentedHi,
Thanks for all your reports. Unfortunately, I'm very busy until the end of the month. I hope you can wait a little.
Sincerely,
Daniel Berthereau
Infodoc & Knowledge management
Comment #2
Summit CreditAttribution: Summit commentedHi,
Thanks for your reply, and yes I have some time, it would be great if exporting/importing vocabulary with hierarchy will be possible.
Because of working in countries with very slow internet changing hierarchical vocabulary offline is needed. So exporting, changing offline, importing again is my usecase. Great you are willing to help me with this.
Could luck with your busy projects and hope hearing from you soon at the end of the month.
Greetings, Martijn
Comment #3
ndf CreditAttribution: ndf commentedHi summit,
I tried with version 7.x-5.x-dev from 2012-Jun-15 and confirm this bug.
Export option 'Hierarchical tree structure with term ids and names' creates a flat list without a reference to parent terms.
'Hierarchical tree structure' (only term names) and 'Hierarchical tree structure and Fields' do give you the hierarchy. The latter is a more difficult to import.
If both don't suite your case, you could use 'views data export' to get your taxonomies out of your corrupt website. It gives you a lot of control, but it's quite some work to configure it. (Nb: make a view of 'taxonomy terms', add the relation 'parent term', then just render your fields [tid, parent-tid, name, description, img, etc]).
Comment #4
Summit CreditAttribution: Summit commentedHi Niels,
Thanks for your reply.
Your comment 'Hierarchical tree structure' (only term names) and 'Hierarchical tree structure and Fields' do give you the hierarchy. The latter is a more difficult to import.
I do not think this is correct.
1) The Hierarchical tree structure gives you the term names yes, but how to import these then as vocabulary. The relation with the underlying TIDS are gone. So this is not a correct export -> import scenario
2) Hierarchical tree structure and Fields do not give the correct hierarchy also. See: http://drupal.org/node/1777742#comment-6483156 No TIDS are shown correctly so no correct export -> import scenario is possible also.
My use case is exporting a correct working but not hierarchical enough vocabulary. Then changing this offline by setting the correct hierarchy. Changing parent terms etc... Than importing this vocabulary with altered hierarchical term relations. So TIDS, term names, fields all need to be exported and imported!
Thanks a lot again for your reply.
greetings,
Martijn
Comment #5
ndf CreditAttribution: ndf commentedHi Summit,
Going to summarize howto import a hierarchical taxonomy with its fields. It's a bit obscure and you need configuration on import. I cannot solve importing a hierarchy and descriptions in one step. But I can import a hierarchy or terms with fields. So you can do it in 2 steps! Follow me.
First I created a vocabulary 'hierarchy' with 3 terms and descriptions:
- Fauna: Animal life
- Flora: Plant life
-- Flower: Bloom or blossom plant
Step 1: export and import the hierarchy
Export hierarchy
Goto '/admin/structure/taxonomy/csv_export'
Choose 'Hierarchical tree structure', Export
Result:
"Fauna"
"Flora"
"Flora","Flower"
The hierarchy is exported by using this notation: " 'root-term', 'child-term', etc... ". So no parent-tid, but term-path.
Import hierarchy
Goto '/admin/structure/taxonomy/csv_import'
Import
This should create the vocabulary 'Auto created vocabulary'.
Step 2: export and import descriptions and other fields
Export fields
Goto '/admin/structure/taxonomy/csv_export'
Choose 'Fields', Export
Result:
"Fauna","hierarchy","Animal life","plain_text","1",""
"Flora","hierarchy","Plant life","plain_text","2",""
"Flower","hierarchy","Bloom or blossom plant","plain_text","0",""
Import fields
Goto '/admin/structure/taxonomy/csv_import'
For 'Fields' use this configuration:
* use the machinename of the field, see admin/structure/taxonomy//fields
Import
There is one problem. For each term our import created the field 'original_vocabulary' with value 'hierarchy' for us. We can solve this 2 ways: first way is manualy delete the column "hierarchy" from the export file before importing. Then as import structure you choose "name, description". Second way is after import go to "/admin/structure/taxonomy//fields" and delete the created field.
With this import-type I succesfully imported terms-relations and a lot of other fields.
Endresult
We now succesfully imported a taxonomy with its hierarchy and 2 fields: 'term-name', 'description'.
Comment #6
Summit CreditAttribution: Summit commentedHi Niels,
Thanks for this thorough example. But the problem is in my usecase that all sort of nodes already have a relationship with TID's, so only termnames is not enough.
Is it possible to export termnames and hierarchy within this, and term ids' and hierarchy in this also together. Than change the exported vocabulary so I set that some termnames (and tids) have say a parent relation extra. And than importing the changed vocabulary with the same TID's but better hierarchy placements?
greetings, Martijn
Comment #7
ndf CreditAttribution: ndf commentedHi Summit,
As far as I know it is not possible to import hierarchy, fields and tids together.
Comment #8
Summit CreditAttribution: Summit commentedHi Daniel,
Can you elaborate on this please. Is it true isn't it possible with Taxonomy CSV to export/import Hierarchy with fields, termnames and TID's?
If not, this will be a feature request than please.
Off course in your time. I do not want to disturb you in this bussy period for you.
Greetings, Martijn
Comment #9
Summit CreditAttribution: Summit commentedHi @Daniel_KM any change you will have an update any time soon please?
Thanks a lot in advance for your reply!
Greetings, Martijn
Comment #10
Summit CreditAttribution: Summit commentedHi, I see latest update for this module is june 2012.
I would very much like to be able to have my hierarchical taxonomy with terms and TIDS exported, offline changed and imported again. But is this module the right option with so less going on?
Is there may be an alternative, or are you willing to take the effort to bring this module up to speed?
I do not know what to do now, and am stuck with trying to export some database tables and trying this way to move forward. Sorry to report but it seems this module is not maintained anymore?
If I am wrong I apologize, but no commits after june 2012 looks to me as a unsupported module.
greetings, Martijn
Comment #11
Daniel_KM CreditAttribution: Daniel_KM commentedHi,
Thanks for your patience. The module is not unmaintened, but I'm very busy for another work. A co-maintainer will be welcomed. I will answer any remarks and upgrade the module as soon as I can.
Sincerely,
Daniel Berthereau
Infodoc & Knowledge management
Comment #12
Summit CreditAttribution: Summit commentedHi Daniel, Thanks for your quick reply!
When do you think really you have time to get this working? I can then plan my activities afterwards.
Greetings, Martijn
Comment #13
tonicboy CreditAttribution: tonicboy commentedHi,
I would like to chime in as having a similar problem. I have tried to use the 2-step process as outlined by nielsdefeyter. Unfortunately, because I have duplicated term names, then one of two things will happen:
From the documentation, it seems as though a Fields import with TID's instead of term names as the key would solve this issue. However, as discussed, there doesn't seem to be a working option to export fields with TIDs.
Comment #14
Jim Bacon CreditAttribution: Jim Bacon commentedHi
I encountered the same situation as tonicboy. My workaround, using version 7.x-5.10, was to uncomment line 144 in modules/taxonomy_csv/export/taxonomy_csv.export.api.inc
$vocabulary->fields['tid'] = array('cardinality' => 1);
When I subsequently export fields, the tid is the first column.