Upgrade MediaWiki 1.27 to 1.39 and avoid “There is currently no text in this page” error

After upgrading MediaWiki from 1.31 (or earlier) to 1.35 (or later), some pages may lose their content, with an error message There is currently no text in this page. If a user tried to edit, it will print another error message The revision #0 of the page named "……" does not exist.

This article provides an upgrade path from 1.27 to 1.39 and avoids the issue.

Symptom

After upgrading MediaWiki from 1.31 (or earlier) to 1.35 (or later), all pages are still listed in Special:AllPages. However, some pages end up with

There is currently no text in this page. You can search for this page title in other pages, search the related logs, or create this page.

If I tried to edit the page:

The revision #0 of the page named "......" does not exist.
This is usually caused by following an outdated history link to a page that has been deleted. Details can be found in the deletion log.

Trigger

Some page was imported in the past using XML import. As a result, the authors of those pages are not in the database. Those pages will break after upgrading to 1.35 (or 1.39)

Solution

This is the upgrade path I took. Tested on Ubuntu 20.04 after installing apache2 mysql-server php php-mysql libapache2-mod-php php-xml php-mbstring php-apcu php-intl imagemagick inkscape php-gd php-cli php-curl

  1. Update from 1.27.1 to 1.27.7
  2. Update from 1.27.7 to 1.31.16
  3. Run php maintenance/cleanupUsersWithNoId.php --prefix '*'
  4. Update from 1.31.16 to 1.35.9
  5. Update from 1.35.9 to 1.39.1

During each update:

  1. I update MediaWiki by extracting the tarball, and moving the images directory and LocalSettings.php to the new one. This ensures old code will not be left in the install path.
  2. Each MediaWiki may ship with different skins and extensions. Disable skins/extensions that are not available in the new version by editing LocalSettings.php
  3. Visit /mw-config or run php maintenance/update.php to update the database schema.

The sequence matter. I noticed that cleanupUsersWithNoId.php does not work after upgrading to 1.35

Leave a Reply

Your email address will not be published. Required fields are marked *