Page MenuHomePhabricator

Installation does not work for MW 1.26+ due to removal of hitcounter table
Open, HighPublic

Description

This is copied from the talk page:

The hitcounter table has been removed completely between 1.25.3 and 1.26.0 of MediaWiki and so the statement in rename_table.sql fails and the HCUpdater.php script gives up.

Not a problem if you've already installed the HitCounters extension before upgrading to 1.26.0. We didn't though so now we can't install it. I'd suggest some error checking in HCUpdater.php and if the hitcounter table doesn't exist, create the hit_counter table from scratch. Otherwise as more users upgrade to the latest version of MW, fewer people will be able to install this extension. That's possibly the intention given the dubious utility of these counts but in that case, it's probably best to put a note in the installation intructions.

Event Timeline

Kghbln created this task.Dec 3 2015, 2:15 PM
Kghbln raised the priority of this task from to Needs Triage.
Kghbln updated the task description. (Show Details)
Kghbln added subscribers: Kghbln, MarkAHershberger.
Restricted Application added subscribers: StudiesWorld, Aklapper. · View Herald TranscriptDec 3 2015, 2:15 PM
Kghbln updated the task description. (Show Details)Dec 3 2015, 2:16 PM
Kghbln set Security to None.
Kghbln awarded a token.Dec 3 2015, 2:28 PM
Aklapper renamed this task from Installation does not work for MW 1.26+ to Installation does not work for MW 1.26+ due to removal of hitcounter table.Dec 3 2015, 3:56 PM
Krinkle added a subscriber: Krinkle.Dec 8 2015, 4:22 PM

This actually caused me to lose a wiki's data (almost, had a backup).

  • Wiki runs MediaWiki 1.23.
  • Wiki is upgraded to 1.26 tarball (using DirectAdmin/Installatron automation).
    • Here the final step in the web installer via mw-config ends up dropping hitcounters.
  • Admin discovers HitCounters extension is missing.
    • Installation fails.

Double whammy. Old data gone, and can't install fresh either.

Kghbln added a subscriber: Bawolff.Dec 8 2015, 5:12 PM

I guess this is connected to what @Bawolff meant with task T116891

saper triaged this task as High priority.Dec 11 2015, 10:51 AM

I guess this is connected to what @Bawolff meant with task T116891

Sort of i guess. I was meaning hit counter should not
delete

saper added a subscriber: saper.Dec 19 2015, 2:32 AM

I have published

https://gerrit.wikimedia.org/r/#/c/260173/

it should be now possible to migrate the tables even on 1.24, before 1.25 or 1.26 upgrade.

I have upgraded one wiki successfully with it, would appreciate more testing!

Hi, I just got whacked by this. We upgrade only from LTS to LTS (maybe this is a bad idea?). So I just went from 1.23 to 1.26. We didn't notice that the hit counts were missing for 1 month, with extensive edits in the mean time. It appears that the only way to recover our hit counts without losing our page edits is to extract the hit count tables from the pre-upgrade backup (I guess after upgrading that to 1.25?) and manually (scary) add them to the 1.26 database?

Taraathan added a comment.EditedFeb 3 2016, 11:28 PM

BTW, maybe it would be a good idea to add something to the release notes for 1.26 (https://www.mediawiki.org/wiki/Release_notes/1.26) about this. Although I read the release notes all the way back to 1.24 before upgrading, it was not apparent to me from "Removed hitcounters and associated code." in https://www.mediawiki.org/wiki/Release_notes/1.25 that this would result in loss of data. It isn't even labelled as a BREAKING CHANGE.

Nemo_bis added a subscriber: Nemo_bis.EditedNov 17 2016, 8:18 PM

Although I read the release notes all the way back to 1.24 before upgrading, it was not apparent to me from "Removed hitcounters and associated code." in https://www.mediawiki.org/wiki/Release_notes/1.25 that this would result in loss of data. It isn't even labelled as a BREAKING CHANGE.

Good point. I think there are no remedies to make MediaWiki 1.25+ releases usable other than time travel, but I've tried adding a couple notes:

Change 322495 had a related patch set uploaded (by Nemo bis):
Don't drop the hitcounter table (and related DB fields) during update

https://gerrit.wikimedia.org/r/322495

saper added a comment.Nov 20 2016, 9:45 PM
This comment was removed by saper.
Krinkle removed a subscriber: Krinkle.
tosfos added a subscriber: tosfos.Aug 11 2017, 10:52 PM

I think there are two separate bugs here, though they are related. The first is that data shouldn't be lost on MediaWiki update. The second is that the extension should work on fresh installs of MediaWiki 1.26+. Regarding that, I can confirm that the extension works on fresh installs of versions 1.28 and 1.29.

Prod added a subscriber: Prod.Feb 15 2018, 12:40 AM

Change 322495 abandoned by Thiemo Kreuz (WMDE):
[mediawiki/core@master] Don't drop the hitcounter table (and related DB fields) during update

Reason:
Duplicate of I9d8d188, which is merged.

https://gerrit.wikimedia.org/r/322495

Prod added a comment.Nov 24 2020, 5:36 AM

Change 322495 abandoned by Thiemo Kreuz (WMDE):
[mediawiki/core@master] Don't drop the hitcounter table (and related DB fields) during update

Reason:
Duplicate of I9d8d188, which is merged.

https://gerrit.wikimedia.org/r/322495

If this is a duplicate, can that change please be ported to all the other branches as well?

I think we are trying to ride a dead horse here - unfortunately.

I think we are trying to ride a dead horse here - unfortunately.

We'd need at least to make sure there is "official" documentation on how to perform the update non-destructively, as many wikis are still stuck on older versions.

Prod added a subscriber: thiemowmde.Dec 6 2020, 7:57 AM

Change 322495 abandoned by Thiemo Kreuz (WMDE):
[mediawiki/core@master] Don't drop the hitcounter table (and related DB fields) during update

Reason:
Duplicate of I9d8d188, which is merged.

https://gerrit.wikimedia.org/r/322495

The change ID referenced (I9d8d188): https://gerrit.wikimedia.org/r/c/mediawiki/core/+/203388
was only merged on the 1_25 branch, it never made it into the master branch. As there's discussion in T259771 to only support 2 LTS versions going forward, I'd appreciate if we could at least get this into the 1.35 branch to ease future upgrades, instead of having another step and going to 1.25 in the middle.