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.
As a follow up to #786990: Get rid of the usage of eval() I've made a drush command to run the import of a big set of terms (~8000 items in a hierarchy of three levels) from command line.
It's just the minimum drush code to allow running a import. The import is done with code from install_profile_api. It's just a start that solves my problem. A better integration is possible :)
Trace:
$ drush --debug te-import profiles/prop/fixtures/taxonomy_regiones.export
Drush bootstrap phase : _drush_bootstrap_drupal_root() [0.22 sec, 3.78 MB] [bootstrap]
Drush bootstrap phase : _drush_bootstrap_drupal_site() [0.29 sec, 4.5 MB] [bootstrap]
Drush bootstrap phase : _drush_bootstrap_drupal_configuration() [0.33 sec, 4.5 MB] [bootstrap]
Drush bootstrap phase : _drush_bootstrap_drupal_database() [0.38 sec, 4.5 MB] [bootstrap]
Successfully connected to the Drupal database. [0.38 sec, 4.5 MB] [bootstrap]
Drush bootstrap phase : _drush_bootstrap_drupal_full() [0.43 sec, 4.79 MB] [bootstrap]
Drush bootstrap phase : _drush_bootstrap_drupal_login() [0.76 sec, 17.38 MB] [bootstrap]
Found command: taxonomy-export-import (commandfile=taxonomy_export) [0.81 sec, 17.37 MB] [bootstrap]
Vocabulary 'Regiones' imported successfully. [1065.58 sec, 44.16 MB] [status]
8189 terms imported successfully. [1065.58 sec, 44.16 MB] [status]
Command dispatch complete [1065.58 sec, 44.14 MB] [notice]
Timer Cum (sec) Count Avg (msec)
page 1065.249 1 1065248.97
Peak memory usage was 60.26 MB [1065.59 sec, 44.14 MB] [memory]
A better integration is possible :)
Comment | File | Size | Author |
---|---|---|---|
#4 | taxonomy_export.drush_.inc_.787080.patch | 2.8 KB | jaydub |
#3 | taxonomy_export.drush_.inc_.787080.patch | 2.41 KB | jaydub |
#2 | taxonomy_export.drush_.inc_.txt | 934 bytes | jonhattan |
taxonomy_export.drush_.inc_.txt | 790 bytes | jonhattan |
Comments
Comment #1
pflame CreditAttribution: pflame commentedjonhattan,
The above patch is working fine if I give the export file as full path. It is giving error when I give relative path from where I am running the command. I think it would be good if you support relative path.
Comment #2
jonhattanHere is for relative paths. It still needs more love.
Comment #3
jaydub CreditAttribution: jaydub commentedI took a stab at updating this Drush integration patch. I've added comments and some command help text as well as some logging. Let me know if this is helpful. Tested off of the 2.x branch.
Comment #4
jaydub CreditAttribution: jaydub commentedReattached patch as a true patch to add the file rather than just the contents of the file. Now I can pull it in via drush make ;)
Comment #5
James Andres CreditAttribution: James Andres commentedPatch committed to CVS, plus I added support for exporting via Drush.