4

I have taxonomy in Json file. I need import this file into Drupal into exist vocabulary.how can I import data from Json file to exist vocabulary?

6
  • What version? Regardless, there is MIgrate Framework for Drupal 7 and the core migrate stuff in Drupal 8. Start there. – Kevin Mar 1 '17 at 17:40
  • Sorry for mistake, json – irikin Mar 1 '17 at 17:40
  • Drupal 7. Migrate It's module? Should be write a code? Or it have needed interface for this goal? – irikin Mar 1 '17 at 17:44
  • Yes you would have to write a migration to import them in either case. I don't know if there is a module that will do it specifically for a json file. Some would say use Feeds, but I have no experience with Feeds. – Kevin Mar 1 '17 at 17:45
  • Would you be able to edit the question and give a sample of the json? And is it flat or hierarchical data? – Clive Mar 1 '17 at 20:44
1

Here are some resources if you opt to use Migrate Framework in 7.x to do this (which is how I would personally approach it).

There are examples in Migrate/Migrate Plus on getting it setup. It looks like migrate_source_json was deprecated in favor of migrate_plus, but I included it for any historical references in it's issue queue.

There is probably a solution via Feeds as well but as stated, I am not experienced with Feeds.

If you can convert your format to CSV, there is also this one off module, Taxonomy CSV.

1

You can use Taxonomy Manager module, it give you very good features to work with taxonomies.

Description from module's page :

This module provides a powerful interface for managing taxonomies. A vocabulary gets displayed in a dynamic tree view, where parent terms can be expanded to list their nested child terms or can be collapsed.

The Taxonomy Manager has following operations and key features:

dynamic treeview
mass deleting
mass adding of new terms
moving of terms in hierarchies
merging of terms (using the Term merge module in 7.x)
fast weight changing with up and down arrows (and AJAX saving)
AJAX powered term editing form
simple search interface
CSV Export of terms
i18n support for multilingual vocabularies (per language terms)
Double Tree interface for moving terms in hierarchies, adding new translations and switching terms between different vocabularies

For using the Taxonomy Manager you should have JavaScript and automatically load of images enabled in your browser.

And about solution for what you asked:

with getting help from https://json-csv.com/ | https://konklone.io/json/ ( or another one from plenty Json to CSV convertor) convert your Json terms to CSV then import them with Taxonomy Manager with copy/paste CSV result on taxonomy import option.

Also you can import from CSV with Taxonomy CSV module.

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.