Search

Search this site:

The joys of updating a webapp

I like Drupal. It’s a very, very flexible CMS that evolved into a full-fledged Web development framework. Mind you, it’s written in PHP, and that makes it a nightmare to develop for (in ~6 years I have used it for all of my important websites I have only got around to develop a set of related modules for it once).

PHP programming sucks and makes my eyes and fingers bleed, but happily there are people who disagree with me — And they tend to write code. All the better!

Minor upgrades with Drupal are quite easy to handle. Not as easy as I’d like (i.e. whenever I upgrade the core system or a module, I have to log in as root^Wadmin^WUser #1 to ~15 different sites and run http://someurl/update.php — It very seldom causes any pain.

The updates that have to be run via this URL are usually on the database’s structures, so I understand they have to be started (and watched) by a human. And yes, I know I could do that with Drush, the Drupal shell, but it is not very friendly to Debian-packaged Drupal… But easy enoguh.

But major updates are a royal pain, and they usually amount to quite a bit. First, disable all of the modules and revert to a known-safe theme. Ok, it makes sense. Second, check whether the modules exist for the newer version (as they won’t work — Drupal changes enough between major versions that not only it’s API-incompatible, I’d classify it as API-unrecognizable). Ok, all set? Now for the live migration itself… It has to be triggered from the browser.

So yes, I am now staring at a window making clever AJAX status updates. I am sitting at 46 of 199, but following the lovely ways of programmers, it’s impossible to forsee whether update #47 will just be an UPDATE foo SET bar=0 WHERE bar IS NULL or a full-scale conversion between unspeakable serialized binary structures while rearranging the whole database structure.

And yes, while the meter progresses I stand in fear that update #n+1 will bomb giving me an ugly red error. I must keep the magic AJAX running, or the update might be botched.

And, of course, the update has sat at #69 all while I wrote the last two paragraphs. Sometimes the updates can progress after an interruption… And it seems I have no choice but to interrupt it.

/me crosses fingers…

[update] Wow… I am happy I got bored of looking at the meter and decided to write this blog post: After several minutes, and just as I was about to launch a second update session (130 updates to go), the meter advanced! I’m now sitting watching it at #75. Will it ever reach 199?

[update] And so it had to be… At around 115, I now got:

sigh The update process was aborted prematurely while running update #7000 in biblio.module…

Attachments

drupal_updating.png (39 KB)

drupal_updating_failed.png (65 KB)

Comments

Delores Rodriguez 2013-07-16 21:43:57

I suffer from it, then the

I suffer from it, then the server is under heavy load, it often generates “page not found” errors… Such as this one. But there no improvement.


gwolf 2013-06-20 08:57:06

Right, drush…

Well, Drush works for some installation styles. Not for mine – Which, I agree, is not the most favored or mainstream Drupal style.

Anyway, what happens (almost always) is that the Drupal core update works reliably, although is sometimes quite slow, even with not-so-big sites. However, start adding modules… And QA varies abysmally :(


Marco Villegas 2013-06-20 08:54:00

Drush

You can also use drush, i.e. drush updb[1], to run database updates if you have shell access.

And for many sites updates, maybe you would like to instead use aegir[2] to manage your sites, and it will become easier to do that.

1: http://drush.ws/#updatedb 2: http://www.aegirproject.org


rpetre 2013-06-01 05:59:57

self-writable code

You also forgot to mention how at some point it became acceptable for www-data to have write data to the code for updates. Updates that are made either by the admin who doesn’t want to be bothered by UNIX permissions or various anonymous contributors who want to add mail-relaying capabilities to your webapp or have different ideas about design.


toxickore 2013-06-02 07:18:07

Inmaduro

Podríamos decir que a pesar de todo. Drupal en su parte de migraciones aún no ha madurado. Es la sal y pimienta del TI

Categories