Closed (won't fix)
Project:
Drush
Version:
8.x-6.x-dev
Component:
Base system (internal API)
Priority:
Normal
Category:
Bug report
Assigned:
Issue tags:
Reporter:
Created:
18 Aug 2010 at 01:59 UTC
Updated:
11 Sep 2013 at 15:54 UTC
If I have aliases set up like so:
$aliases['local'] = array (
'uri' => 'mysite.localhost',
'root' => '/Users/me/Sites/mysite',
'path-aliases' => array(
'%dump' => '/tmp/mysite_sql_dump.sql',
),
);
$aliases['dev'] = array (
'uri' => 'mysite.com',
'root' => '/var/www/vhosts/mysite.com/httpdocs/',
'remote-host' => 'mysite.com',
'remote-user' => 'me',
'path-aliases' => array(
'%dump' => '/var/www/vhosts/mysite.com/private/mysite_sql_dump.sql',
),
);
Then I find that the sync only works the first time I run it. If I make db changes on @dev and then run sql-sync again, then the command appears to work with no errors or further messages (it says "You will destroy data...", I answer "y" as usual), but the local database is unchanged.
In order to get the database imported I either have to manually delete the local dump file first, or omit %dump from my local alias setting. The latter works fine as far as I can tell, but then I see the warning about "Using temporary files to store and transfer sql-dump..." I can happily ignore the warning but it still seems like there is a bug here.
Comments
Comment #1
greg.1.anderson commentedI'm guessing that it's working as designed, but perhaps the warning messages are not accurate. Check out
drush help sql-sync, and pay close attention to the cache options, which stipulate that the dump file should be used as-is unless it is older than the cache period. You can turn this off if you don't want the behavior (e.g. if you're only using the dump file as a sort of backup).Comment #2
markabur commentedOk, thanks, yeah if the command isn't actually going to destroy any data then it shouldn't need to put up the warning. :-)
I was just speccing the %dump file because of that warning about rsync performing better if I do that... the fact that the dump file sticks around is a side effect I didn't really care for anyway, once I noticed it.
Comment #3
greg.1.anderson commentedYeah, the cache is also good for rsync performance, especially if you insure that your db dump is done in a stable order (drush default for mysql, I think? I use postgres...)
I'll look into fixing the message when the cache is in effect. Note that you might still destroy data if you sync from a cache file, though (e.g. if you changed the target since the last sync...)
Comment #4
greg.1.anderson commentedOh, but I'm going to fix it in HEAD...
Comment #5
markabur commentedCool. Actually the cache message that comes up when running -v is good, would it make sense to make that show up even without -v? Seems like if the "destroy-data" message is going to show without -v then the "using-cache-instead" message should as well.
Comment #6
greg.1.anderson commentedThat makes sense to me.
Comment #7
greg.1.anderson commentedThis issue was marked
closed (won't fix)because Drush has moved to Github.If desired, you may copy this bug to our Github project and then post a link here to the new issue. Please also change the status of this issue to
closed (duplicate).Please ask support questions on Drupal Answers.
Comment #8
markabur commentedI don't use GitHub or StackExchange, so I will just leave it closed. I don't really care about the bug anymore anyway.