Skip to content
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

Update database array in local.settings.php when running recipes:multisite:init #2907

Closed
ba66e77 opened this issue Jun 25, 2018 · 1 comment
Assignees
Labels
Bug Something isn't working

Comments

@ba66e77
Copy link
Contributor

ba66e77 commented Jun 25, 2018

When running blt recipes:multisite:init, BLT prompts for database information and uses that into to setup a database record in box/config.yml but that connection information does not populate the database array in the new site's local.settings.php file. As a result, without modification, the new site connects to the original database.

https://github.com/acquia/blt/blob/44785181bf2038493929d45ebd375b36ae903148/src/Robo/Commands/Generate/MultisiteCommand.php

@ba66e77 ba66e77 added Bug Something isn't working 9.1.x labels Jun 25, 2018
@ba66e77 ba66e77 changed the title Update database array in local.settings.php when running repices:multisite:init Update database array in local.settings.php when running recipes:multisite:init Jun 25, 2018
@bschilt
Copy link

bschilt commented Jul 7, 2018

This was a frustrating issue to experience, especially when a developer is trying to set up their local dev environment for the first time.

I was able to get around this by adding the DB info into the sites/[sitename]/blt.yml file like this:

drupal:
  db:
    database: [sitename]
    username: [username]
    password: [password]
    host: localhost
    port: 3306

These creds will obviously need to match what's in the mysql_users array in box/config.yml. Now the blt:init:settings command will properly create the local.settings.php file.

I agree that the recipes:multisite:init command should handle the DB credentials, perhaps that command just needs to populate the site specific blt.yml file with the DB array.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants