As a content creator, you may need to import many of your publishing website’s entities to your Content Hub at once, without manually saving each of your nodes again individually in Drupal. Mass imports are possible with the creation of a custom import script. When used with the Content Hub Import Queue feature, the imported entities are processed using Drupal’s batch API, which reduces the risk of resource exhaustion on your websites.
Note
- The example scripts included in the following process work only with the current Drupal version.
- For information about batch exports (instead of imports) of entities, see Exporting multiple entities at once in Content Hub 1.x.
To use one of the provided import scripts:
- In an appropriate directory, create a file named
import.php
. - Download the following file and add the contents to the
import.php
file:ach-bulk-import.php
- Modify the code for your installation and needs, in accordance with the
Notes
in the comments section at the top of the file. - Add the
import.php
file to your codebase. - Enable the Content Hub Import Queue feature.
- Connect to your subscribing website’s server using SSH. For more information about SSH, see Managing applications using the command line.
Navigate to the folder containing your
import.php
file, and then execute the following Drush command (where[site-uri]
is your website’s URI):drush -l scr import.php
Important
Acquia recommends that you use these scripts to import only independent entity types, such as nodes and taxonomy terms.
Attempting to import dependent entities, such as paragraphs, will fail due to the lack of parent entities. The example scripts specifically exclude dependent entities.