Content Hub

Using Drush with Content Hub 1.x for the current Drupal version

Important

Content Hub 1.x will reach end-of-life on September 30, 2024. Acquia recommends you to upgrade to Content Hub 3.x. For more information, see Upgrading from Content Hub 1.x to 3.x.

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 Introduction to Drush.

Drush commands

CommandDescription
acquia-contenthub-audit-publisherChecks published entities and compares them with the publisher to ensure consistency
acquia-contenthub-audit-subscriberCreates a manifest file of entities to import and delete
acquia-contenthub-audit-subscriber-execute-manifestReads from the manifest file and executes user-specified changes on entities on the website
acquia-contenthub-compareCompares the CDF of an entity from a local source and a remote source, and prints the differences
acquia-contenthub-connect-siteConnects client to Content Hub
acquia-contenthub-deleteDeletes a single entity from Content Hub
acquia-contenthub-disconnect-siteDisconnect the client from Content Hub
acquia:contenthub-filtersLists available Cloud Platform Filters
acquia:contenthub-filters:attachAttach a filter to the website
acquia:contenthub-filters:detachDetach a filter from the website
acquia:contenthub-filter:detailsLists the details of a filter
acquia-contenthub-listList content entities existing in Content Hub
acquia-contenthub-localPrints an entity (in CDF format) from a local source (a Drupal website)
acquia-contenthub-regenerate-secretRegenerates the shared secret used for webhook verification
acquia-contenthub-remotePrints an entity (in CDF format) from a remote source (Content Hub)
acquia-contenthub-status-checkChecks for stale content by comparing content published on subscribing websites with the original stored in Content Hub
acquia-contenthub-update-secretUpdates the shared secret used for webhook verification
acquia-contenthub-watchdog-queue-sizesLog the size of the import and export queues to Drupal watchdog
acquia-contenthub-webhooksPerform a webhook management operation
queue-listGeneral Drush command returning other Content Hub -related results
queue-runGeneral Drush command accepting more Content Hub -related arguments

Advanced Drush commands

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

CommandDescription
acquia-contenthub-mappingDisplay Elastic Search field mappings from Content Hub
acquia-contenthub-purgeDelete all entities from Content Hub (available in version 8.x-1.12 or later)
acquia-contenthub-reindexReindex all entities in Content Hub
acquia-contenthub-reset-entitiesDelete all entities of a specified type from Content Hub, reindex, and then re-export the entities back to Content Hub
acquia-contenthub-restoreRestore 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 try to resolve the issue:

drush en acquia_contenthub -y drush cr

If Drush commands for Content Hub continue to fail, create a Support ticket.

Command details

acquia-contenthub-audit-publisher

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

AliasArguments
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-audit-subscriber

Creates a manifest file of entities to import and delete by checking the filter configuration and verifying which entities from Content Hub matches those filters

AliasArguments
ach-audit-subscriber, ach-as

This command takes the following arguments:

  • help: Checks imported entities and compares them to Content Hub
  • manifest_file: The file name, including path, to write the manifest to

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

  • types[=TYPES]: Comma-separated list of entity types to search and delete

Note

This command only gathers information about changes you can make to entities on your website.

acquia-contenthub-audit-subscriber-execute-manifest

Reads from the manifest file created by the ach-as command and executes user-specified changes on entities on the website

AliasArguments
ach-audit-subscriber-exe-manifest, ach-asem

This command takes the following arguments:

  • manifest_file: The file name, including path, to write the manifest to
  • output_manifest_file: The file name, including path, to write the resulting manifest after execution

acquia-contenthub-compare

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

AliasArguments
ach-comp
  • entity-type
  • uuid: The UUID of the entity

acquia-contenthub-connect-site

Connects client to Content Hub

AliasArguments
ach-connectnone

acquia-contenthub-delete

Deletes a single entity from Content Hub

AliasArguments
ach-delUUID: The UUID of the entity

acquia-contenthub-disconnect-site

Disconnect the client from Content Hub

AliasArguments
ach-disconnectnone

acquia:contenthub-filters

Lists available Cloud Platform Filters. Content Hub 2.x only

AliasArguments
ach-cf

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

  • --webhook[=WEBHOOK_URL] allows the user to define a webhook to display related filters.
  • --interactive allows the user to select the webhook to display related filters.

acquia:contenthub-filters:attach

Attaches a filter to a website. Content Hub 2.x only

AliasArguments
ach-cfa

This command takes the following arguments:

  • attach UUID or attach WEBHOOK_URL attaches a filter to the website using the Cloud Platform filter’s UUID or webhook URL.

    acquia:contenthub-filters:attach 00000000-0000-0000-0000-000000000000
    
    or
    
    acquia:contenthub-filters:attach http://example.com/acquia-contenthub/webhook
    

acquia:contenthub-filters:detach

Detaches a filter from a website. Content Hub 2.x only

AliasArguments
ach-cfd

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

  • attach UUID or attach WEBHOOK_URL detaches a filter from the website using the Cloud Platform filter’s UUID or webhook URL.

    acquia:contenthub-filters:detach 00000000-0000-0000-0000-000000000000
    
    or
    
    acquia:contenthub-filters:detach http://example.com/acquia-contenthub/webhook
    

acquia:contenthub-filter-details

Lists the details of a filter. Content Hub 2.x only

AliasArguments
ach-cfds

This command takes the following argument:

  • UUID

acquia-contenthub-list

List content entities that exist in Content Hub

AliasArguments
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)

AliasArguments
ach-lo
  • entity-type
  • entity-id: The UUID of the entity

acquia-contenthub-mapping

Shows Elastic Search field mappings for Content Hub

AliasArguments
ach-mappingnone

acquia-contenthub-purge

(Developer only): Deletes all entities from Content Hub

Important

The ach-purge command purges all entities from Acquia Content Hub. WARNING! Use caution when using this destructive command requiring elevated permissions. Every subsequent execution of this command will override the backup created by the previous call.

AliasArguments
ach-purge
  • api: The Content Hub API key 
     
  • secret: Your secret key

Note

Before running the ach-purge command, you should clear out the hashes in your tracking table to avoid issues with syndication later. You can do this by running the following command on your publisher site:

drush sqlq "UPDATE acquia_contenthub_publisher_export_tracking SET hash = ''"

When this command is run, a message like the following displays:

You are about to DROP all tables in your 'MY-WEBSITE' database. Do
you want to continue? (y/n):

You must confirm before Acquia Content Hub will purge the contents.

acquia-contenthub-regenerate-secret

Regenerates the shared secret used for webhook verification

AliasArguments
ach-regsecnone

acquia-contenthub-reindex

(Developer only): Reindexes all entities in Content Hub

AliasArguments
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)

AliasArguments
ach-reuuid: 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

AliasArguments
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

AliasArguments
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

AliasArguments
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

AliasArguments
ach-upsecnone

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

AliasArguments
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 more results with it. See drush queue-list

ResultDescription
content_hub_webhook_queueThe number of items in the Content Hub webhook queue

queue-run

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

AliasArguments
acquia_contenthub_export_queueProcesses the queue of entities to export
acquia_contenthub_import_queueProcesses the queue of entities to import
content_hub_webhook_queueProcesses the remaining Content Hub webhook queue