drush sql-sync doesnt extract gzipped sql I run the following command from a script:

drush -v sql-sync @tmp.stage @tmp.coe | tee ./sql-sync.log


My @tmp.stage server is Drush 7.0 and @tmp.coe servers is Drush 6.2.0

An SQL dumpfile is created locally rsynced to the destination server and attempted to be imported by mysql without first uncompressing. Is there a workaround? The source and destination servers have gzip installed.

Log Output

You will destroy data in server1/tmp and replace with data from 2016_tmp_mirror.
Do you really want to continue? (y/n): Include /var/www/2016/tmp/vendor/drush/     [notice]

Executing: mysql --defaults-extra-file=/tmp/drush_jUBS0A --database=2016_tmp_mirror --host=localhost --silent  &lt; /tmp/drush_H19MvV
Calling system(mysqldump --defaults-extra-file=/tmp/drush_QRO7xg  2016_tmp_mirror --host=localhost --no-autocommit --single-transaction --opt -Q  | gzip -f &gt; /home/dgurba/drush-backups/2016_tmp_mirror/20160407200242/2016_tmp_mirror_20160407_200242.sql.gz);
Include /var/www/2016/tmp/vendor/drush/         [notice]
You will destroy data from webuser@server1:/tmp/2016_tmp_mirror_20160407_200242.sql.gz and replace with data from /home/dgurba/drush-backups/2016_tmp_mirror/20160407200242/2016_tmp_mirror_20160407_200242.sql.gz
Do you really want to continue? (y/n): y
Calling system(rsync -e 'ssh -T' -akzv --exclude=".git" --exclude=".gitignore" --exclude=".hg" --exclude=".hgignore" --exclude=".hgrags" --exclude=".bzr" --exclude=".bzrignore" --exclude=".bzrtags" --exclude=".svn" --include="sites/mysite.foo.com/" --include="sites/all" --exclude="sites/*" --stats --progress --remove-source-files /home/dgurba/drush-backups/2016_tmp_mirror/20160407200242/2016_tmp_mirror_20160407_200242.sql.gz webuser@server1:/tmp/2016_tmp_mirror_20160407_200242.sql.gz);
sending incremental file list
2016_tmp_mirror_20160407_200242.sql.gz

         32,768   1%    0.00kB/s    0:00:00  
      2,591,074 100%   26.52MB/s    0:00:00 (xfr#1, to-chk=0/1)
Number of files: 1 (reg: 1)
Number of created files: 1 (reg: 1)
Number of regular files transferred: 1
Total file size: 2,591,074 bytes
Total transferred file size: 2,591,074 bytes
Literal data: 2,591,074 bytes
Matched data: 0 bytes
File list size: 0
File list generation time: 0.001 seconds
File list transfer time: 0.000 seconds
Total bytes sent: 2,584,839
Total bytes received: 42

sent 2,584,839 bytes  received 42 bytes  469,978.36 bytes/sec
total size is 2,591,074  speedup is 1.00
Calling system(mysql --database=bar --host=localhost --user=foo --password='*****'  &lt; /tmp/2016_tmp_mirror_20160407_200242.sql.gz);
ERROR 1064 (42000) at line 1: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '\8B
In Drush 6, the sql-sync command on the source system composed bash commands, and executed them on the remote system as needed via ssh.

In Drush 7, the sql-sync command on the source system uses drush_invoke_process to operate on the remote system. Drush 6 did not support the gzip features that Drush 7's sql-sync command requires.

You don't specifically mention if the system you are running sql-sync on is Drush 7 or Drush 8 or something else, but Drush 8 is substantially similar to Drush 7 vis-a-vis sql-sync implementation.

You should be able to use gzip to send sql dumps to @tmp.coe, but only if you use Drush 6 on the source. Drush 6 is no longer supported, but I believe it also supported transfer between two remotes. You should therefore be able to install Drush 6 on your local system, and perhaps name it drush6 and use it only for this purpose.