1

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?

3
  • Hey Binny, what errors are you talking about?
    – leymannx
    Commented Dec 30, 2019 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
    – 4uk4
    Commented Dec 30, 2019 at 9:11
  • 1
    @leymannx I got errors related to The selected profile has a hook_install() implementation and therefore can not be installed from configuration.
    – Binny
    Commented Dec 30, 2019 at 10:06

1 Answer 1

3

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.

https://www.drupal.org/files/issues/2018-11-27/2982052-22.patch

3
  • 1
    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
    Commented Jan 8, 2020 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
    Commented May 6, 2020 at 21:56
  • 2
    It comes from $settings["config_sync_directory"] in settings.php. See drupal.org/node/2897299
    – batigolix
    Commented Nov 20, 2020 at 6:09

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