I'm a rank Drush beginner, and I'm no Drupal power-user for that matter.

Usually, when I update a module, I go through a procedure vaguely like this:
* make sure db is backed up
* put site in maint mode
* disable the module
* remove the old module's directory in /sites/all/modules/
* put in the new module's directory in /sites/all/modules/
* re-enable the module
* run update.php
* take site out of maint mode

I just downloaded Drush 2.0, and I had a notice that my CCK module needed to be updated from 6x.2.3 to 6x.2.4.

With Drush, all I did (after making sure I had a current backup) was:
>drush dl cck
>drush update

And it looks like everything is fine! Is it really that easy? Was it not necessary to put the site in maint mode? And what did drush do with my old CCK directory?

Thanks for the info. -Steve

Comments

kscheirer’s picture

that sounds about right. Drush overwrote the old cck module with the new files, in the same directory. If you like, Drush can be configured to backup your old module first, moving it to a backups/ directory.

you can start right off with drush update, it will figure out that (for examlple) cck needs to be updated, and then prompt you for permission to do so.

steve02476’s picture

Wow, that's too cool!

So as long as I start out with a backup of my db and sites folder before doing drush update this means I don't have to worry about all the downloading and disabling and moving directories in and out and re-enabling and running update.php?

It seems like there have to be some gotchas somewhere?

moshe weitzman’s picture

Status: Active » Fixed

drush does code backup for you. see the /backup dir. it can alternatively integrate with your svn if desired ... use `drush sql dump` beforehand and you are good to go. no gotchas.

steve02476’s picture

OK - true newbie warning here!

if you do drush sql dump the entire contents of the database just gets puked onto the console while you watch until you finally get brave enough to hit control-c . (I hope that was the right thing to do.)

I'm sure the right thing to do is to use a > to send the output to a file instead...

But, at any rate, I already have the backupmigrate module to do sql backups for me, and I'm just in heaven about Drush.

Thanks to the people who put together and maintain Drush!

chrowe’s picture

The command I use is:
drush sql dump > /path/to/BACKUPS/site_name-$(date +%Y-%m-%d-%H.%M.%S).sql

This dump database with time stamp

Chris

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

OldAccount’s picture

How do you configure Drush to backup the modules automatically? So far with my default install I don't see any backups directory.

boabjohn’s picture

Sorry; have been through a fair bit of the documentation, but a couple of more obvious points elude me:

1. I separate contrib modules from custom > sites/all/modules/contriband sites/all/modules/custom

When I run drush dl date, it pops the date module into the modules/. directory

How was I supposed to specify my desired path?

2. Likewise (probably related) when I ask drush for a status, it is giving me only details on the core.

3. Running drush update seems like it will update core as well as modules. Is there a way to ask for just the modules and leave core for later?

Thanks.

boabjohn’s picture

Status: Closed (fixed) » Active
boabjohn’s picture

Apologies to the wizards: I'm still fumbling around here with the basic configs.

Can anyone advise the solution in (1) of #8 above? I *really* want to have Drush respect my directory structure. I looked through the *.inc files, and the drush.php, but haven't found a solution yet. I'm sure this is a simple matter: if someone gives me a pointer I'll happily add a bit of write-up to the documentation!

>>Okay: watching a very helpful screencast, I see the switch needed is --destination=(path)

So, the more specific query now is: can I pop this parameter into something in my drush installation so that I don't have to type it every time?

Thanks,

JB

flickerfly’s picture

to #5

You could easily setup a cron job that would run the command below at a frequency of your choice.

~/bin/drush sql dump > ~/backups/site_name-$(date +%Y-%m-%d-%H.%M.%S).sql

Alternately, you could use the backup_migrate module.

greg.1.anderson’s picture

Status: Active » Closed (duplicate)

#8 was fixed in #652318: Look for contrib directory in modules and themes. I don't think there are any other issues here.

artol’s picture

Version: All-Versions-2.0 » All-Versions-2.1
Component: Documentation » Miscellaneous
Status: Closed (duplicate) » Active

Is it possible to run drush so, that it updates all modules, but does not update themes? I have made changes to theme on one site. I am quite new with drush, so sorry, if this is 'well known answer'. Thank you for any information, Arto

moshe weitzman’s picture

Status: Active » Closed (duplicate)

there are many theme related issues out there. please talk in one of them. update command has known problem in the area you describe.

StephenRobinson’s picture

It is easier to just browse to the folder where the module is installed and not provide any directory information...

jwmci’s picture

On which system do I install drush — my computer or the host? If I install it on my system, how do I point it to the host system?

flickerfly’s picture

@jwmci:
You'd install drush on the server. It will do edits to both the code and the database (running db updates). The assumption is that you have ssh access to your server and, as a result, have command-line access.

In the future, it is appropriate to start a new question as a new issue, especially since this one is already closed. Being closed means it isn't likely to catch much attention so it is somewhat fortunate that I happened through. This way each issue can keep a single thread of discussion providing greater organization for those looking for information in the future. The forums and irc are also appropriate places to ask support related questions. IRC is especially likely to get you faster responses.

AlxVallejo’s picture

This doesn't make sense. A drush up command updates all modules as well as the database. AFAIK, you can't update an individual module on the command line.

GuyRus’s picture

You can update a module from the command line:
2 ways:

drush pm-update modulename
drush dl modulename && drush updb

I personally prefer the second as it's far far quicker (pm-update checks all avail updates each time it's run).

For Multisite installation:
drush @sites pm-update modulename
drush dl modulename && drush @sites updb

As a side-note, you must have Update installed (it's a core module) and depending on server config run Drush as a sudo user.

ajuris’s picture

Issue summary: View changes

What if I only wanted to update modules on the development subdomain, which is a copy of the production site?
I need to try this for testing purposes...I inherited a site that hasnt been updated in a while and the reason cited is that alot of custom modifications have been made and updating would crash the site or at least get rid of the 'custom' modifications.

helmo’s picture

Drush has moved to Github.

Please ask support questions on Drupal Answers.