When you use drush dl normally, it will download drupal into a subdirectory ie: drupal-7.16

I would like to skip creating the subdirectory and just install the drupal root directory files into the pwd or destination directory. ie: /var/www/install.php

Can this be done with drush commands?

Other shell workarounds also welcome and will be considered for answer status if this is impossible with drush.

  • Be aware that this is an insecure setup. Check some of the comments below for an explanation of a more secure way to do this.
    – bitfed
    Commented Apr 2, 2013 at 10:31

3 Answers 3

drush dl drupal --destination=/var --drupal-project-rename=www
  • 3
    Can you expand on how this is different than the other answers?
    – mpdonadio
    Commented Mar 27, 2013 at 23:43
  • 1
    MPD: It's different because it actually comes closer to answering the question than Greg's answer.
    – bitfed
    Commented Apr 2, 2013 at 10:21
  • Thanks lunitin! It IS the solution, but to correctly solve the question it would have to be. --destination=/var --drupal-project-rename=www
    – bitfed
    Commented Apr 2, 2013 at 10:23

Drush usually creates a sub directory, But you can easily copy all the files from this sub directory "/var/www/drupal-7.12" to its upper folder "/var/www/" with this code

mv * .* ..

You can specify the name of the destination folder to download Drupal into via the --destination parameter. For example:

$ cd /var
$ drush dl drupal --destination=www

Aside: Note that it's probably better to put your site in /var/www/mysite.org rather than directly in /var/www; someday, you might want to put a second site on the same server.

  • 1
    I would go further, and say put it in /var/www/mysite.org/docroot so you can put your private directory in /var/www/mysite.org/private, and make a /var/www/mysite.org/conf for any Apache includes you may need. Changing all of this after the fact can be a pain.
    – mpdonadio
    Commented Nov 4, 2012 at 17:30
  • FWIW, I use the same structure recommended by MPD in all of my Drupal sites. Commented Nov 5, 2012 at 1:15
  • --destination creates the subdirectory still. The rest is not relevant to the question.
    – bitfed
    Commented Nov 7, 2012 at 9:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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