The standard upgrade process for CiviCRM is quite a complex process according to the instructions in the wiki.

Is it easier to use drush to upgrade CiviCRM? If so, how do you do this? I couldn't find any up to date documentation on this, so if you are able to point me in the right direction that would be greatly appreciated.

Thanks for your help.


To answer my own question, it is possible to update CiviCRM with drush but this isn't completely straightforward either. For the benefit of others I post the steps I took below.

  1. put the site into maintenance mode: drush vset maintenance_mode 1
  2. clear all caches: drush cc all
  3. take a full backup of site and test that this works on a development server
  4. upgrade CiviCRM: drush cvup --tarfile=<path to tarfile> --backupdir=<path to backup dir>
  5. upload the latest version of the localisation files and extract to sites/all/modules/civicrm/l10n
  6. delete contents of sites/default/files/civicrm/templates_c/
  7. take the site out of maintenance mode:drush vset maintenance_mode 0
  8. clear all caches: drush cc all


  • I was upgrading from CiviCRM 4.6.6 to 4.6.7. If you are upgrading from an older version you may find that there are more steps.
  • The first time I tried to upgrade at step 4 this resulted in an error 'Your database has already been upgraded to CiviCRM 4.6.6' (note that I was trying to upgrade to 4.6.7). Repeating this step resulted in success. This bug appears to have been fixed.
  • It may be easier to manually delete and replace the civicrm folder as Laryn suggests.
  • I'm not sure if step 6 is really necessary.
  • 2
    Yeah, this looks more complicated than Laryn's approach (which I also use). i.e. use drush for the civicrm db update, but not for replacing the code. The drush civicrm db update is definitely worthwhile (before I used it, i'd often get breakage due to some smarty template, using means the db updates can get done without actually trying to generate any pages, which makes a lot of sense). – Alan Dixon Aug 31 '15 at 15:10

You can get a list of Civi-related Drush commands simply by typing drush on the command line. Excerpt:

All commands in civicrm: (civicrm)
civicrm-api (cvapi)         CLI access to CiviCRM APIs. It can return pretty-printor json formatted data.                                                                
civicrm-enable-debug        Enable CiviCRM Debugging.                                                                                                                    
civicrm-ext-disable (ced)   Disable a CiviCRM extension.                                                                                                                                                                                                                                                                           
civicrm-ext-install (cei)   Install a CiviCRM extension.                                                                                                                                                                                                                                                                            
civicrm-ext-list (cel)      List of CiviCRM extensions enabled.                                                                                                                                                                                                                                                                   
civicrm-ext-uninstall (ceui)Uninstall a CiviCRM extension.                                                                                                                                                                                                                                                                     
civicrm-install             Install a new instance of CiviCRM.                                                                                                                                                                                                                                                                    
civicrm-member-records      Run the CiviMember UpdateMembershipRecord cron (civicrm-member-records).                                                                                                                                                                                                                                 
civicrm-process-mail-queue  Process pending CiviMail mailing jobs.                                                                                                                                                                                                                                                                
civicrm-rest (cvr)          Rest interface for accessing CiviCRM APIs. It can return xml or json formatted data.                                                         
civicrm-restore             Restore CiviCRM codebase and database back from the specified backup directory.                                                              
civicrm-sql-cli (cvsqlc)    Open a SQL command-line interface using CiviCRM's credentials.                                                                                                                                                                                                                                      
civicrm-sql-conf            Print CiviCRM database connection details.                                                                                                   
civicrm-sql-connect         A string for connecting to the CiviCRM DB.                                                                                                   
civicrm-sql-dump            Exports the CiviCRM DB as SQL using mysqldump.                                                                                               
civicrm-sql-query           Execute a query against the CiviCRM database.                                                                                                
civicrm-update-cfg (cvupcfg)Update config_backend to correct config settings, especially when the CiviCRM site has been cloned / migrated.                                                                                                                                                                                           
civicrm-upgrade (cvup)      Replace CiviCRM codebase with new specified tarfile and upgrade database by executing the CiviCRM upgrade process - civicrm/upgrade?reset=1.                                                                                                                                                          
civicrm-upgrade-db (cvupdb) Execute the civicrm/upgrade?reset=1 process from the command line.                                                                           

Personally I usually download the tarfile manually, replace the civicrm directory in the modules folder (backing up as needed, e.g. drush civicrm-sql-dump > ~/filename.sql) and then use drush cvupdb to run the database upgrade.

Practice on a dev server first, though! :)

  • So if I understand it correctly, I would need to download the latest version of CiviCRM and then run this command drush civicrm-upgrade --tarfile=~/civicrm-4.6.7-drupal.tar.gz. Is that right? – William Mortada Aug 20 '15 at 16:45
  • 1
    Looks right to me, but as I said I usually use a variation with portions done manually. Post back if this works as you expected! – Laryn - CEDC.org Aug 20 '15 at 17:13
  • Yes, but it wasn't completely straightforward. I'll post a full answer with more detail. – William Mortada Aug 21 '15 at 11:58
  • 1
    Thanks, this should be the accepted answer, it is super easy and straightforward. – DrCord Feb 5 '16 at 3:35

another helpful thing that I do when using drush for civi upgrades: since drush does not give you any information about where in the process the upgrade is (the GUI has the progress bar that says what version it is at) I open another ssh session to the server and use drush civicrm-sql-cli to get into the sql console with the right database. Then as the upgrade runs in one terminal I repeatedly run the following query to follow the progress -- especially in upgrades that span multiple versions:

select version from civicrm_domain;

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.