Mailing List Archive

How to upgrade old MW Postgres DB backup into much newer MW version?
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)

Thank you for any help,

MI
_______________________________________________
MediaWiki-l mailing list -- mediawiki-l@lists.wikimedia.org
To unsubscribe send an email to mediawiki-l-leave@lists.wikimedia.org
https://lists.wikimedia.org/postorius/lists/mediawiki-l.lists.wikimedia.org/
Re: How to upgrade old MW Postgres DB backup into much newer MW version? [ In reply to ]
On Tue, Jan 10, 2023 at 11:50 AM MI <mi.lists@alma.ch> 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
_______________________________________________
MediaWiki-l mailing list -- mediawiki-l@lists.wikimedia.org
To unsubscribe send an email to mediawiki-l-leave@lists.wikimedia.org
https://lists.wikimedia.org/postorius/lists/mediawiki-l.lists.wikimedia.org/
Re: How to upgrade old MW Postgres DB backup into much newer MW version? [ In reply to ]
I agree with Jeff's approach.


Small note on the versions:

On 2023-01-10 18:53, Jeffrey Walton wrote:
> 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.

Each long-term support release (https://www.mediawiki.org/wiki/LTS)
supports upgrading from the previous one. Occasionally they might even
have bug fixes for the upgrade process missing from non-LTS releases.
So you'd only need to go through 1.27, 1.31 and 1.35.



--
Bartosz Dziewo?ski
_______________________________________________
MediaWiki-l mailing list -- mediawiki-l@lists.wikimedia.org
To unsubscribe send an email to mediawiki-l-leave@lists.wikimedia.org
https://lists.wikimedia.org/postorius/lists/mediawiki-l.lists.wikimedia.org/