drupalwxt / wxt

Drupal 10 variant of the Web Experience Toolkit (WxT).
https://drupalwxt.github.io
GNU General Public License v2.0
25 stars 27 forks source link

Install Profile not able to install from existing configuration #303

Closed jaybabak closed 1 year ago

jaybabak commented 1 year ago

When using Drupal without the WXT profile, an option is presented to the user to install the site from existing configuration, this option is very useful when a site experiences a catastrophic database corruption or failure and it needs to be re-installed.

I do understand that there might be a reason for this which is probably linked to the this issue: Allow an install hook in profiles installing from configuration However, I think it can be overcome by placing the code from the hook_install into one of the sub-modules of the profile.

I haven't looked to deeply into this - but is this something the team is looking to implement in the future?

smulvih2 commented 1 year ago

@jaybabak take a look at this Make command - https://github.com/drupalwxt/docker-scaffold/blob/658c52c2bb6ec4968a1c79f81fabcb92f2e1fa8c/Makefile#LL95C1-L110C54

Since WxT introduces some modules that require a UUID to be set correctly, you need to provide the following UUIDs:

These UUIDs need to match the system where your config comes from. For example, EN language UUID is needed so your config import doesn't try to delete the default language (which throws an error) just to reinstall the same language with a different UUID.

There are two modules I've encountered that will cause issues with you have them enabled in your config:

These module throw an error on uninstall, so if you don't have them enabled in your config it will not work. For password policy, I suggest enabling the WxT extension for this since it help meet security requirements. For groups, if you are not using it, add this patch to WxT so groups is not enabled by default - https://www.drupal.org/project/wxt/issues/3357710

The way I install from config (using docker-scaffold):

If you are not using docker-scaffold, you can reference it to see what those Make commands run, but basically a drush si with a bunch of params, drush cset to set the UUIDs and a drush cim to import config.