Loading...

Using Drush with Content Hub

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.

Note

Drush versions 10.3.3 and later have enhanced queue handling that improves the export and import processes in Content Hub.

Drush commands

Drush commandsDescriptionIntroduced in module versionDrush 9.x compatibleDrush 10.x compatibleDrush 11.x compatibleSite roleNotes
acquia:contenthub:reoriginateRe-originates entities in Content Hub from one source to another.3.1.0PublisherSee arguments
acquia:contenthub:reindexInitiates a re-indexing operation in Content Hub.3.1.0Publisher, SubscriberSee arguments
acquia:contenthub:entity-scan:orphanedScans Content Hub for orphaned entities and displays the ones that are not associated with any registered client.3.1.0Publisher, SubscriberSee arguments
acquia:contenthub-update-client-metadataUpdates the client metadata in the Content Hub service.3.3.0Publisher, SubscriberSee arguments
acquia:contenthub-dashboard-allowed-originsRetrieves the publisher-registered webhooks and stores them within the Drupal configuration.3.0.0Publisher, SubscriberSee arguments
acquia:sync-interestsSynchronizes the interests list of a webhook with the entity tracking tables.3.0.0Publisher, SubscriberSee arguments
acquia:contenthub-webhook-interests-deleteDeletes interests from a webhook.3.0.0Publisher, SubscriberSee arguments
acquia:contenthub-webhook-interests-addAdds interests to a webhook.3.0.0Publisher, SubscriberSee arguments
acquia:contenthub:client-deleteDeletes clients using names or UUIDs.3.7.0Publisher, SubscriberSee arguments
acquia:contenthub:client-updateUpdates the Content Hub details.3.4.0Publisher, SubscriberSee arguments
acquia:contenthub-webhook-interests-listDisplays the list of interest for the registered webhook.3.3.0Publisher, SubscriberSee arguments
acquia:contenthub-webhooks-listDisplays the list of registered webhooks.3.5.0Publisher, SubscriberSee arguments
acquia:contenthub-import-queue-runRuns the Content Hub subscriber import queue.3.3.0SubscriberSee arguments
acquia:contenthub-export-queue-runRuns the Content Hub publisher export queue.3.3.0PublisherSee arguments
acquia:contenthub:enable-syndicationEnables syndication for a comma-separated list of UUIDs.3.3.0SubscriberSee arguments
acquia:contenthub:disable-syndicationDisables syndication for a comma-separated list of UUIDs.3.3.0SubscriberSee arguments
acquia:contenthub-audit-publisherChecks the published entities and compares them with the publisher to ensure consistency3.0.0𐄂Publisher

Contains deprecated functions, therefore Drush 10.x is incompatible.

See arguments

acquia:contenthub-audit-subscriberCreates a manifest file of entities to import and delete3.0.0SubscriberSee arguments
acquia:contenthub-enqueue-by-filtersAdds entities to the import queue on a subscriber site based on the associated filters, except the default filter3.0.0SubscriberSee arguments
acquia:contenthub:entity-scan:filterHelper Drush command for debugging3.0.0Publisher, SubscriberSee arguments
acquia:contenthub-export-local-cdfGenerates a CDF document from a manifest file3.0.0Publisher, SubscriberSee arguments
acquia:contenthub-filter-detailsLists the details of a filter3.0.0Publisher, SubscriberSee arguments
acquia:contenthub-filtersLists the available Cloud filters3.0.0Publisher, SubscriberSee arguments
acquia:contenthub-filters:attachAttaches a filter to the website3.0.0Publisher, SubscriberSee arguments
acquia:contenthub-filters:detachDetaches a filter from the website3.0.0Publisher, SubscriberSee arguments
acquia:contenthub-import-local-cdfImports entities from a CDF document3.0.0SubscriberSee arguments
acquia:contenthub-publisher-upgradePublisher upgrade command3.0.0Publisher

Note: This command is deprecated.

Do not run as a standalone command

acquia:contenthub-subscriber-upgradeSubscriber upgrade command3.0.0Subscriber

Note: This command is deprecated.

Do not run as a standalone command

acquia:contenthub-fix-config-entities-with-null-uuidsAssigns randomly generated UUIDs to configuration entities with NULL UUIDs3.0.0-Experimental: Use with caution
acquia:contenthub-remotePrints the CDF from a remote source (Content Hub)3.0.0Publisher, SubscriberSee arguments
acquia:contenthub:remote-settingsRetrieves subscription settings stored in Content Hub3.0.0Publisher, SubscriberN/A
acquia:contenthub-webhooksPerform a webhook management operation3.0.0Publisher, SubscriberSee arguments
acquia:contenthub-webhook-interests-purgePerforms a webhook interest list purge operation for the current site3.0.0Subscriber
 
