Is there a way to export out the vocabs into a hierarchical structure but also for each term to retain it's id? My website has a deployment structure (alpha,staging,live) and I need the terms and their id's to match on all stages especially when it concerns menus since it doesn't export/store alias for the path and only stores the drupal core system path. This in turn means News id is 29 on alpha but the id is 9 on staging so the link goes to the wrong teaser list with the wrong taxonomy.

Comments

Daniel_KM’s picture

Hi,

Currently, it's possible (with last stable or dev release) only with a combination of two exports: "tid + name" and "tree". But it's simple to implement it in one export file if you tell me which csv line format you really need.

Sincerely,

Daniel Berthereau
Infodoc & Knowledge management

kim.le’s picture

I need both to be combined together where it has the tree but within the tree the id is with the name.

Daniel_KM’s picture

Hi,

So an export with such a format?

grand-parent, tid
grand-parent, tid, parent, tid
grand-parent, tid, parent, tid, child, tid

Sincerely,

Daniel Berthereau
Infodoc & Knowledge management

kim.le’s picture

Yes but I tried that and it didn't work. It read the tid as another term name instead.

Daniel_KM’s picture

Version: 7.x-5.9 » 7.x-5.x-dev
Status: Active » Needs review

Yes, of course.

I've added two new export formats for your case: "Term ids and names" and "Hierarchical tree structure with term ids and names".
I've added a new import choice too: "Term ids (tid)".

Note I choose to set the tid before the name (tid, grand-parent name, tid, parent name...).
Also, there are some changes in the user interface of the first tab since 7.x-5.10 release.

The change has been committed and the dev tarball, already available on git here, will be available soon on main page.

Sincerely,

Daniel Berthereau
Infodoc & Knowledge management

kim.le’s picture

When I used "Hierarchical tree structure with term ids and names" the export looked exactly like "Term ids and names" and there wasn't any tree structure to it.

Daniel_KM’s picture

Hi,

If these exports are identical, it means that your vocabulary is not a hierarchical one but a flat one.

Could you give me some lines of your exported vocabulary?

Sincerely,

Daniel Berthereau
Infodoc & Knowledge management

kim.le’s picture

The list of terms for my vocab in the admin looks like this so shouldn't be hierarchical?

screenshot

Daniel_KM’s picture

Hi,

Your vocabulary is a one level hierarchical vocabulary (tree).

To get the same vocabulary, I imported your vocabulary as a structure / simple tree:

Business
Celebrations, Anniversaries
,Birth announcements
,Birthdays
,Engagements
,Weddings
Entertainement, Food
News, Blackduck American
,Education
,Local
,Outdoors
,Records
,Region

The exported vocabulary with "Term ids and names" is:

"41","Business"
"42","Celebrations"
"43","Anniversaries"
"44","Birth announcements"
"45","Birthdays"
"46","Engagements"
"47","Weddings"
"48","Entertainement"
"49","Food"
"50","News"
"51","Blackduck American"
"52","Education"
"53","Local"
"54","Outdoors"
"55","Records"
"56","Region"

but with "Hierarchical tree structure with term ids and names", it's:

"41","Business"
"42","Celebrations"
"42","Celebrations","43","Anniversaries"
"42","Celebrations","44","Birth announcements"
"42","Celebrations","45","Birthdays"
"42","Celebrations","46","Engagements"
"42","Celebrations","47","Weddings"
"48","Entertainement"
"48","Entertainement","49","Food"
"50","News"
"50","News","51","Blackduck American"
"50","News","52","Education"
"50","News","53","Local"
"50","News","54","Outdoors"
"50","News","55","Records"
"50","News","56","Region"

Now, you can import or update any of these terms, because they get a tid. You only need to choose to import them in the created vocabulary with the "Fields" format, the format "tid, name" and an input file like:

41, Economy
42, Ceremonies

These terms are updated and the tree structure is kept.

There was a little bug with this example, so you need to update the module with the last git tarball or with the dev release tomorrow.

Sincerely,

Daniel Berthereau
Infodoc & Knowledge management