-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Impossible to site-install --config-dir with any profile other than minimal #2953
Comments
Shoot, I spent quite a bit of time figuring out how to make this work some time ago, but now I can't remember exactly what was necessary. The reason I can't remember is that I decided it wasn't worth the complexity, when the config installer profile exists (and hopefully someday is heading to core). Now, I just use config installer, which works with any profile. |
The Config Installer profile is completely undocumented, can you propose how to use it to install something like a Lightning sub-profile? AFAICT, that's impossible. |
I think I did that, but my PR is out of date, and probably not working right now. It's not using config installer at the moment, though, so I'm not sure whether I did or did not try that permutation. |
It looks like the Config Installer profile makes an exception and scans the directory of the profile listed in core.extensions.yml for extensions in addition to the regular places Drupal would look for extensions. Unfortunately, if your site is using the core patch to allow for inherited profiles, there might be more than one profile directory that contains extensions to be enabled. And the Config Installer profile will fail during install because it can't find those extensions. I wouldn't expect Config Installer to be making that exception for parent profiles, just noting that it won't work with a profile like Lightning that contains extensions and is generally used as a base profile. /cc @danepowell |
Forcing minimal seems really messy especially the install profile is stored in config now. |
I'd love some guidance from folks about how to proceed. IIRC, the forcing of 'minimal' came after a steady stream of support requests from people trying to use --config-dir with standard profile. They were getting something like 'shortcut content must be deleted' before import' |
Well ideally we'd have https://www.drupal.org/node/2788777 in core and we'd just move https://www.drupal.org/project/install_profile_generator into core drush and then people could create their own install profiles. Basically config import was not designed to work the way drush is using it. A potential solution would be for drush to install minimal, delete all config entities, swap the profile to the one from config, and then do the config import. |
Sounds good. PRs appreciated. |
Anyone? |
For those trying to solve the problem of installing a site from config, the Configuration installer profile works quite nicely. I've tested and documented our usage of it here: http://lightning.acquia.com/blog/using-configuration-installer-lightning Ultimately, I think this is the parent issue https://www.drupal.org/project/drupal/issues/1613424 |
At the very least I think we should add a warning if a profile is specified along with |
try drupal 8.6 and drush si's new --existing-config option. |
@weitzman How come it is not on the documentation? |
Thats not official documentation. Thats a 3rd party site that is rarely updated. |
@weitzman - That 3rd party, site, unfortunately, is the #1 search result for almost any kind of drush-related query on Google. Is there any chance it could be adopted or subsumed by the project? The fact that it's also the first link relating to Drush Commands on the official docs site lends credence and also can lead to some confusion :/ |
Also just noting that when
Drupal.org issue, for reference: Allow an install hook in profiles installing from configuration. So for now the only real option to use Drush/Drupal's built-in install-from-config option is to use minimal as your install profile, or some other very simple profile, and do any non-config-related work via some other mechanism (e.g. default_content, migrations, individual module install hooks, etc.). |
@geerlingguy you can use https://www.drupal.org/project/config_installer . This is what I'm doing, and it works great. |
I've asked. It was a while ago. If someone could make that happen I'd love to receive that site ... i've removed the docs links. |
@weitzman How do you specify config dir? on drupal 8.8.x |
in settings.php you would need $settings['config_sync_directory'] |
If anyone else runs into this and wants a quick fix, delete the install hook from standard profile for a second and it runs fine. :) |
Should this issue be closed? It's not fixed as far as I can tell. When I run:
I get:
|
Its closed because the limitation comes from Drupal core, not Drush |
Got it, thank you. |
You need to update your core.extension.yml on 2 lines: https://www.hashbangcode.com/article/drupal-8-install-site-existing-configuration |
As of #1921 and Drush 9, it's impossible to install a site using the
config-dir
parameter and any profile other than minimal.This was apparently an intentional change to fix problems with UUID changes and content imports, but it had the side effect of basically breaking any profile other than minimal.
The problem is that once a site is installed with a given profile, you generally cannot change that profile via a configuration import. Attempting to do so results in all sorts of error messages like this:
Furthermore, when Drush forces the install profile to be
minimal
, that overwrites any value of$settings['install_profile']
in settings.php to also beminimal
. This could cause all kinds of problems. For instance, on read-only file systems, the install will completely fail. For other file systems, it will prevent you from changing to any other install profile, even if the config-import were successful. In fact, this might actually be what's generating the error message above (note that it's trying to change from a custom profile back to minimal for some reason).I definitely think the original issue in #1921 needs to be solved, but not by forcing the install profile to be minimal. It's something that likely needs to be fixed upstream in Drupal core.
The text was updated successfully, but these errors were encountered: