Deploying your website
Install DX8 sync
Install the DX8 sync module, you can do this through the UI by navigating to: /admin/modules or running the following drush command in your terminal:
drush pm-enable cohesion_sync -y
Deployment steps (UI):
Using DX8 sync within the Drupal UI is currently experimental, documentation will be available soon.
Deployment steps (Drush):
DX8 Sync allows you to export all of your DX8 configuration including styles, templates and components along with all file entity asset dependencies as a single package. You export this package to the
sync directory and commit to your repository for later deployment in a similar way to performing a core config export/import.
It is designed to be used alongside core config export/import. A typical workflow would involve using core config export/import to move all configuration except for DX8 entities and using DX8 sync to move the rest.
Configuring your sync directory
This is the location of your site configuration files.
settings.php you will need to enable the block of code as shown below. If you're using Drupal core config import/export, you will need to add
CONFIG_SYNC_DIRECTORY => '/directory/outside/webroot', as an entry to the
$config_directories array below.
$config_directories = [ 'dx8_sync' => 'sites/default/files', ];
It's possible to set the
dx8_sync directory to the sync directory as core (which is
/sync by default) or you could export to the filesystem in
sites/default/files for example.
Configuring entity types to include in the export
With DX8 and the DX8 sync modules installed, navigate to: /admin/config/development/sync/export_settings from here you can select which entity types will be scanned for the export.
To export all DX8 packages and dependencies to your sync directory, use the following drush command:
This will create a file called:
[your-site--name].package.yml_ in your sync directory. The file has an underscore after the file extension so that Drupal core config import/export doesn't detect and process it.
To import all previously exported
*.package.yml_ files from your
sync directory into the current site, use the following drush command:
Note that you will need to use one of the following options to tell Drupal what to do when it finds differences between the entities in the
*.package.yml_ files and your site.
drush sync-import --overwrite-all drush sync-import --keep-all
While the import is running, your site will be placed into maintenance mode.