acquia:contenthub-connect-siteConnects a site with Content Hub3.0.0Publisher, SubscriberN/A
acquia:contenthub-deleteDeletes a single entity from the Content Hub3.0.0Publisher, SubscriberSee arguments
acquia:contenthub-disconnect-siteDisconnects a site with Content Hub3.0.0Publisher, SubscriberN/A
acquia:contenthub-listList entities from the Content Hub using the listEntities() method3.0.0Publisher, SubscriberSee arguments
acquia:contenthub-list-queue-itemsPrints the content of the import/export queue3.0.0Publisher, SubscriberSee arguments
acquia:contenthub-localPrints the CDF from a local source (Drupal website)3.0.0Publisher, SubscriberFrom version 3.3.x onwards, the entity-type argument is optional when the entity UUID is passed
acquia:contenthub-purgePurges all entities from Content Hub3.0.0Publisher, Subscriber

Use with caution: This command can remove content from Content Hub.

See arguments

acquia:contenthub-regenerate-secretRegenerates the Shared Secret used for webhook verification3.0.0Publisher, SubscriberN/A
acquia:contenthub-restoreRestores the backup taken by a previous execution of the purge command3.0.0Publisher, Subscriber

Use with caution: This command can remove content from Content Hub.

See arguments

acquia:contenthub-update-secretUpdates the Shared Secret used for webhook verification3.0.0Publisher, SubscriberN/A
acquia:contenthub-audit-entityAudits an entity for differences with the existing CDF in Content Hub3.0.0PublisherSee arguments
acquia:contenthub-settingsGets Content Hub settings from the different providers and determines the active configuration3.0.0Publisher, SubscriberSee arguments
acquia:contenthub-re-queueRe-queues entities on publisher or subscriber site3.0.0Publisher, SubscriberSee arguments

Troubleshooting Drush commands

If you have enabled Content Hub, but Drush commands fail with the message Command [command_name] needs the following extension(s) enabled to run: acquia_contenthub, execute the following command 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:reoriginate

Re-originates entities in Content Hub from one source to another. This deletes the original sources after recreation if they did not exist initially, unless the --no-origin-delete option is used.

AliasArguments
ach-reoriginate
  • origin_list: A comma-separated list of source origin UUIDs.

  • target: The target origin UUID.

  • --no-origin-delete: To keep the original sources after recreation if they did not exist initially.

acquia:contenthub:reindex

Initiates a re-indexing operation in Content Hub. This takes some time depending on the number of entities involved.

AliasArguments
ach-reindexN/A

acquia:contenthub:entity-scan:orphaned

Scans Content Hub for orphaned entities and displays the ones that are not associated with any registered client.

AliasArguments
ach-eso
  • --with-db: To display the orphaned entities present in the current website's tracking table.

  • --interest-list: To display the orphaned entities present in the current website's interest list.

  • --delete: To display the orphaned entities present in the current website's interest list and deletes them if there is only a single publisher.

  • --json: To give the output in JSON format.

acquia:contenthub-update-client-metadata

Updates the client metadata in the Content Hub service.

AliasArguments
ach-ucmN/A

acquia:contenthub-dashboard-allowed-origins

Retrieves the publisher-registered webhooks and stores them within the Drupal configuration.

AliasArguments
  • ach-dashboard-allowed-origins, ach-dao
N/A

acquia:sync-interests

Synchronizes the interests list of a webhook with the entity tracking tables.

AliasArguments
ach-wi-sync (Content Hub 3.x and later)N/A

acquia:contenthub-webhook-interests-delete

Deletes interests from a webhook.

AliasArguments
ach-wi-del (Content Hub 3.x and later)
  • You can pass an array of options to process data:
    • --webhook_url: The webhook that is used.
    • --uuids: The entities against which the operation is performed. These are separated by commas.

acquia:contenthub-webhook-interests-add

Adds interests to a webhook.

AliasArguments
ach-wi-add (Content Hub 3.x and later)
  • You can pass an array of options to process data:
    • --webhook_url: The webhook that is used.
    • --uuids: The entities against which the operation is performed. These are separated by commas.
    • --site_role: The site against which the operation is performed.

acquia:contenthub:client-delete

Deletes clients using names or UUIDs.

AliasArguments
ach-cd (Content Hub 3.7.0 and later)
  • You can pass an array of options to process data:
    • --names: To delete the Acquia Content Hub Client using names.
    • --uuids: To delete the Acquia Content Hub Client using UUIDs.
    • --ignore-origin: To ignore the origin check when deleting the client CDF.

acquia:contenthub:client-update

Updates the Content Hub details.

AliasArguments
ach-cu (Content Hub 3.4.0 and later)
  • You can pass an array of options to process data:
    • --name new_name: To change the client name to new_name.

acquia:contenthub-webhook-interests-list

Displays the list of interest for the registered webhook.

AliasArguments
ach-wi-list (Content Hub 3.3.x and later)
  • You can pass an array of options to process data:
    • drush ach-wi-list --site-role=subscriber: To display list of interests for the current subscriber site in table format.
    • --webhoo-url=http://example.site: To display list of interest for specified webhook url and site role.
    • --uuid=fffbbc03-e748-473a-a5ca-cc1df2a2a744: To display the interest details of specified uuid.
    • --format-json: To display list of interests for the subscriber site in json format.
    • --reason=ab8902ff-3548-4861-bb95-a83c81fdaa40: To display list of interest list matching specified reason uuid.
    • --syndication-status=EXPORT-SUCCESSFUL: To display list of interests for the subscriber having EXPORT-SUCCESSFUL syndication status.
    • --disable-syndication=true: To display list of disabled interest entities for the subscriber.

acquia:contenthub-webhooks-list

Displays the list of registered webhooks.

AliasArguments
ach-wh-list, acquia-contenthub-webhooks-list (Content Hub 3.5.x and later)
  • You can pass an array of options to process data:
    • drush ach-wh-list: To print webhook details in table format.
    • --format=json: To print webhook details in json format.
    • --field=uuid: To print webhook uuids in table format.
    • --format=table --fields=client_uuid,uuid: To print webhook's client_uuids and uuids in table format.

acquia:contenthub-import-queue-run

Runs the Content Hub subscriber import queue.

AliasArguments
ach-import (Content Hub 3.3.x and later)
  • This command is available in the acquia_contenthub_subscriber module.
  • You can pass an array of options to process the data:
    • --time-limit: The maximum number of seconds allowed to run the queue.
    • --items-limit: The maximum number of items allowed to run the queue.

acquia:contenthub-export-queue-run

Runs the Content Hub publisher export queue.

AliasArguments
ach-export (Content Hub 3.3.x and later)
  • This command is available in the acquia_contenthub_publisher module.
  • You can pass an array of options to process the data:
    • --time-limit: The maximum number of seconds allowed to run the queue.
    • --items-limit: The maximum number of items allowed to run the queue.

acquia:contenthub:enable-syndication

Enables syndication for a comma-separated list of UUIDs.

AliasArguments
ach-es (Content Hub 3.3.x and later)
  • This command requires at least one option or a list of comma-separated options:$uuid
  • uuid: The unique ID of the entity being enabled.

acquia:contenthub:disable-syndication

Disables syndication for a comma-separated list of UUIDs.

AliasArguments
ach-ds (Content Hub 3.3.x and later)
  • This command requires at least one option or a list of comma-separated options:$uuid
  • uuid: The unique ID of the entity being disabled.

acquia:contenthub-audit-publisher

Checks the 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-enqueue-by-filters

Adds entities to the import queue on a subscriber site based on the associated filters, except the default filter.

AliasArguments
ach-enqueue-by-filters, ach-enfi
  • --filter-uuids[=FILTER-UUIDS] Creates import queue items based on specified filter uuids, where FILTER-UUIDS is a comma-separated list of filter uuids

acquia:contenthub:entity-scan:filter

Takes an entity UUID and compares it against the existing Cloud Filters, returning a list of filters and sites that the entity matches.

Run --help to review the help information of the command.

Option to --rebuild-cache to initiate a depcalc cache rebuild using the tracking table before running the scan. This may take a few minutes to complete.

AliasArguments
ach-es-f, ach-esf
  • Requires one argument:$uuid
  • uuid is the exact uuid of the entity being inspected

acquia:contenthub-export-local-cdf

Generates a CDF document from a manifest file and requires the location of a YAML $manifest

AliasArguments
ach-elc
  • The $manifest file format is a yml file you must create using the following format:

    entities:
      - node:e2ea160b-3512-4302-ad44-0b7113887922
      - node:9ed840bc-3205-476b-ac37-2da260f9808a
      - node:55f2b0f8-aeb2-490f-b5ba-998aef48fb7f
      - media:44bbe986-989e-493f-8691-cd0d39285aa9

acquia:contenthub-filter-details

Lists the details of a filter.

AliasArguments
ach-cfds

This command takes the following argument:

  • UUID

acquia:contenthub-filters

Lists the available Cloud filters.

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.

AliasArguments
ach-cfa
  • Requires two arguments:$uuid and $url:
  • uuid is the exact uuid of the filter you want to attach
  • url is the webhook URL you want to attach the filter to

acquia:contenthub-filters:detach

Detaches a filter from a website.

AliasArguments
ach-cfd
  • Requires two arguments:$uuid and $url:
  • uuid is the exact uuid of the filter you want to detach
  • url is the webhook URL you want to detach the filter from

acquia:contenthub-import-local-cdf

Imports entities from a CDF document

AliasArguments
ach-ilc
  • Requires a $location of a json file containing a cdf of entities

acquia:contenthub-publisher-upgrade

