Closed (won't fix)
Project:
Drush
Version:
8.x-6.x-dev
Component:
Core Commands
Priority:
Minor
Category:
Bug report
Assigned:
Issue tags:
Reporter:
Created:
20 Oct 2011 at 21:45 UTC
Updated:
22 Aug 2013 at 21:21 UTC
I'm trying to sync a prod db to two dev drupal installations at once, instead of having prod db dumped/rsynced twice. In aliases.drush.inc I'm defining a site-list alias as following:
$aliases['dev'] = array(
'site-list' => array('@dev1', '@dev2'),
);
$aliases['prod'] = array(
'uri' => 'default/prod',
'root' => '/docroot/prod',
'db-url' => 'mysqli://root:pass@localhost/prod',
);
$aliases['dev1'] = array(
'uri' => 'default/dev1',
'root' => '/docroot/dev1',
'db-url' => 'mysqli://root:pass@localhost/dev1',
);
$aliases['dev2'] = array(
'uri' => 'default/dev2',
'root' => '/docroot/dev2',
'db-url' => 'mysqli://root:pass@localhost/dev2',
);
Running a drush command against any of these aliases works fine. Running "drush @dev status" works fine too and displays status for both @dev1 and @dev2.
However, trying to execute "drush sql-sync @prod @dev" gives me the following error:
Error: no alias record could be found for @dev
Any clues?
Thanks
Comments
Comment #1
moshe weitzman commentedThis feature is buggy in drush and will be removed. I suggest that you call sql-sync twice. The second time will reuse the dump from the first time so that you don't really waste any cycles anyway.
Leaving open to remove this feature from sql-sync
Comment #2
greg.1.anderson commentedI double-checked this, and the sql-sync feature will copy from multiple sources to multiple destinations (e.g. sync all live sites to all dev sites). I'm ambivalent about removing this; might be useful if we ever get alias sets. The big weakness of this code is insuring that the two lists are in alignment, so that you don't sync to the wrong site. (!)
Comment #3
Remon commented@greg.1.anderson
That is the trick, I'm using a single source and thats why it fails IMO. If I pass
$allow_single_source = TRUEtodrush_do_multiple_command()in sync.sql.inc, it syncs correctly.Thanks for your reply.
Comment #4
greg.1.anderson commentedYeah, I started to support that (one source, multiple destinations), but never got the code all the way up to the point where it was supported from the command handler. I'm surprised that it works as well as it does. I think that feature, and the one I mention in #2 are going to be pulled out. Instead, we'll first support a single-option sync,
drush @localdevsite sql-syncthat will look for a well-known alias @localdevsite.peer, or something like that, and pull from that site. That handles ambiguities in the multi-multi sync case. That doesn't help for the single-multi case; I don't think I'm likely to want to support that.Comment #6
greg.1.anderson commentedTest iq-submit to close and tag an issue
Comment #7
greg.1.anderson commentedTest iq-submit to append a tag