5

Upgrading CiviCRM is a painful process (18 steps) :

Of course, I admit the necessity to previously backup, put the site offline, disable some Modules, ...

But deleting all previous civicrm code files is very long, and downloading then unpacking, then transfering the new code files is very time consuming. ... and we do this twice : one for test, and one for good.

So, why : - not to include l10n and sql inside the upgrade ? - not to upgrade CiviCRM just like any other Drupal Module, or, at least, reinstall CiviCRM like any Drupal Module (copy-paste the tar.gz URL) ?

7

I have been dealing with upgrades a lot lately, and I have the process "down" so that it is very fast. I am impressed with how fast I can do an upgrade. The key is shell access - or something that mimics it - because using sftp is very slow. That might be your problem. Once I have the data backed up it basically goes like this:

  • ssh into the server and tar/gz (archive) the existing civicrm directory. One command, 15 seconds or so.
  • upload the new version tar/gz. This of course will vary greatly by internet connection speed, but generally only a couple of minutes or less.
  • delete the existing directory. This is what's horrendously slow via most sftp programs I've used. They usually do a recursive delete on each individual file and directory, and since there's a ton of them in CiviCRM it takes forever. It takes 1 second in the shell.
  • Unarchive the new version. Usually less than a minute.
  • run the upgrade script.

Very, very fast.

If you aren't a command line person - I'm not, actually - there are some ways around it. Our systems all have Webmin installed as a helpful control panel, and it's Filemin file manager deletes directories as quickly as the shell commands do. I also regularly use Cyberduck for SFTP work, and it has a built in tar function, so I can archive/unarchive just as quickly as from the command line. So, even though I don't really use the command line I am getting the benefits.

I would add that if you are concerned about security the very LAST thing you would want to do is have excessive writable directories on your server, and most built in upgrade systems require these. Don't give in. You can reduce writable directories by not using those systems and save you many troubles down the road.

4

The documented upgrade process is long but has to cover every eventuality. I've got it down to 11 steps - 2 of which I don't normally do. I can do an upgrade in about 10-15 minutes, but this depends on my cPanel access which makes most steps very fast. Do you have cPanel access? Here are my 11 steps:

  1. Check extensions will work (don't do this if a minor update)
  2. Logon as Admin
  3. Backup the database (using phpmyadmin)
  4. Disable extensions (I don't normally do this, never been a problem)
  5. Clear Civi cache
  6. Delete templates.c folder (using cPanel file manager)
  7. Delete old code (ditto)
  8. Upload & unpack new code (ditto)
  9. Run upgrade code (/civicrm/upgrade?reset=1)
  10. Enable extensions (if disabled)
  11. Test
4

I find using Drush to upgrade CiviCRM is very quick. Here are some instructions: Is it easy to upgrade CiviCRM using drush?

3

Re: why not to upgrade CiviCRM just like any other Drupal Module

CiviCRM can be used with Wordpress or Joomla as well as Drupal, so it cannot rely on Drupal's update mechanism.

Re: deleting all previous civicrm code files is very long, and downloading then unpacking, then transfering the new code files is very time consuming.

This is certainly easier if you have shell access to the server.

Re: why : - not to include l10n and sql inside the upgrade ?

l10n is I think not included because many installations don't need it and it roughly doubles the size of the download.

Can you clarify what you mean by including sql?

  • Thank you for your quick answser : I had not seen this multiple CMS aspect. What do you mean by "shell access to the server" (I use Filezilla). Does it make any difference, once I have deleted all civicrm code files, if (1) I re-install CiviCRM like a "new" Drupal Module, or if (2) I unpack civicrm-4.7.6.tar.gz on my PC, and then copy its content to the server ? What if I do the same with civicrm-4.7.6-l10n.tar.gz ? (BTW, this file contains 2 folders : l10n and sql). – Jacques-Marie Moranne Apr 23 '16 at 13:33
  • 1
    Shell access is remote command line access to a server, so you can log in over ssh (secure shell) and run commands. This enables you to use a command-line tool such as wget or curl to download the tar files directly onto your server. You can then extract them into a temporary directory and then swap the new code for the old almost instantly. What did you have in mind by re-installing like a "new" Drupal module? – davejenx Apr 25 '16 at 9:24
  • thank you davejenx for your answser : About "new" Drupal Module : go to Modules in the Drupal Menu, then click "Install a new Module" : this opens a form which enables you to install your Module from an URL ending with ...tar.gz that you can directly pick from the Module page (drupal.org/project/...) : quick and easy ! – Jacques-Marie Moranne Apr 30 '16 at 8:38
1

Since the OP talks about 'doing this all twice' thought I would mention that using code repo eg git, can mean that the download of new codebase occurs only on dev instance, then git add/commit/push, and on live git pull, then run civi upgrade, via cli if you are happy with that, cvupdb, which isn't quite the same as 'doing this all twice'.

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.