Motivation

Many developers use Vagrant for Drupal development. One problem with Drupal is that site implementations will have thousands of files, greatly slowing performance if the code is shared using Virtualbox or NFS. To solve this, Vagrant 1.5 supports using rsync to copy code edits to the virtual machine. This pretty much solves the performance problem.

Unfortunately, using drush features-update breaks this model since it updates code on the VM, and not on the host. If we could tell drush to treat /vagrant/www/docroot as the site base instead of /var/www/docroot, we can use the available (but slow) automatic mount to extract out our updates.

I thought about solving this with Vagrant (I've been using Unison previously to sync files), but when it comes down to it, it's Features and Drupal that is deciding that in-place code writes are OK, so I figure it's best solved here.

Solution

This patch adds a --base-path option to drush features-update (and features-update-all). Developers can default this in drushrc.php if they desire.

This also has the side benefit of making it super easy to export to a different Drupal site on the same file system.

CommentFileSizeAuthor
#1 2244869.1-drush-base-path.patch2.12 KBdeviantintegral
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

deviantintegral’s picture

deviantintegral’s picture

Status: Active » Needs review
Steven Merrill’s picture

I also wrote https://github.com/smerrill/vagrant-rsync-back to deal with this exact problem.

Do a `drush fu`, or go to the UI and click "Generate Feature," then run `vagrant rsync-back` from the host.

hefox’s picture

Should this be against drush core instead? (does it needs to know the root of the install for anything.. site install?)

Dave Reid’s picture

Isn't this duplicating the existing Drush '--root' option?