Skip to content

Commit

Permalink
Issue geerlingguy#406: Add docs about sql-sync workaround for older d…
Browse files Browse the repository at this point in the history
…rush versions [ci skip]
  • Loading branch information
oxyc committed Apr 9, 2016
1 parent e1fea4b commit ca349e2
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docs/deployment/local-codebase.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
14 changes: 13 additions & 1 deletion docs/extras/drush.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`.
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/<remote-alias>.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
```

0 comments on commit ca349e2

Please sign in to comment.