Questions tagged [drush]

Use it for questions about the command line shell and Unix scripting interface for Drupal (a.k.a. Drush).

Filter by
Sorted by
Tagged with
12
votes
6answers
6k views

`drush cc all` command takes too long time, what can I do?

On a site of mine drush cc all takes more than 4 mins to run. The site db is a few GBs. However, I cannot see a clear reason as to why it takes too long. What can I do to locate the bottle neck?
11
votes
1answer
6k views

How to dump a single table from database using drush?

I'm aware of mysqldump utility, but is there any way of dumping a single table from database using drush (e.g. for sql-dump, sql-sync)?
11
votes
4answers
24k views

Drush command not found after Drush completely installed

I installed Drush 8 with composer. composer require drush/drush:~8 Unfortunately, error drush command not found after Drush completely installed. Why's the drush command can't be use? Installing ...
11
votes
8answers
8k views

Is Git now the only way to install Drush?

Going in circles trying to figure out the right way to install Drush on a Linux CentOS system. I have Git set up, but as I'm not planning to contribute to Drush code at the moment, it's not ...
11
votes
3answers
1k views

Drush Make removes .git folders

After a silly feeling with drush make and github I found out that all the .git folders (used by git to record history, config, origin location etc ) were removed by drush make and I have heard about ...
11
votes
3answers
6k views

Run drush cron for a single module

Is it possible to run drush cron over a single module, something similar to "drush cron my_module"?
11
votes
1answer
6k views

Drush dl not working with PHP 7 and ubuntu 16.04

When i try to do: drush dl drupal-8 i get the following error: PHP Fatal error: Uncaught Error: Call to undefined function Drush\UpdateService\simplexml_load_file() in /home/alexander/.config/...
11
votes
1answer
4k views

Is is possible to call a function inside a .inc file of a module via drush eval?

I have a module with additional (.inc) files containing functions I need to run via Drush. I know it is possible to run drush eval, but when I try to do it for those functions I get the following ...
11
votes
2answers
5k views

How do I use Drush 8 site aliases in Drush 9?

