Client sites can be spawned by provisioning a new site with a given configuration. In Drupal 8, this can be done from installation profiles with the initial configuration stored as code, in the config/ directory of the profile.

If one wishes to add new features for his/her clients, this can be done by adding new modules and accompanying configuration to the profile, adding a new platform with said code changes, and then migrating existing clients sites over to it. The new configuration then needs to be imported into the client site.

The problem with this approach is that it will overwrite any configuration that the client saved to the database. This is the same issue as running a drush features-revert command in the Features world. All live configuration is lost. So we need to be merge upstream configuration with live configuration in order to keep both.

The solution for this in the wider Drupal ecosystem is the drush config-merge command. For background, see:

To set this up within Aegir, we'll need to do the following at the end of clone and migrate tasks:

  • Export configuration from the source (old) site.
  • Merge it with the configuration in the profile.
  • Import it into the destination (new) site.

The one issue here is that there could be merge conflicts requiring human intervention to resolve (see Three-Way Merge). Aegir tasks are normally run as batch jobs without a human so it would be necessary to find a workaround for this.

Perhaps the task could fail leaving the conflicts in a particular directory. Someone could then resolve the conflicts in that directory, rerun that task, and then the merge could use that resolution to complete the merge.

However we best determine how to do this, we'll probably need to depend on the following:

We may, however, be able to get by without the config-extra dependency if Drush core's config-pull command does the trick. Either way, we wouldn't ever have to deal with three-way merges as we're only dealing with one database and one codebase. See Add support for skipping the self-export step for details.

Comments

colan created an issue.