Database syncing over drush

This has been a long wish for me. Sync databases online and on localhost.

There is an add on for drush that does that
https://drupal.org/project/drush_sql_sync_pipe

Of course this didn't run smoothly and needed some extra config. First SSH didn't work correctly on connecting to remote server, and then MySql also had a problem with the same solution, they were both just needed to be added to windows enviroment, eniroment variables to be exact.

So

Right click "My Computer" choose the "Advanced system properties" link then in Advanced TAB click the "Environmental Variables" button under the "User variables" section, click "New" in "Variable name" enter in "HOME". in "Variable value" enter in the path to your profile. Like C:\Users\Marko (without trailing slash)

and for MySql I added this to

PATH variable. C:\wamp\bin\mysql\mysql5.5.16\bin (without trailing slash)

Also clear drush caches and check if enviroment variables is there (type env).

After that things should run smoothly, or at least run, as this synch did take significant amount of time and I was using a 700 kb size DB (took more than 10 minutes). But it did work.

So If you stumble to problems and errors like

'mysql' is not recognized as an internal or external command,
operable program or batch file.
'mysqldump' is not recognized as an internal or external command,
operable program or batch file.

or

Could not create directory '/home/Marko/.ssh'.
The authenticity of host '[appserver.dev.d573617d-e46e-3557-5574-2649ea588434.drush.in]:2222([162.209.60.180]:2222)' can't be established.

Try the above solutions. Also if using drush (even more on drush 5) you could need to use --strict=0 on some commands to work (drush will tell you to use them) and
also there is this bug https://github.com/drush-ops/drush/issues/313 so some commands will need to be run outside local site folder.

and what I forgot in the end is the command
C:\wamp\www\my_site>drush sql-sync-pipe @remote_site.dev @self --progress

this will do it, run over your local DB with the remote one.