Using Drush with Content Hub for Drupal 8

Content Hub includes several Drush commands for both normal product use and for more advanced administration. You can use the commands to administer your content from the command line. For more information about Drush, see Intro to Drush.

Drush commands

Command Description
acquia-contenthub-audit-publisher Checks published entities and compares them with the publisher to ensure consistency
acquia-contenthub-compare Compares the CDF of an entity from a local source and a remote source, and prints the differences
acquia-contenthub-connect-site Connects client to Content Hub
acquia-contenthub-delete Deletes a single entity from Content Hub
acquia-contenthub-disconnect-site Disconnect the client from Content Hub
acquia-contenthub-list List content entities that exist in Content Hub
acquia-contenthub-local Prints an entity (in CDF format) from a local source (a Drupal website)
acquia-contenthub-regenerate-secret Regenerates the shared secret used for webhook verification
acquia-contenthub-remote Prints an entity (in CDF format) from a remote source (Content Hub)
acquia-contenthub-status-check Checks for stale content by comparing content published on subscribing websites with the original stored in Content Hub
acquia-contenthub-update-secret Updates the shared secret used for webhook verification
acquia-contenthub-watchdog-queue-sizes Log the size of the import and export queues to Drupal watchdog
acquia-contenthub-webhooks Perform a webhook management operation
queue-list General Drush command that returns additional Content Hub -related results
queue-run General Drush command that accepts additional Content Hub -related arguments

Advanced Drush commands

The following commands can remove data from Content Hub, and should be used with caution.

Command Description
acquia-contenthub-logs View historic entity logs from Content Hub
acquia-contenthub-mapping Display Elastic Search field mappings from Content Hub
acquia-contenthub-purge Delete all entities from Content Hub (available in version 8.x-1.12 or greater)
acquia-contenthub-reindex Reindex all entities in Content Hub
acquia-contenthub-reset-entities Delete all entities of a specified type from Content Hub, reindex, and then re-export the entities back to Content Hub
acquia-contenthub-restore Restore the backup taken by a previous execution of the acquia-contenthub-purge command

Troubleshooting Drush commands

If you have enabled Content Hub, but Drush commands fail with the message Command [commandname] needs the following extension(s) enabled to run: acquia_contenthub, execute the following commands to attempt to resolve the issue:

drush en acquia_contenthub -y drush cr

If Drush commands for Content Hub continue to fail, contact Acquia support.

Command details

acquia-contenthub-audit-publisher

Checks published entities and compares them with what currently exists in Content Hub to ensure consistency

Alias Arguments
ach-audit-publisher, ach-ap

This command takes the following argument:

  • entity-type

You can pass an array of options to process the data:

  • publish – Republish inconsistent entities to Content Hub
  • status – The export status of the entities to audit, defaults to EXPORTED. Possible values include:
    • EXPORTED
    • INITIATED
    • REINDEX
    • QUEUED

acquia-contenthub-compare

Compares the CDF of an entity from a local source and a remote source and prints the differences

Alias Arguments
ach-comp
  • entity-type
  • uuid – The UUID of the entity

acquia-contenthub-connect-site

Connects client to Content Hub

Alias Arguments
ach-connect none

acquia-contenthub-delete

Deletes a single entity from Content Hub

Alias Arguments
ach-del UUID – The UUID of the entity

acquia-contenthub-disconnect-site

Disconnect the client from Content Hub

Alias Arguments
ach-disconnect none

acquia-contenthub-logs

(Developer only) - View historic entity logs from Content Hub

Alias Arguments
ach-logs

This command takes the following arguments:

  • api – The Content Hub API key
  • secret – Your secret key

You can pass an array of options to control the output:

  • query – The Elastic Search query to search for in the logs; example: {"query": {"match_all": {}}}
  • size – The number of log entries to be listed
  • from – The offset to start isting the log entries — used for pagination

acquia-contenthub-list

List content entities that exist in Content Hub

Alias Arguments
ach-list

You can pass an array of options to control the output:

  • limit – The number of entities to be listed
  • start – The offset to start listing the entities (useful for pagination)
  • origin – The client’s origin UUID
  • language – Filter entities by language – for example, en
  • attributes – The attributes to display for all listed entities
  • type – The entity types to include
  • filters – Key=value pairs of conditions by which to filter the output, comma separated – for example, title=New*, status=1

acquia-contenthub-local

Prints an entity (in CDF format) from a local source (a Drupal website)

Alias Arguments
ach-lo
  • entity-type
  • entity-id – The UUID of the entity

acquia-contenthub-mapping

Shows Elastic Search field mappings for Content Hub

Alias Arguments
ach-mapping none

acquia-contenthub-purge

(Developer only) - Deletes all entities from Content Hub

Alias Arguments
ach-purge
  • api – The Content Hub API key
  • secret – Your secret key

acquia-contenthub-regenerate-secret

Regenerates the shared secret used for webhook verification

Alias Arguments
ach-regsec none

acquia-contenthub-reindex

(Developer only) - Reindexes all entities in Content Hub

Alias Arguments
ach-reindex
  • api – The Content Hub API key
  • secret – Your secret key

acquia-contenthub-remote

Prints an entity (in CDF format) from a remote source (Content Hub)

Alias Arguments
ach-re uuid – The UUID of the entity

acquia-contenthub-reset-entities

(Developer only) - Deletes all entities and/or bundles of a specified type from Content Hub, reindexes, and then re-exports the entities or bundles back to Content Hub

Alias Arguments
ach-reset
  • entity_type – The entity type
  • api – The Content Hub API key
  • secret – Your secret key
  • bundle_name is available as an option

acquia-contenthub-restore

(Developer only) - Restores the backup taken by a previous execution of the purge command

Alias Arguments
ach-restore
  • api – The Content Hub API key
  • secret – Your secret key

acquia-contenthub-status-check

Checks for stale content by comparing content published on subscribing websites with the original stored in Content Hub

Alias Arguments
ach-st-ch
  • limit – The amount of previous log events to review for content changes
  • threshold – The number of minutes before content is considered stale

acquia-contenthub-update-secret

Updates the shared secret used for webhook verification

Alias Arguments
ach-upsec none

acquia-contenthub-watchdog-queue-sizes

Log the size of the import and export queues to the Drupal watchdog log.

acquia-contenthub-webhooks

Perform a webhook management operation

Alias Arguments
ach-wh

This command takes the following argument:

  • op – The operation to use: register, unregister, or list.

    Requires the webhook_url as an option

queue-list

This command is not specific to Content Hub, but will return additional results with it. See drush queue-list

Result Description
content_hub_webhook_queue The number of items in the Content Hub webhook queue

queue-run

This command is not specific to Content Hub. See drush queue-run.

Alias Arguments
acquia_contenthub_export_queue Processes the queue of entities to export
acquia_contenthub_import_queue Processes the queue of entities to import
content_hub_webhook_queue Processes the remaining Content Hub webhook queue

Contact supportStill need assistance? Contact Acquia Support

Acquia: Think Ahead

53 State Street, 10th Floor
Boston, MA 02109
United States
Phone: 888-922-7842

Map: Google Maps
View other locations