The joys of updating a webapp

Submitted by gwolf on Fri, 05/31/2013 - 13:23

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...

AttachmentSize
drupal_updating.png39.5 KB
drupal_updating_failed.png64.72 KB
( categories: )
rpetre's picture

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's picture

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

Marco Villegas's picture

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

gwolf's picture

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 :(

Delores Rodriguez's picture

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.

Post new comment

The content of this field is kept private and will not be shown publicly. If you have a Gravatar account associated with the e-mail address you provide, it will be used to display your avatar.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <br> <b> <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <blockquote> <img> <h1> <h2> <h3> <tt> <pre> <strike> <table> <tr> <th> <td>
  • Lines and paragraphs break automatically.
  • Use <bib>citekey</bib> or [bib]citekey[/bib] to insert automatically numbered references.
  • Use [fn]...[/fn] (or <fn>...</fn>) to insert automatically numbered footnotes.
  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>. The supported tag styles are: <foo>, [foo].

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Keep in mind that all comments will also have to be administrator-moderated. Don't waste your time writing a spam that no one will read.
8
P
F
N
6
e
Enter the code without spaces and pay attention to upper/lower case.