Score:0

Drush 10 sql-sync and multi site --uri not working

in flag

I am doing some D8 to D9 migrations and having a problem with a multisite. I upgraded my local version to drush 10 as well as on my dev server and included the drush/sites/us2.site.yml file.

I can sql-sync the default db no problem, but when I try and specify a --uri it still targets my default database.

drush sql-sync @us2.dev @self says it will replace us2_local with us2dev which is correct.

drush sql-sync @us2.dev @self --uri="reports" says it will replace us2_reports_local with us2dev. That is incorrect. The source DB should be a different database in this case. It did get the target database correct as my local db is us2_reports_local.

if I do drush @us2.dev status database points to us2dev

if I do drush @us2.dev status --uri="reports" it shows the correct us2 reports db so status seems to work, but not sql-sync

Any ideas? I feel like I am missing something obvious. I am still on the latest version of drupal 8 until I get the modules up to date.

Jaypan avatar
de flag
`--uri` passes a URL (eg. `http://example.com/`) that is used as the URL accessing Drupal. 'reports' doesn't look valid. What is it you're t trying to do with `--uri`?
in flag
`reports` is a site defined in the sites.php file used in multisite. For example, in sites.php `$sites['reports.us2.local'] = 'reports';`. If I pass that URL instead of the site name, it still does not work @Jaypan
Jaypan avatar
de flag
I don't believe that's what `--uri` does. It sounds like you need to set up a drush alias, and set the URI there. Then you can call drush with the alias.
in flag
That was indeed the problem @Jaypan. I still have to specify --uri in order for sql-sync to select the correct local DB which I find odd. I may not have the new reports.site.yml entirely correct
in flag
for example: `drush sql-sync @reports.dev @self` results in replace `us2_local` with `us2dev-reports` `drush sql-sync @reports.dev @self --uri=reports` results in the correct local db: replace `us2_reports_local` with `us2dev-reports`
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.