Publisher upgrade command

AliasArguments
ach-publisher-upgrade, ach-puupN/A

acquia:contenthub-subscriber-upgrade

Subscriber upgrade command

AliasArguments
ach-subscriber-upgrade, ach-suupN/A

acquia:contenthub-fix-config-entities-with-null-uuids

Assigns randomly generated UUIDs to configuration entities with NULL UUIDs (Experimental: Use with caution)

AliasArguments
ach-fix-null-uuidsN/A

acquia:contenthub-remote

Prints the CDF from a remote source (Content Hub)

AliasArguments
ach-reuuid: The UUID of the entity

acquia:contenthub:remote-settings

Retrieves the account details from Content Hub and presents it in an easily readable, formatted table. Information includes the subscription ID, registered webhooks, registered clients, and webhook filter assignments.

AliasArguments
ach-rsN/A

acquia:contenthub-webhooks

Performs 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

acquia-contenthub-webhook-interests-purge

Deletes the current webhook and reassigns all existing filters of the current webhook to the newly created webhook. Webhook uuid changes so it must be updated in the configuration. If the configuration is saved in the database, no further action is needed. Otherwise, update the webhook in settings.php or environment variables depending on how the configuration is managed. This deletes everything from the import tracking table and the import queue.

AliasArguments
ach-wi-purgeN/A

acquia:contenthub-connect-site

Connects client to Content Hub

AliasArguments
ach-connectN/A

acquia:contenthub-delete

Deletes a single entity from Content Hub

AliasArguments
ach-del
  • UUID: The UUID of the entity
  • --ignore-origin: Ignores the origin check when deleting an entity

acquia:contenthub-disconnect-site

Disconnect the client from Content Hub

AliasArguments
ach-disconnectN/A

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=title=New*, status=1: The filters listed by new titles
  • format: The format for output: for example, --format=json

acquia:contenthub-list-queue-items

On publisher, the command prints the content of the acquia_contenthub_publish_export queue. On subscriber, the command prints the acquia_contenthub_subscriber_import queue. If the site has dual configuration, import/export value must pass the queue option. By default, the queue option will have an export value.

AliasArguments
ach-lqi

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

  • type: A string value of a valid entity type
  • uuid: A string value of a valid entity uuid
  • limit: An integer value to specify the number of items to be returned
  • queue: Available only if the site has dual configurations. Expects the import/export value. The default value is export

acquia:contenthub-local

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

AliasArguments
ach-lo
  • entity-type
  • entity-id: The ID or UUID of the entity. You can also run ach-ent which is defined here using the local operation.

    Note

    From version 3.3.x onwards, the entity-type argument is optional when entity UUID is passed as an argument.

acquia:contenthub-purge

(Developer only): Deletes all entities from Content Hub

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

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 Content Hub will purge the contents.

acquia:contenthub-regenerate-secret

Regenerates the shared secret used for webhook verification

AliasArguments
ach-regsecN/A

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-update-secret

Updates the shared secret used for webhook verification

AliasArguments
ach-upsecN/A

acquia:contenthub-audit-entity

Audits an entity for differences with the existing CDF in Content Hub. It is a publisher command, which is only available if the site has the acquia_contenthub_publisher module enabled. It lists the entity and all its dependencies, and compares that data with the one stored remotely in Content Hub. It provides the option to republish that entity and all its dependencies if there are differences.

AliasArguments
ach-audit-entity, ach-ae

This command takes the following arguments:

  • drush acquia:contenthub-audit-entity node 123: Audits the node with nid = 123 and all its dependencies.
  • drush ach-ae node 53fd2ed2-5d29-4028-9423-0713ef2f82b3: Audits the node with UUID = 53fd2ed2-5d29-4028-9423-0713ef2f82b3.

acquia:contenthub-settings

Gets Content Hub settings from the different providers and determines the active configuration with any override information.

AliasArguments
ach-chs

This command takes the following arguments:

  • drush ach-chs
  • --show-secret-key shows the unmasked secret key set

acquia:contenthub-re-queue

Re-queues entities on publisher or subscriber. The command expects at least one option to be provided. Also, it does not run the export/import queues.

AliasArguments
ach-rq

This command takes the following argument:

  • operation

    Valid operation values:

    • export: For publisher sites.
    • import: For subscriber sites.
  • This command requires at least one of the following options:
    • type: A string value of a valid entity type
    • bundle: A string value of a valid entity bundle
    • uuid: A string value of a valid entity uuid
    • use-tracking-table: A boolean option to re-queue entities that are in the tracking table. If not used, it enqueues all entities of the provided type and bundle.
    • only-queued-entities: A boolean option to only re-queue the entities that have a queued status in the tracking table

Did not find what you were looking for?

If this content did not answer your questions, try searching or contacting our support team for further assistance.

Back to Section navigation