Force config-split:deactivate

Created on 8 March 2024, about 1 year ago
Updated 4 April 2024, about 1 year ago

Problem/Motivation

Our use case is, that we have 3 splits: develop, test, live. On the live website, only the latter is active. In the local dev environment, only the first one is active.

Occasionally, we have to import the live DB into the local environment, e.g. to export all config to ensure that we have the latest in git.

We control the active state of each environment with variables in settings.php, so locally develop is active and live is inactive.

After the DB import, we run drush -y config-split:import develop which enables all components from that environment.

What's missing is to disable all the components from the live environment. This would be happening with a drush config:import, but that would override all the potential changes to config in the DB. The other way round, i.e. drush config:export doesn't work either, because that enables all the live-only modules in the main config outside of any split, because those modules are enabled but the live split is inactive due to the settings.php variables.

What would give us the correct result is to run drush config-split:deactivate live, as it would disable those modules and delete the config entities from e.g. complete_list. However, that command exits, because it gets the status that live is already inactive.

Proposed resolution

Adding an option --force would solve this problem, i.e. disabling that environment regardless of its current status.

I'd be happy to contribute the relevant code. It shouldn't be too complex.

Feature request
Status

Fixed

Version

2.0

Component

Code

Created by

🇩🇪Germany jurgenhaas Gottmadingen

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024