Information for:

# Importing multiple entities at once¶

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 procedure work only with Drupal 9 and later versions of Content Hub.
• For information about batch exports (instead of imports) of entities, see Exporting multiple entities at once.

To use one of the provided import scripts, complete the following steps:

1. In an appropriate directory, create a file named import.php.

2. Download the following file and add the contents to the import.php file: ach-bulk-import.php

3. Modify the code for your installation and needs, in accordance with the Notes in the comments section at the top of the file.

4. Add the import.php file to your codebase.

5. Enable the Content Hub Import Queue feature.

7. 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