Page MenuHomePhabricator

Split web-based upgrade from install
Closed, DeclinedPublic

Description

Having a single script config/index.php do upgrades as well as installs may have seemed like a good idea at the time, but:

  • It asks a whole lot of complicated questions and then ignores the answers
  • It requires the user to delete or move away their LocalSettings.php
  • Users who don't read the manual don't understand what they're meant to do, and try to run maintenance/update.php via PHPShell instead
  • The code is mostly split into upgrade and install cases anyway

I suggest splitting a config/upgrade.php off from config/index.php. This new script would provide a short and simple form, asking for database username and password only.

Instead of requiring the user to delete their configuration to gain access, a dedicated lock file could be used. This lock file would be created on a successful install or upgrade, and deleted by the user to re-enable the upgrader.

As for users who don't bother to read the manual: the database error page could link to config/upgrade.php. It could even check $wgVersion against a version number in the site_stats table, and display a welcome message!


Version: 1.16.x
Severity: enhancement

Details

Reference
bz13230

Related Objects

StatusSubtypeAssignedTask
DeclinedNone
ResolvedNone

Event Timeline

bzimport raised the priority of this task from to Lowest.Nov 21 2014, 10:06 PM
bzimport set Reference to bz13230.
bzimport added a subscriber: Unknown Object (MLST).

The only documented upgrade procedure I can find is the one mentioned in
http://www.mediawiki.org/wiki/Manual:Upgrading

It does say "The preferred method of performing the update is using the
command-line maintenance script, although it is also possible to
re-run the web-based installer." But maybe that's not true anymore.

Actually what I'm hoping for is a cleaner way to
http://www.mediawiki.org/wiki/Manual:Wiki_family#Adding_new_wikis
without needing to remove a production ../LocalSettings.php .

(In reply to comment #0)

I suggest splitting a config/upgrade.php off from config/index.php. This new
script would provide a short and simple form, asking for database username and
password only.

Resolving this WONTFIX. The core suggestion, to split upgrade/install scripts won't be done, although a lot of the ideas in this bug are a part of the new installer.

We no longer have to move LocalSettings, nor do we ask lots of extra questions in the upgrade case. For securing the web installer/updater, we use $wgUpgradeKey (which is random by default). Upgrade/Install classes are different codepaths, and only share a UI.

(In reply to comment #1)

The only documented upgrade procedure I can find is the one mentioned in
http://www.mediawiki.org/wiki/Manual:Upgrading

That is the correct document. It needs updating for 1.17, filed bug 27650 for this.

It does say "The preferred method of performing the update is using the
command-line maintenance script, although it is also possible to
re-run the web-based installer." But maybe that's not true anymore.

You can do upgrades via the command line (as always) or via the web (with 1.17 and above). Docs will be updated to reflect this.

Actually what I'm hoping for is a cleaner way to
http://www.mediawiki.org/wiki/Manual:Wiki_family#Adding_new_wikis
without needing to remove a production ../LocalSettings.php .

That has nothing to do with this bug.