General
If you have to manage multiple content staging setups. It might become quite time-consuming to recreate the same Flow and Pool configuration over and over again.
To simplify your work, you could easily create a reusable flow and pool configuration that could be reused and adjusted for your setups. To create this configuration, just follow the provided steps.
Pre Requirements:
Setup Drupal 8 site having the latest Version of CMS Content Sync installed
Creating a reusable pool
On your preparation page:
Go to: Configuration → Web Services → CMS Content Sync → Pool
Click on: Add pool
Fill in the pool form
The following screenshot contains example data.
Click save
Creating a reusable export flow
On your preparation page:
Go to: Configuration → Web Services → CMS Content Sync → Flow
Click on: Add flow
Enter the flow name (e.g. Export)
Uncheck the checkbox for “Active”
Select type: “Export”
Select your previously created pool
Create the flow base export configuration that should be used for your upcoming export sites.
In order to work on other sites, the configured entity types and bundle machine names must match the ones on the preparation site.
Click: Save without export
Creating a reusable import flow
On your preparation page:
Go to: Configuration → Web Services → CMS Content Sync → Flow
Click on: Add flow
Enter the flow name (e.g. Import)
Uncheck the checkbox for “Active”
Select type: “Import”
Select your previously created pool
Create the flow base import configuration that should be used for your upcoming import sites.
In order to work on other sites, the configured entity types and bundle machine names must match the ones on the preparation site.
Click: Save without export
Exporting the configuration
Use drush (drush config-export) to export the newly created configuration to your preparation systems local file system.
Go to the local configuration directory and copy the contents of the 3 newly created configurations to a place where you can edit it, e.g.:
cms_content_sync.flow.export.yml
cms_content_sync.flow.import.yml
cms_content_sync.pool.content.yml
Ensure to remove the UUID line at the top of configuration files.
Renaming
Only required if you are using one sync core for multiple content staging setups.
Update the pool machine name, e.g.:
Change config file name:
cms_content_sync.pool.content.yml → cms_content_sync.pool.content_my_second_setup.yml
Update config id within the .yml file:
id: content → id: content_my_second_setup
Update the Export flow, e.g.:
Change config file name:
cms_content_sync.flow.export.yml → cms_content_sync.flow.export_my_second_setup.yml
Update config id within the .yml file:
id: export → id: export_my_second_setup
Update pool references
Find and replace all occurrences of the previously created pool, e.g.:
content: → content_my_second_setup:
Update the Import flow, e.g.:
Change config file name:
cms_content_sync.flow.import.yml → cms_content_sync.flow.import_my_second_setup.yml
Update config id within the .yml file:
id: import → id: import_my_second_setup
Update pool references
Find and replace all occurrences of the previously created pool, e.g.:
content: → content_my_second_setup:
Setup export site
Pre Requirements: The latest version of CMS Content Sync has been installed and its base configuration files have been exported to the sites local configuration.
Add the three newly created configurations to sites configuration directory
Import the configuration using drush (drush config-import)
Once it has been imported, run a config export (drush config-export) to let Drupal write the config files UUID to the config files.
Adjust the site specific settings within a settings.*.php file that is not managed within Git.
Overwrite Site-ID within the flow configration, e.g. (Ensure to adjust the pool machine name to your specifications):
$settings["cms_content_sync"]["pools"]["content"]["site_id"] = "export";
Enable export flow, e.g. (Ensure to adjust the flow machine name to your specifications):
$config["cms_content_sync.flow.export"]["status"] = TRUE;
Export the configuration to the sync core using drush (drush cse)
Setup import site
Pre Requirements: The latest version of CMS Content Sync has been installed and its base configuration files have been exported to the sites local configuration.
Add the three newly created configurations to sites configuration directory
Import the configuration using drush (drush config-import)
Once it has been imported, run a config export (drush config-export) to let Drupal write the config files UUID to the config files.
Adjust the site specific settings within a settings.*.php file that is not managed within Git.
Overwrite Site-ID within the flow configration, e.g. (Ensure to adjust the pool machine name to your specifications):
$settings["cms_content_sync"]["pools"]["content"]["site_id"] = "import";
Enable export flow, e.g. (Ensure to adjust the flow machine name to your specifications):
$config["cms_content_sync.flow.import"]["status"] = TRUE;
Export the configuration to the sync core using drush (drush cse)