Questions tagged [drush]
Use it for questions about the command line shell and Unix scripting interface for Drupal (a.k.a. Drush).
1,823
questions
83
votes
10answers
55k views
How can I change a user's password?
How can I change a user's password from the command line using Drush?
80
votes
5answers
37k views
52
votes
3answers
33k views
How to upgrade only core with drush?
There's a huge security leak in <7.32. So I want to upgrade all my Drupal sites asap without too much worrying about breaking stuff.
But...
$ drush dl drupal-7.32
It's forbidden to download ...
47
votes
5answers
88k views
Drush command to download AND enable a module
To download and install a module, I run:
drush dl module_name
drush en module_name -y
I put that in a Bash script function, and just call "drin module_name" to simplify.
function drin(){
drush dl ...
41
votes
1answer
997 views
I need to bring a site to version control, and set up the continuous Integration environment
I am an entrepreneur with a Drupal 6x project that started small enough to not need version control (per developers), but now I am convinced there is no way without it. There's extensive documentation ...
34
votes
2answers
24k views
How to switch from recommended release of module to dev release?
For example, I'm currently using the Geofield module.
I'm using version:
7.x-1.0-beta2 (2011-Nov-17)
Now I see the development version has some functionality that I want. How do I correctly and ...
34
votes
6answers
42k views
How to check Drush version?
How can I identify what version of Drush is installed on a given system?
34
votes
2answers
22k views
Drush command to show aliases?
Is there a drush command to show existing aliases? Some Googling didn't turn up anything.
33
votes
3answers
35k views
Is there a way to manually run cron with Drush?
I want to be able to accomplish this:
http://mywebsite.com/admin/reports/status/run-cron
But it should be done through the Drush interface.
Can any one help me out ?
33
votes
7answers
10k views
How do I prevent Drupal raising a segmentation fault when using a Node.js theming workflow?
Symptoms:
Some drush commands fail; Some Drupal pages are blank.
The failing drush commands report "Segmentation fault: 11"
The Apache log (e.g. php-error.log in MAMP) also shows the same error.
...
30
votes
2answers
5k views
How are drush and jenkins used together for continuous integration?
I hear the buzz words, "continuous integration", "drush" and "jenkins" often. Thus, sparking my interest.
How are drush and jenkins used together for continuous integration?
Also, why would you ...
30
votes
4answers
4k views
Memory-saving cache-clearing strategies for large sites?
One of my Drupal 7 sites has thousands of fields, a bunch of content types, more than 25 views, and hundreds (soon to be thousands) of profile types. Because of this, I'm using a core patch that ...
28
votes
7answers
37k views
How to execute php script using drush?
I am new to Drush. How can I execute this script to remove comments of a specific user?
$uid = xx // the spam users id;
$query = db_query("SELECT cid FROM {comments} WHERE uid = %d", $uid);
while($...
28
votes
4answers
9k views
Adding components to a feature via Drush
I understand using 'drush fu' to look for changes to any components of an existing feature, but is there a way to add a component to an existing feature using drush? Right now I have to use the /admin ...
28
votes
7answers
21k views
drush updatedb for a single module
Is it possible to perform a single module's update function via drush? I can see drush updatedb which does not take an modulename as argument and runs all available updates. Then there is drush pm-...
25
votes
2answers
13k views
Downloading core via command-line
I usually download the latest Drupal 7 using drush dl drupal --select, but but Drupal 8 doesn't get listed.
What are some nice and quick ways of download the latest version of Drupal 8, even though ...
24
votes
2answers
12k views
Determine whether module is enabled / disabled
I am trying to write a Drush script to enable a bunch of modules based on a hook. If it's already enabled, I would rather skip enabling that module.
Is there a way for Drush to return whether or not ...
24
votes
3answers
5k views
Is it possible to download sandbox projects with Drush?
Normally, one can download a module from drupal.org like this:
drush dl views
However, this doesn't work for sandbox projects. Is there an easy way to download them or I am stuck with git clone?
24
votes
4answers
3k views
Are Drush and Phing redundant?
I've installed JenkinsCI on our dev server to start automating our dev build and test process. I'm using Jenkins with the Git Plugin and some Drush commands via a shell script.
When researching how ...
23
votes
1answer
55k views
How to disable a module and its dependents modules with Drush?
Is there any way to disable a module and its dependents modules with Drush.
Let's say I need to disable views but I have enable views_accordion as well.
If I run $ drush pm-disable views I don't get ...
21
votes
12answers
38k views
I've got `PDOException: SQLSTATE[HY000] [2002] No such file or directory` when using drush [closed]
I installed Drush for the first time (so it may be a configuration error) and I'm trying to update to the latest core version of Drupal.
Drush is giving me this error - I'm on an OSX box.
dev5:...
21
votes
3answers
12k views
Import a single yml configuration file
Is it possible to import one single yml configuration file by specifying its path?
Or a group of yml files contained in a specific module?
21
votes
5answers
10k views
Why would some features still show Overridden after a revert all --force?
Why would some features still show as "Overridden" even after running a full features revert with the force switch? Below are the commands I am running, for the sake of clarity.
drush fr-all --force -...
21
votes
4answers
4k views
Create a repeatable Drupal install?
When installing Drupal for different sites I find myself frequently installing the same modules over and over again. In the interest of DRY, how can I create a kind of custom site "template" which ...
20
votes
2answers
8k views
How can I tell Drush in which folder should a module be copied?
Is there a way to make Drush download modules into a specified folder besides sites/all/modules (e.g. sites/all/contrib, sites/all/core)?
If this makes a difference, I am using Drush 4.4.
20
votes
5answers
9k views
Is there a way to get Drush to download all required dependancies for a specific module?
For example if you perform the following commands:
drush dl views
drush en views views_ui views_export
You will get the the following error when trying to enable the views modules:
Module views ...
20
votes
3answers
19k views
Updating to a newer dev version of a module using Drush (ignoring point/recommended releases, without trashing version control)
[NB This question is off the back of, but separate/further to, an earlier question of mine, here.]
I've been using Drush a good while, but every so often I get stumped. At the moment, I'm really not ...
19
votes
6answers
10k views
Is there a drush script to disable all caches?
I mean all of the caching options under admin/settings/performance. I frequently use drush sql-sync to keep my development copy up-to-date with the server. However, the server must have all of the ...
19
votes
5answers
928 views
Manage custom modules across multiple installations
We have some custom modules which are used for multiple sites. Those can't be released as contributed modules, for example because they are client specific, make assumptions that don't work for ...
16
votes
10answers
9k views
Where does PEAR install Drush? [closed]
I installed Drush using the PEAR option mentioned on the Drush project page, but I can't find the location of where it was installed.
Does anybody know the default installation location?
...
16
votes
5answers
13k views
Import po-files using Drush
I have about 20 sites that have a common translation. I don't want to go into admin of each site each time the po-file is updated.
Is it possible to import a po-file using Drush?
16
votes
1answer
3k views
How to effectively manage a site with Drush make?
What things are important to consider when managing a site using Drush make?
16
votes
5answers
30k views
Drush needs a higher bootstrap level to run
Do you have any idea on what might be causing this error when I execute:
drush si geoslate --db-url='mysql://root:root@localhost/geoslate' --site-name=Geoslate
Command site-install needs a higher ...
15
votes
3answers
8k views
How to list all available entity types?
How to list all available entity types in Drupal using drush?
Related:
How to get list of all node types?
15
votes
3answers
7k views
Use drush to download drupal core files directly into directory rather than subdirectory
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 ...
15
votes
1answer
3k views
Where is archive-dump for Drush 9?
I have drush 9 installed (current dev release). I can't find the archive-dump command, despite the docs suggesting it should be there.
Executing it produces:
The Drush command 'archive-dump' could ...
14
votes
14answers
16k views
Can I delete nodes of a given content type with Drush?
Just wondering if Drush is capable of deleting nodes of a given content type.
Something like: $ drush delete-node --type=MyContentType
If not possible, can I create a method like that?
14
votes
3answers
8k views
What is the command that replaces 'drush variable-set'?
In Drupal 8 the Drush command drush variable-set no longer works.
From reading (here) it appears that Drupal 8 has a new "configuration" system that replaces the old (Drupal <=7) "variables". But ...
14
votes
2answers
7k views
What is the purpose of drush entity-updates?
After updating Drupal 8 modules, I have been warned on the Drupal 8 status page that:
Entity/field definitions: The following changes were detected in the
entity type and field definitions.
...
14
votes
5answers
6k views
What is the correct composer based core update workflow?
I want to use composer to manage Drupal 8 dependencies, but I'm not sure what is the right core update workflow.
At the moment I'm using drush to update core to latest beta release, but I also have ...
14
votes
1answer
13k views
Why does drush say “command not found” when I try to execute remote commands? [closed]
When I use a drush command to do something on a remote machine, I get the following message:
bash: drush: command not found
What's the problem?
13
votes
2answers
31k views
How to uninstall drush via composer?
There is method of installing drush via composer:
composer global require drush/drush:dev-master
But how to uninstall it using composer?
13
votes
6answers
7k views
Does drush up do a database backup/dump?
Does running drush up run a database backup? From testing, it looks like it doesn't. Should I be doing a separate database backup before I run drush up to update?
13
votes
3answers
8k views
How to replace “default” with website domain name during drush user-login
When I run drush user-login username, drush prints a url like http://default/user/reset/1/32323933.... How do I replace default with the actual website name?
13
votes
3answers
7k views
What complications are there if I switch Mysql to MariaDB? Any Drush issues?
I have a heavy Mysql drupal 7 site and I was thinking about switching Mysql over to Mariadb, but I wasn't sure what issues I would run into. From what I'm reading Mariadb seems to be just a drop in ...
12
votes
4answers
3k views
How can I get a list of content types with drush?
How can I get the existing content type list with drush? This will allow me to quickly produce a list.
I've tried with:
$ drush @d6 @sites genc --types
But I need the devel_generates module ...
12
votes
7answers
5k views
Drush does not acknowledge release of new core update
I am trying to update my drupal 7.31 core to 7.32 via Drush.
I ran the following commands
$ drush pm-releases
Project Release Date Status
drupal 7.x-dev ...
12
votes
4answers
10k views
Linux Drush install error: Undefined class constant 'MYSQL_ATTR_SSL_CA' in phar:///usr/local/bin/drush/lib/Drush/Sql/Sqlmysql.php, line 56
I tried installing Drush with both methods listed in the drush.org documentation. I think they might be conflicting with each other if that's possible.
When I run composer global require drush/drush ...
12
votes
4answers
15k views
Running Drush returns an error
I am running Drush version 6.2.0 and the latest Drupal 8 beta on Dreamhosters. When I run drush cc all within the sites directory, I receive the following error immediately after executing the command:...
12
votes
1answer
10k views
Where are logs created by drush_log() stored?
I have installed Devel module to use xhprof. In devel settings, I have enabled xhprof, but when I load a page, can't see a link to xhprof. I read the source and found this:
drush_log('xhprof link: ' ....