Media Wiki Restoration: Difference between revisions
Line 9: | Line 9: | ||
=Overview= | =Overview= | ||
This procedure documents restoration of a Media Wiki site instance backed up with the tooling described in [[Media_Wiki_Backup_Automation#Overview|Media Wiki Backup Automation]]. Restoration implies performing a new full installation of the latest LTS version as a prerequisite, as described here [[Media Wiki Installation#Overview|Media Wiki Installation]] followed by state restoration by executing the restoration script <code>mediawiki-restore</code>. | This procedure documents restoration of a Media Wiki site instance backed up with the tooling described in [[Media_Wiki_Backup_Automation#Overview|Media Wiki Backup Automation]]. Restoration implies performing a new full installation of the latest LTS version as a prerequisite, as described here [[Media Wiki Installation#Overview|Media Wiki Installation]] followed by state restoration by executing the restoration script <code>mediawiki-restore</code>. The state restoration procedure is described by this article. | ||
=Pull the Backup File from Storage= | =Pull the Backup File from Storage= |
Revision as of 18:53, 1 January 2024
External
- https://www.mediawiki.org/wiki/Manual:Restoring_a_wiki_from_backup
- https://www.mediawiki.org/wiki/Manual:Upgrading
- https://gerrit.wikimedia.org/g/mediawiki/core/+/REL1_35/UPGRADE
- https://www.mediawiki.org/wiki/Manual:Moving_a_wiki
Internal
Overview
This procedure documents restoration of a Media Wiki site instance backed up with the tooling described in Media Wiki Backup Automation. Restoration implies performing a new full installation of the latest LTS version as a prerequisite, as described here Media Wiki Installation followed by state restoration by executing the restoration script mediawiki-restore
. The state restoration procedure is described by this article.
Pull the Backup File from Storage
The backup file is named similar to 2023.12.30-03.00.01-not500-kb.novaordis.com-backup.tgz
.
Check Preconditions
At this point, the new Media Wiki installation procedure should have created a temporary database and database user, defined here: Media Wiki Installation | Instance Restoration. At the end of the restoration, both the temporary database and the database users will be deleted. Verify that they are indeed created, and they are the only Media Wiki database and database user:
SHOW DATABASES;
SELECT user FROM mysql.user;
Restore the Database
Use the restoration script to create the database and the database user being restored, then restore the database.
backup-system/mediawiki-restore -v \
/Users/ovidiu/tmp/2023.12.29-03.00.01-not500-kb.novaordis.com-backup.tgz \
/opt/brew/var/www/mediawiki-1.39.6 -d /Users/ovidiu/tmp/post-install
Modify the script to be able to stop after restoring the database.
At this point, the MariaDB instance must contain both the temporary and the production database and database users.
SHOW DATABASES;
SELECT user FROM mysql.user;
Collect the production database user, password and database name from the script output.
Update /opt/brew/var/www/mediawiki-1.39.6/LocalSettings.php
with those values:
$wgDBname = "novaordis_wiki";
$wgDBuser = "novaordis_wiki";
$wgDBpassword = "...";
Update the Database
php maintenance/update.php
MediaWiki 1.35.14 Updater Your composer.lock file is up to date with current dependencies! Going to run database updates for novaordis_wiki Depending on the size of your database this may take a while! Abort with control-c in the next five seconds (skip this countdown with --quick) ... 0 ...have ipb_id field in ipblocks table.1 ... el_id 10010 - 10402 of 10402 Done, 24 rows updated, 8 deleted. Purging caches...done. Done in 2 min 25 s.
Temporary Database Cleanup
Drop the temporary database and user:
DROP DATABASE tmp_mediawiki_db;
DROP USER 'tmp_mediawiki_user'@'localhost';
COMMIT;