Content Hub

Using Drush with Content Hub 1.x for Drupal 7

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.

Note

For more information about Drush, see Introduction to Drush.

Drush commands

CommandDescription
content-hub-connectConnect to Content Hub
content-hub-compareCompares the version of an entity from a local source and a remote source and prints the differences
content-hub-deleteDeletes a single entity from the Content Hub
content-hub-diagnosticPerform diagnostic checks on the Content Hub
content-hub-disconnectDisconnect the client from the Content Hub
content-hub-exportExport a local entity to the Content Hub
content-hub-export-blockExport a core custom block to Content Hub
content-hub-listList content entities existing in the Content Hub
content-hub-localPrints an entity (in CDF format) from a local source (a Drupal website)
content-hub-purgeDeletes all entities from the Content Hub (deprecated in Content Hub 1.18.0 or later)
content-hub-regenerate-secretRegenerates the shared secret used for webhook verification
content-hub-remotePrints an entity (in CDF format) from a remote source (the Content Hub)
content-hub-update-secretUpdates the shared secret used for webhook verification
content-hub-webhookPerform a webhook management operation
queue-listGeneral Drush command that returns additional Content Hub-related results
queue-runGeneral Drush command that accepts additional Content Hub-related arguments

Drush commands for developers

The following commands are restricted by the user’s access key:

Important

Using the following commands can remove data from Content Hub.

CommandDescription
content-hub-mappingShows Elastic Search field mappings from Content Hub
content-hub-purgeDeletes all entities from the Content Hub (available in version 1.30 or later)
content-hub-reindexReindex all entities in Content Hub
content-hub-restoreRestores the backup taken by a previous execution of the content-hub-purge command

Command details

content-hub-connect

Connects to Content Hub.

AliasArguments
  • ch-connect
  • ch-c
  • hostname - The Content Hub hostname to connect to
  • api_key - The API key to connect with
  • secret - The secret key to connect with
  • client_name - The client name to register the website with

content-hub-compare

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

AliasArguments
ch-compentity-type entity-id - The UUID of the entity

content-hub-delete

Deletes a single entity from the Content Hub.

AliasArguments
ch-deleteentity-id - The UUID of the entity

content-hub-diagnostic

Perform certain diagnostics on the Content Hub.

AliasArguments
  • ch-diagnostic
  • ch-diag
none

content-hub-disconnect

Disconnect the client from the Content Hub.

AliasArguments
  • ch-discon
  • ch-disconnect
none

content-hub-export

Export a local entity to the Content Hub.

AliasArguments
  • ch-ex
  • ch-export

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

  • include-dependencies - This option also exports dependent entities (they are excluded by default)

content-hub-export-block

Export a core custom block to the Content Hub

AliasArguments
  • ch-ex-block
  • ch-export-block
  • ch-exb
bid - The block ID to export

content-hub-list

List content entities that exist in the Content Hub.

AliasArguments
ch-list

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

  • limit: The number of entities to list
  • 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

content-hub-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

content-hub-mapping

Shows Elastic Search field mappings for Content Hub.

AliasArguments
ch-mappingnone

content-hub-purge

(Developer only) - Deletes all entities from Content Hub. This is disabled in Content Hub 1.18.0 to 8.x-1.12.

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

Note

After a purge, all content must be manually re-exported.

content-hub-regenerate-secret

Regenerates the shared secret used for webhook verification.

AliasArguments
ch-regsecnone

content-hub-remote

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

AliasArguments
ch-reentity-id - The UUID of the entity

content-hub-reindex

(Developer only) - Reindexes all entities in Content Hub

AliasArguments
ch-reindex
  • api - The Content Hub API key
  • secret - Your secret key

content-hub-restore

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

AliasArguments
ch-restore
  • api - The Content Hub API key
  • secret - Your secret key

content-hub-update-secret

Updates the shared secret used for webhook verification.

AliasArguments
ch-upsecnone

content-hub-webhook

Perform a webhook management operation.

AliasArguments
  • ch-webhook
  • ch-w
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.

ArgumentDescription
content_hub_webhook_queueProcesses the remaining Content Hub webhook queue