Re: How to upgrade old MW Postgres DB backup into much newer MW version?

Jeffrey Walton <[email protected]>
Newsgroups gmane.org.wikimedia.mediawiki
Message-ID <CAH8yC8mHfzZzVBhV22+YOtiuCyyf1O_yx2g+fyJDUOsQhLVOng@mail.gmail.com>
On Tue, Jan 10, 2023 at 11:50 AM MI <[email protected]> wrote:
>
> We had Mediawiki with PostgreSQL on a Debian 8 server. That machine is
> no longer accessible, but there is a backup of the database.
>
> The old versions were:
> - Postgres v. 9.4
> - Mediawiki v. 1.25 or 1.27 ?
>
> Now we installed Mediawiki and PostgreSQL on a new Debian 11 server. But
> the database schema seems to be quite different so it will not be
> possible to import the backup directly.
>
> Our current versions on Debian 11 are from the "stable" ("bullseye") apt
> repository:
> - Mediawiki  v. 1.35.8
> - Postgresql v. 13.9
>
> Is there a collection of database upgrade scripts somewhere, which I
> could use to upgrade, step by step, our backup DB to the current schema?
> (The import of the SQL backup into Postgres v. 13 works fine. But then
> the schema needs to be adapted to what MW expects)

My non-official answer...

Restore the backup into a VM for testing. Download MW 1.38 and unpack. Then run:

   # Update Mediawiki components
   php -d extension=phar.so composer.phar update --no-dev
   # Update the database
   php /var/www/html/w/maintenance/update.php --quick

If the update script succeeds, then you should be Ok in real life.

If the update fails, then you may need to try incrementally. Proceed
in sequence: 1.27 to 1.28, 1.28 to 1.29, ..., 1.34 to 1.35.

Related to the upgrade process, the steps we perform for our webserver
is located at https://github.com/weidai11/website/blob/master/mediawiki/wiki-upgrade.txt
. We try to follow Mediawiki releases, so we proceeded in sequence
over years of time.

Jeff
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.