4

Has anyone had any luck upgrading from Drush 6 to 7 on a windows machine? I feel like I'm beating my head against a wall trying to get this done. I want/need to use Omega 4 and I need Drush 7 to do so. Also, if I ever want to update my websites to Drupal 8, I will need Drush 7. Any direction/advice would be great!

Edit by @othermachines: Drush 8 is now recommended for Drupal 8 development.

  • You dont need Drush 7 for Omega 4! – Alex Gill Apr 23 '14 at 15:59
  • OMG! i'm kind of dumb today I guess. I've been wracking my brain for two days. I haven't been able to get omega commands to work at all and I read somewhere at some point (maybe it was the Drupalize.me tutorial?) that Drush 7 was required. But now that I did the drush --filter=omega, I see some of the omega commands are there. Huge relief. I still will need Drush 7 at some point - isn't that required for Drupal 8? I have a good 18-24 months, though, before I even consider working with 8. – Catie Apr 23 '14 at 17:07
  • Welcome Catie ;-) – Alex Gill Apr 24 '14 at 7:59
3

Although it's a year and a half since this question was posted, as we get closer to a production release of Drupal 8 I can see it getting a few hits. So here's my answer...

Yes, it certainly can!

Although as of this writing it appears Drush 8.x (in particular the latest dev on branch master) is the recommended version for Drupal 8 development.

See: Drush Installation/Upgrading instructions

I'm running WampServer 2.5 (PHP 5.6.13RC1, MySQL 5.6.17, Apache 2.4.9) on Windows 8.1 and use Git Bash shell from the Git for Windows installation. I have Composer 1.0-dev set up globally.

I was able to upgrade successfully1 following the first installation method on this page, Composer - One Drush for all Projects.

Steps

  1. Install from the command line:

    $ composer global require drush/drush:dev-master

  2. Modify the path to Drush in your system environment variables (here's a helper). On my system, Drush was installed in c:\Users\Username\AppData\Roaming\Composer\vendor\drush\drush.

  3. Reboot Windows

Troubleshooting: Check loaded php.ini

The only problem that cropped up post-install was that the PHP settings being loaded by the CLI (and accessed by Drush) are out of sync with those loaded by WampServer. I found I had to copy my PHP settings from phpForApache.ini to php.ini in the currently loaded PHP version folder in c:/wamp/bin.2

Is Drush telling you you don't have X extension enabled, when you know you do? Run drush core-status to check on the path to php.ini on your own system.

A note about the Windows zip package

I had previously used the Windows zip package to install version 6.x. As of this writing there is a package available for version 7 - scroll down to the bottom of the installation page - but not 8 (unsurprisingly since AFAIK it is heavily under development). I wonder if having previously gone through this process somehow eased this upgrade by setting up some necessary extras - probably not; I just don't know. Maybe I just become a big, fat skeptic when things work too easily on Windows.3

See also:
Installing Drush on Windows (Drupal.org)
How to Upgrade Drush to work with Drupal 8 (Manjit Singh)


1 Because this is Windows, it should be noted that I've only installed in the last couple of days, and have so far only used it for basic tasks such as creating databases, installing a site, clearing the cache tables. No problems so far, but that doesn't mean they won't crop up.

2 I don't recall having to copy the PHP settings over before, and this is going to be a bit sticky when I alter these settings or switch between PHP versions, but so far I haven't found a way around this.

3 The author above (Manjit Singh) seemed to have a similarly pain-free upgrade, which makes me less skeptical. :)

  • Using "drush/drush:dev-master" threw an error for me (on Windows 10 Pro), but I was successfully able to install using "drush/drush". – Will Peavy Jul 25 '16 at 16:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.