Problem/Motivation

TL;DR: we cannot assume that everybody's going to leverage version control to handle CMI file changes. But what we know for sure is that every D8 user will at some point need to 'disable' (uninstall) a module without losing the associated configuration.

Per #1199946: Disabled modules are broken beyond repair so the "disable" functionality needs to be removed modules can no longer be disabled. #2035079: [PP-3] Figure out what to do with the install/uninstall modules page is going to handle the UX for site builders to better understand how to deal with the missing 'disable' state. We're however left in a state in which site builders will not necessarily know how to not lose their configuration data if/when they need to uninstall a module for any given reason (e.g. custom module is breaking the site)

In core we can:

  • Leverage the single export feature => Very easy to understand for site builders (/admin/config/development/configuration/single/export) but what happens when you have, say, 5+ config files to manually back up? What if you miss one and can't import successfully next (e.g. field storage dependency)? Even more tricky, what if only part of the configuration is being imported and breaks the site's functionality but nobody immediately sees it? There *is* an alternative if you leverage the Features module, but it's targeted at advanced users.
  • Leverage the full export feature => works as above except we basically snapshot the full conf and download a tar.gz archive locally that we can later import on the site. Would prevent issues with the simple export/import but it's not super flexible. E.g. in a distributed team (say, UK and Australia) what happens when John (Australia) implements 10s of changes for several configuration files via the GUI, then manually backs up the conf locally to uninstall a bunch of modules, then Bob (UK) takes over the development for the day and needs the original backup that only John has? John is not around for the rest of the day and the team is stuck or needs to find alternatives (restoring from backup? recreating the configuration? etc.) but there's no way to have the latest and greatest archive that John has.

We could also leverage a contrib module (maybe improve disabled_modules?) to automatically back up config files when a module is disabled => would work as the below proposal, but would also mean you'd have to have the module available in the codebase/installed before being able to rely on any of those frequent activities.

Proposed resolution

Implement automated and granular CMI snapshots to back up files when a module is uninstalled => in essence, this could be as simple as dumping the specific config files to /tmp when a module is uninstalled. Or, we could ideally make this a customizable path for customers to set where to back up CMI files (e.g. under files/*). In other words, the workflow would be such as each time you'd uninstall a module, its config file(s) would be backed up automatically behind the scenes in a given location, for future potential re-use. Could be with the form: cmi_backup/mymodule/configfile.yml / cmi_backup/mymodule/configfile1.yml / cmi_backup/myothermodule/otherconfigfile.yml, etc.

Remaining tasks

Write patch. Optionally, perform UX review if there are user interface changes involved.

User interface changes

TBD.

API changes

None.

Data model changes

None.

Comments

anavarre’s picture

Issue summary: View changes
anavarre’s picture

Issue summary: View changes
anavarre’s picture

Issue summary: View changes
anavarre’s picture

Version: 8.0.x-dev » 8.1.x-dev
Issue summary: View changes

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.0-beta1 was released on March 2, 2016, which means new developments and disruptive changes should now be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.0-beta1 was released on August 3, 2016, which means new developments and disruptive changes should now be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.0-alpha1 will be released the week of January 30, 2017, which means new developments and disruptive changes should now be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.0-alpha1 will be released the week of July 31, 2017, which means new developments and disruptive changes should now be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.0-alpha1 will be released the week of January 17, 2018, which means new developments and disruptive changes should now be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.6.x-dev » 8.7.x-dev

Drupal 8.6.0-alpha1 will be released the week of July 16, 2018, which means new developments and disruptive changes should now be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.7.x-dev » 8.8.x-dev

Drupal 8.7.0-alpha1 will be released the week of March 11, 2019, which means new developments and disruptive changes should now be targeted against the 8.8.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.0-alpha1 will be released the week of October 14th, 2019, which means new developments and disruptive changes should now be targeted against the 8.9.x-dev branch. (Any changes to 8.9.x will also be committed to 9.0.x in preparation for Drupal 9’s release, but some changes like significant feature additions will be deferred to 9.1.x.). For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.9.x-dev » 9.1.x-dev

Drupal 8.9.0-beta1 was released on March 20, 2020. 8.9.x is the final, long-term support (LTS) minor release of Drupal 8, which means new developments and disruptive changes should now be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 9.1.x-dev » 9.2.x-dev

Drupal 9.1.0-alpha1 will be released the week of October 19, 2020, which means new developments and disruptive changes should now be targeted for the 9.2.x-dev branch. For more information see the Drupal 9 minor version schedule and the Allowed changes during the Drupal 9 release cycle.

Version: 9.2.x-dev » 9.3.x-dev

Drupal 9.2.0-alpha1 will be released the week of May 3, 2021, which means new developments and disruptive changes should now be targeted for the 9.3.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.0-rc1 was released on November 26, 2021, which means new developments and disruptive changes should now be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.0-alpha1 was released on May 6, 2022, which means new developments and disruptive changes should now be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.5.x-dev » 10.1.x-dev

Drupal 9.5.0-beta2 and Drupal 10.0.0-beta2 were released on September 29, 2022, which means new developments and disruptive changes should now be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 10.1.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch, which currently accepts only minor-version allowed changes. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.