I tried importing a configuration after installing Drupal 8 using the standard installation profile but was getting into errors related to the installation profile being already present.

I need a clean drupal slate with only the configuration and no content. Is it possible to do that?

  • Hey Binny, what errors are you talking about? – leymannx Dec 30 '19 at 7:23
  • Installing a site from existing configuration is a core feature since Drupal 8.6, so you don't need to import configuration after installing. See drupal.org/node/2897299 – 4k4 Dec 30 '19 at 9:11
  • @leymannx I got errors related to The selected profile has a hook_install() implementation and therefore can not be installed from configuration. – Binny Dec 30 '19 at 10:06

I found out we can do this by running the following drush command

drush site:install --existing-config

However you might encounter an error related to hook_install found in standard install profile. To mitigate that you would need to install this patch.


| improve this answer | |
  • Exactly, the problem is you can't install from configuration if the sued profile needs a hook_install. For other visitors, the patch's issue is: drupal.org/project/drupal/issues/2982052 – sanzante Jan 8 at 8:49
  • Where does the existing configuration come from? I don't see any way to specify a directory using the --existing-config argument. – awwright May 6 at 21:56

Not the answer you're looking for? Browse other questions tagged or ask your own question.