I'm trying to push a site from dev to live via drush... I have aliases set up for @dev and @live (see alias settings below). Basically the process I'm using is:

$drush rsync @dev @live
which rsyncs the directory tree to the remote server. This part works fine.

Then

$drush sql-sync --source-dump --target dump @dev @live which does copy SOMETHING into the remote database - but it's not an exact copy of my local database !! (for instance, it includes one less table...

(I am running update.php also... or $drush up and/or $drush updb)

So, the live site is all garbled - it's using database settings that are old and coming from -- ??? The past? I'm quite confused. The sql-sync is successfully building a remote database but I'm baffled why it isn't an exact copy of the current dev database...

Anyone come across this sort of thing?
Any help is greatly appreciated.

(aliases from aliases.drushrc.php:)

$aliases['live'] = array(
'uri' => 'http://default',
'root' => 'domains/dev.mysite.com/html',
'db-url' => 'mysql://user:pw@internal-db.xxxxxx.gridserver.com/live_db',
'remote-host' => 'xxxxxx.gridserver.com',
'remote-user' => 'username',
'path-aliases' => array(
'%drush' => 'bin/drush',
'%drush-script' => 'bin/drush/drush.php',
'%files' => 'domains/dev.mysite.com/html/sites/all/files',
'%custom' => 'domains/dev.mysite.com'),

);

$aliases['dev'] = array(
'uri' => 'http://default',
'root' => '/Applications/MAMP/htdocs/dev_site',
'db-url' => 'mysql://user:pw@localhost/dev_db'
);

Comments

starsinmypockets’s picture

I'm running MAMP locally...

ojfam’s picture

Quite unusual. I'm running the same setup as you (MAMP locally) and I was able to setup drush to sync with my server. The only thing I notice is that you didn't setup a %dump path for both aliases:

  'path-aliases' => array(
    '%drush-script' => '/home/webadmin/drush/drush',
    '%dump' => '/home/webadmin/drush/sql.dump',
  )

I then ran: drush sql-sync @dev @v3.staging
and it worked without any problem. You could also try the --verbose option to see what it is doing and take it from there.

balintk’s picture

You should use the --no-cache option to force a refresh, otherwise drush uses the cached dump file.