In Drush 8, my site aliases are loaded correctly from ~/.drush/mysite.aliases.drushrc.php. E.g. $aliases['dev'] = array( 'root' => '/var/www/html/mysite.dev/docroot', 'uri' => 'mysite.prod....
11
votes
2answers
9k views

Setting a user as an administrator via drush command line?

How can I set a user to a specific role via drush? In my case I want to give the role of administrator to the user.
11
votes
1answer
2k views

How do I do git clone with drush to download the HEAD version of a module?

Is there any way to clone or pull the HEAD version of a module in drupal.org git repository? For example, if I'm on Drupal 7, and the last branch of Views is 3, I would like to do: drush git-clone ...
11
votes
0answers
10k views

How to configure Drush on Windows 7? [closed]

I'm working on drupal in Windows environment. Most drupal developers recommend to use Drush. I know it is a very useful command line tool for drupal development. I downloaded the Drush installer for ...
10
votes
4answers
3k views

How to update disabled modules using Drush?

Is there a way to update disabled modules with Drush? Currently, when I try to update a disabled module with Drush, I get this message: Project has no enabled extensions and can't be updated ...
10
votes
1answer
10k views

Use drush to put a site in maintenance mode [duplicate]

drush @mysite cget system.maintenance shows: message: '@mysite is currently under maintenance. We should be back shortly. Thank you for your patience.' langcode: en Drupal 8 uses state ...
10
votes
3answers
499 views

What is the easiest way to install clean Drupal from scratch using drush?

What is the easiest/quickest way to install clean Drupal from scratch on empty folder for testing purposes by using drush (without resorting to shell scripts or aliases).
10
votes
1answer
6k views

drush/drush dev-master requires codegyre/robo ~1.0.0-beta1

I'm transitioning a Drupal 6 site to Drupal 8.1 so following the official instructions, I set up a new install in its own directory. Since this is only one site, I followed the instructions to put my ...
10
votes
2answers
4k views

What could cause remote drush commands to fail with ssh errors when ssh works in all other cases?

I have public and private ssh keys on all of my three servers (dev, UAT, & production) so I can log in remotely, or from one to another. Everything is working perfectly for the ssh and scp ...
10
votes
4answers
5k views

How to get list of installed/enabled modules ready for repopulating new site with drush module installation? [duplicate]

When doing drush pm-list I get a whole list of modules but too much info also, like this: Mail Privatemsg filter (privatemsg_filter) 7.x-1.4 Mail Privatemsg ...
10
votes
5answers
10k views

How to list all users in drush?

I would like to list information about all users using drush. There is user-information, but it shows information only about single user. Are there any other solutions?
10
votes
1answer
9k views

How does `drush features-update` work?

I have made changes to a Feature on a Drupal 7 site. I want the same feature to be updated in another website. How to do it using the drush features-update command? When I run it, it asks to ...
10
votes
4answers
5k views

Ask Drush to list which modules have database updates available

I specifically want Drush to list, of the modules that have available updates, which of those contain database updates. Is this possible with Drush? Edit for clarification: I know drush up will list ...
10
votes
3answers
6k views

How do I disable modules in Drupal 8 in admin interface or via Drush?

In Drupal 7 it was possible to disable modules via admin interface or via Drush drush pm-disable. In Drupal 8 the checkboxes are greyed out in the admin interface and Drush is not able to disable them ...
10
votes
6answers
6k views

Drush installed and running; No Drupal site found even with uri specified

After much trial and tribulation, I thought I had drush all ready to roar. Much excitement. But then, no joy... Drush is working. The sites operate fine via MAMP. Regardless, a "drush cc all" command ...
10
votes
3answers
8k views

Drush and user permissions

I see that my user is a member of the apache group. I added and confirmed via the following $ sudo usermod -a -G apache `whoami` # add my user to apache group $ sudo chmod -R g+w . # ...
10
votes
0answers
8k views

Drush : Missing $settings['hash_salt'] in settings.php [closed]

I just setup a new Drupal environment with Mamp. I can access my website just fine, but whenever I want to run drush cr I get the following error : exception 'RuntimeException' with message 'Missing $...
9
votes
4answers
9k views

execute drush command from devel/php drupal

Can any one please tell me how can I execute drush command from devel/php? I can execute PHP codes from devel/php. But I don't know how can I execute drush command from devel/php. (As we know "devel/...
9
votes
3answers
6k views

How to skip specific tables with drush sql-dump?

I have a drush config file ~/.drush/drushrc.php: if (!isset($options['structure-tables']['common'])) { $options['structure-tables']['common'] = array( 'cache', 'cache_*', 'history', 'search_*', ...
9
votes
5answers
11k views

The PHP version is not correctly detected

I'm running Drush on a host that has multiple versions of PHP installed. By default, php --version would give you 5.2.x, but php53 and php54 are also available. So in my .bash_profile I have alias php=...
9
votes
4answers
3k views

How do I use “drush make” modules with a local module code?

I got to love the workflow "drush make" gives us. I am sure there are others who would want their development code to be put into a make file with it not being ready for drupal.org, for example, ...
9
votes
3answers
2k views

How to delete a node or a list of nodes with Drush?

I discovered the Delete all module which gives you the ability to delete all the nodes of a given content type. However, with this module you can't delete a single node or a list of nodes. In the ...
9
votes
2answers
6k views

Drush PHP syntax error when running

I am following the instructions to install Drush that are listed on this page: https://github.com/drush-ops/drush/blob/master/docs/install.md I seem to be getting a syntax error within the code: [...
9
votes
3answers
2k views

Drush Scripting? Or Batch API?

We have an Ubercart website that handles large volumes of orders daily, processes them and runs other tasks like billing, delivery routing, and future order creation. Some of these tasks are heavy ...
9
votes
6answers
15k views

Drush on windows - Command pm-enable needs a higher bootstrap level to run

I installed aquia drupal and added a core drupal folder into the sites list. I also installed the windows installer of drush, it works ok for downloading modules but when I try to enable them I get ...
9
votes
3answers
3k views

How do you write a drush alias for a local Vagrant box?

I'm trying to write a simple drush alias to connect to a Drupal site running on a local Vagrant instance. I have the following in a file called ~/.drush/l.aliases.drushrc.php: $aliases['o'] = array( ...
9
votes
3answers
14k views

How to completely wipe and rebuild drupal menus?

A while ago I found a cool blog post that detailed how to empty the menu tables, and rebuild the menu system with a drush php call, a necessity since the site will be unusable after emptying those ...
9
votes
2answers
2k views

How to use Drush's concurrent execution capability?

I am using Drupal multi-sites (single codebase, multiple sites/*). Along with this, I have started using Drush aliases to manage them: $ cat sites/all/drush/aliases.drushrc.php <?php $aliases['...
9
votes
3answers
4k views

Automatically update Drupal core/modules for a large number of sites (with Drush)? [closed]

I'm the administrator of a lot of Drupal websites on different hosting providers. Some have drush; others don't (and can't: like shared hosting). Every time there is a Core upgrade, I spend 1 or 2 ...
9
votes
4answers
2k views

(dis)advantages of staging dev->production using 'drush rsync' vs 'git'?

I set up a Drupal site under git control for development work. It's parented in a master, bare GIT repo, and as changes are made in my various project-work git clones, and pushed back to the master, ...
9
votes
1answer
811 views

How can I install composer packages with drush make?

How does one include composer package in a drush make file? The more general answer, the better. There's already a composer drush module allowing drush dl to handle composer packages, but that ...
8
votes
1answer
3k views

Has drupal abandoned drush?

I've been away from drupal for 2-3 years. I just came back around and installed drush via composer (like the drush site recommends) and now every time I try to use drush I get a message telling me ...
8
votes
5answers
1k views

How to get an import of a very large Drupal database working?

I'm using Vagrant and OracleVM to run Drupal 7. I've got the site up and running and I'm trying to get my database imported. So far I've run drush cc and cleared the drush cache, and then I did ...
8
votes
1answer
9k views

Drush pm-update needs a module?

When trying to run `Drush pm-update' in a site i get the error Command pm-update needs the following modules installed/enabled to run: update. [error] The drush command '...
8
votes
4answers
4k views

How to pass argument to php file using a drush command?

I've small php script in my public folder called sample.php. I run this file using drush command drush scr sample.php. I want to know how to pass argument to php file using drush command and how to ...
8
votes
2answers
4k views

How to install a specific version of a project with drush

I observed that by default "drush dl module_name" installs the latest version possible may it be dev version available. How can we install a specific version of a project with Drush?
8
votes
2answers
2k views

Can't update drupal core to 7.27

I'm tring to update using drush, with the command drush up, but core is not updating. it says on the drush output: Project drupal was updated successfully. Installed version is now 7.27. but it's ...
8
votes
2answers
2k views

Remove components from a feature using Drush

Using Features UI to manage a big feature components is a tedious task. Therefore in order to add a new component I use drush fe myfeature views_view:myview1 Now how I remove the uneeded component ...
8
votes
2answers
2k views

Updating modules with drush without breaking SVN?

Right, this has been breaking me for two days. I can't get an answer anywhere! I have drush 4.4 on my server. I am using SVN via Unfuddle.com. I have a site, I want to update a lot of modules. I want ...
8
votes
2answers
2k views

Drush command to check if Drupal is installed?

Is there any way to use Drush to determine if Drupal is installed, and have it return true or false? The boolean output would be used elsewhere in a bash script's logic. Bonus: it needs to work for ...
8
votes
1answer
209 views

How to translate plural strings with Drush?

If we want to translate a plural string in Drupal we can use the format_plural() function. If you are programming drush commands you can use the dt() function to translate strings, but if you want to ...
8
votes
1answer
1k views

Use drush make to load only modules?

I have a dev site with many modules. I have another dev site on a different server that I'd like to populate with the same modules. I can zip 'em up and move the file, or use rsync, but I wanted to ...