0

I'm automating a base Drupal 8 install using a bash script with Composer and Drush commands that installs Drupal and uses Drush and other methods to set my basic site configurations.

I'd like to also create some other basic settings like creating a standard Webform contact form, including its URL, etc.

Is this possible to do somehow via a script? Perhaps have a Webform config export stored somewhere and import it via the script? Note, this would be a new site so its UUID would differ each time.

2 Answers 2

2

You can create a new site from an existing configuration using drush site:install --existing-config. Create the config through exporting from an existing site and copy it over to the new project.

See https://www.drupal.org/node/2897299 and https://www.drupal.org/project/drupal/issues/2980670

The docs are a bit outdated though, you now need to use $settings['config_sync_directory'] instead of $config_directories['sync'], see https://www.drupal.org/node/3018145

1

You can exactly do what you touched on with config: put a placeholder into the yaml for the URL and remove the uuid completely. As you import into a new site, that will generate a new one for you.

1
  • Ah, I was not aware you could import a config with a blank UUID. I'll try that out. Thanks! Commented Feb 28, 2020 at 17:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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