From ca349e2a83ca25703ebc47bf68fe8d8de5c98486 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oskar=20Sch=C3=B6ldstr=C3=B6m?= Date: Sat, 9 Apr 2016 12:01:44 -0500 Subject: [PATCH] Issue #406: Add docs about sql-sync workaround for older drush versions [ci skip] --- docs/deployment/local-codebase.md | 2 +- docs/extras/drush.md | 14 +++++++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/docs/deployment/local-codebase.md b/docs/deployment/local-codebase.md index d8f85c2b1..71c8f7d4e 100644 --- a/docs/deployment/local-codebase.md +++ b/docs/deployment/local-codebase.md @@ -41,4 +41,4 @@ If you have your Drupal site configured to use a special database and/or user/pa ## Build the VM, import your database -Run `vagrant up` to build the VM with your codebase synced into the proper location. Once the VM is created, you can [connect to the MySQL database](../extras/mysql.md) and import your site's database to the Drupal VM, or use a command like `drush sql-sync` to copy a database from another server. +Run `vagrant up` to build the VM with your codebase synced into the proper location. Once the VM is created, you can [connect to the MySQL database](../extras/mysql.md) and import your site's database to the Drupal VM, or use a [command like `drush sql-sync`](../extras/drush.md#using-sql-sync) to copy a database from another server. diff --git a/docs/extras/drush.md b/docs/extras/drush.md index e29d6c0c3..85b6abea5 100644 --- a/docs/extras/drush.md +++ b/docs/extras/drush.md @@ -35,4 +35,16 @@ $ drush @drupalvm.dev status Drupal VM automatically generates a drush alias file in `~/.drush/drupalvm.aliases.drushrc.php` with an alias for every site you have defined in the `apache_vhosts` variable. -You can disable Drupal VM's automatic Drush alias file management if you want to manage drush aliases on your own. Just set the `configure_local_drush_aliases` variable in `config.yml` to `false`. \ No newline at end of file +You can disable Drupal VM's automatic Drush alias file management if you want to manage drush aliases on your own. Just set the `configure_local_drush_aliases` variable in `config.yml` to `false`. + +## Using sql-sync + +For sql-sync to work between two remotes make sure you are running Drush 8.0.3 or later on your host and your guest machine, as well as 7.1.0 or later on the remote. + +If you're locked to an older version of Drush, it is likely that Drush will try to run the command from the `@destination` instead of from your host computer, which means you need to move your `@remote` alias to Drupal VM as well. You can place the file in any of the [directories that drush searches](https://github.com/drush-ops/drush/blob/5a1328d6e9cb919a286e70360df159d1b4b15d3e/examples/example.aliases.drushrc.php#L43:L51), for example `/home/vagrant/.drush/.aliases.drushrc.php`. + +If you're still having issues, you can avoid `sql-sync` entirely and simply pipe the mysqldump output yourself with: + +``` +drush @remote sql-dump | drush @durpalvm.drupalvm.dev sql-cli +```