Skip directly to content

How to update from drush 3.3 to 4.5 dev on Pantheon

Kelly Bell's picture
on Thu, 05/12/2011 - 1:55am

1. login to your Pantheon site via SSH 

2. cd /opt 

3. sudo tar czfv old-drush.tar.gz drush (save your old drush just in case) 

4. sudo rm -rf drush 

5. sudo git clone --branch 7.x-4.x

4. sudo chmod 777 /opt/drush/includes 


6. copy Table.php to /opt/drush/includes via SFTP

7. rename Table.php as 

7a. an alternate - and probably better - method is to git clone your "new" drush to your local, perform steps 5-7 on your local, and then commit/push the file to Pantheon

8. cd /var/www/[site-name]/dev 

9. drush status 

You should see a normal drush status output, with the drush version number listed as 4.5 dev. If this is not true (it's still at 3.3), repeat steps 1-9. 

Next, you should copy the aliases folder from your tarred old-drush folder back into your new drush. If you don't do this, all the Pantheon-internal scripts will stop working (import, reset, backups, etc) so this is a very important step.

[user]@[site-name]:~$ cd /opt/drush

[user]@[site-name]:/opt/drush$ sudo mkdir aliases
[sudo] password for [username]: [enter password] 

[user]@[site-name]:/opt/drush$ sudo chmod 777 aliases


At this point you can either untar the old drush folder and copy the files from there to the aliases folder inside drush, or you can download and untar the files on your local machine, do a git pull from your Panetheon slice drush repo (as mentioned above), copy the alias files into the new drush/aliases folder and then perform a commit/push to your remote Pantheon /opt/drush repo. The latter is recommended, bot both work.