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.
$config_directories array specifies the location of file system directories used for configuration data. On install, the "sync" directory is created. This is used for configuration imports. The "active" directory is not created by default since the default storage for active configuration is the database rather than the file system.
The default location for the "sync" directory is inside a randomly-named directory in the public files path. The setting below allows you to override the "sync" location.
If you use files for the "active" configuration, you can tell the Configuration system where this directory is located by adding an entry with array key CONFIGACTIVEDIRECTORY.
$config_directories = [ CONFIG_SYNC_DIRECTORY => '/directory/outside/webroot', ];
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.