20

[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 sure how to go about this.

Scenario: currently, the site uses a dev release, dated way in the past. In the meantime, no point release has been created, but a newer dev release has. So we have something like:

Reroute Email           6.x-1.x-dev (2010-Sep-27)
Recommended version:    6.x-1.0 (2008-Jul-24)   
Development version:    6.x-1.x-dev (2011-Feb-25) 

Doing drush dl <module>-6.x-1.x-dev overwrites the existing directory with the latest 1.x dev release. That's fine, but it trashes the .svn folder.

If I do drush upc <module>, it will download the point release (see edit below), which I don't want, but if I do drush upc <module>-6.x-1.x-dev, it just refreshes the update data and then tells me "Specified version already installed" on the relevant line on the output.

So how do I use drush to overwrite the old dev release, getting the new one in its place, without trashing the SVN folder?

EDIT: Actually, in this instance, drush upc <module> downloads the correct version, but I'm pretty sure if the point release was dated like 6.x-1.0 (2011-Jan-24) it would have gotten that one. Anyone want to clarify/correct?

3 Answers 3

9

I found your question just now because I had the exact same question. Didn't find an exact answer, but this worked for me:

#svn rm <module>  
#svn commit -m"removing the module... whatever you want to write"  
#drush dl <module>-6.x-2.x-dev  
#svn add <module>  

For some reason, not doing the commit between the rm and the dl caused a problem with svn. I do not know enough about svn to know why, but would be grateful if someone could elaborate!

1
  • Hi @rainbreaw, perhaps the answer to my other Q here might be of use?
    – NikLP
    Commented May 23, 2011 at 13:16
7

Try drush dl module-6.x-1.x-dev --svnsync.

1
  • This could become depreciated soon in drush as per GH #1056.
    – kenorb
    Commented Sep 30, 2015 at 8:54
2

There may be some install tasks that the new version of a module needs in order to work properly, for instance if the dev version has a different schema.

So before drush dl module-7.x.2.x take a look at the uninstall and install details in the module.

Beware if you have data that you don't want to lose in the db tables involved. Take a backup if you're worried or unsure.

If you need to, disable and uninstall the module before downloading and enabling the new module.

Use drush dis and then drush pm-uninstall

2
  • 1
    Uninstalling the module may possibly also discard all data it has saved to the database. Isn't the update.php script supposed to handle any schema changes from version to version? Commented Nov 23, 2013 at 21:29
  • That's a good point, I'll amend my answer
    – chim
    Commented Nov 25, 2013 at 16:32

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.