Content Hub

Staging down syndication websites

Important

Content Hub 2.x will reach end-of-life on December 31, 2024. Acquia recommends that you update your Content Hub version to Content Hub 3.x by using the composer require instructions available on the acquia_contenthub project page.

This guide gives you the requirements and procedure for staging down syndication websites in Site Factory.

Requirements

  1. Clients and registered webhooks should exist for every site in the target environment registered to that environment’s specific Content Hub account.
  2. Staging down should be done for a fleet of websites, not just one.
  3. Configuration must be done in code or the equivalent. Generally, this means that all the settings found in the configuration acquia_contenthub.admin_settings should be stored in settings.php or a post-settings-php factory hook.

    To check this using drush, run the following command on each site in each environment:

    drush cget acquia_contenthub.admin_settings --include-overridden
    

    The following conditions must be true while looking at all the responses holistically:

    • Each environment must have different API and secret keys registered to different Content Hub accounts
    • Each site within an environment must be registered with a different client name and origin
  4. All environments should have scheduled jobs for each publisher and subscriber website created within the Site Factory UI.
  5. When syndicating in the target environment (after stagedown), export publisher-only sites first, then any publisher/subscriber sites, and finish by importing entities in the order given in the following procedure.

Procedure

Assumptions and Adaptations

This process assumes the following:

  • The target environment already has been using Content Hub
  • Each site in the target environment already has registered clients and webhooks, registered to a different account than the source environment
  • Configuration is complete and a database overwrite will not change the configuration

1. Pause the Content Hub scheduled jobs in the target environment

Queues should be paused while staging down a site. Check the Scheduled Jobs in Site Factory.

2. Purge the Content Hub account in the target environment

All content stored in the Content Hub service associated with the target environment must be removed before staging sites down.

3. Delete all filters in the target environment

Filters may have changed in the source environment, and you will need to recreate them after staging down.

4. Start and complete the staging process for all the sites

This can be done from the Site Factory user interface. Stage down the entire fleet of websites instead of staging down a single site.

5. Add all filters from the source environment’s Content Hub account to the target environment’s Content Hub account

Look at all the filters in the source environment’s Content Hub account and add them to the target environment’s Content Hub account.

6. Add all entities to the queue again in the target environment’s publishing website

Look at the entities exported stored in the acquia_contenthub_publisher_export_tracking table. Loop through the entities and add them to the queue again for export in the target environment.

7. Re-enable scheduled jobs for the publisher

The publisher will export all the entities that were queued in step 6. These exports must be completed before moving on to the next step.

8. Add interests to the service for each entity in each subscribing site’s tracking table

Interests cannot be built until the entities exist in the service; therefore, don’t perform this step until the exports have completed. Add each site’s interests to the Content Hub service in the target environment by running the drush ach-wi-sync command. This must be done for each subscribing site.

9. Re-enable scheduled jobs on all subscribers

Add each site’s interests to the Content Hub service in the target environment. All imported entities are stored in the acquia_contenthub_subscriber_import_tracking table. At this point, you should be able to syndicate content based on the filters you created in step 5 and/or manually import content from the Discovery interface.