Media Wiki Restoration: Difference between revisions
Line 22: | Line 22: | ||
<font color=darkkhaki>Modify the script to be able to stop after restoring the database.</font> | <font color=darkkhaki>Modify the script to be able to stop after restoring the database.</font> | ||
At this point, the MariaDB instance must contain both the temporary and the production database and database users. | |||
<syntaxhighlight lang='sql'> | |||
SHOW DATABASES; | |||
SELECT user FROM mysql.user; | |||
</syntaxhighlight> | |||
Collect database user, password and database name. | Collect database user, password and database name. | ||
Line 32: | Line 39: | ||
$wgDBpassword = "..."; | $wgDBpassword = "..."; | ||
</syntaxhighlight> | </syntaxhighlight> | ||
=Upgrade the Database= | =Upgrade the Database= | ||
<syntaxhighlight lang='bash'> | <syntaxhighlight lang='bash'> |
Revision as of 20:28, 30 December 2023
Internal
Overview
This procedure documents restoration of a site instance backed up with the Media Wiki Backup procedure. Restoration implies performing a full new installation of the latest LTS version as a prerequisite, as described here Media Wiki Installation and then executing the database restoration script.
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 database user, password and database name.
Update /opt/brew/var/www/mediawiki-1.39.6/LocalSettings.php
:
$wgDBname = "novaordis_wiki";
$wgDBuser = "novaordis_wiki";
$wgDBpassword = "...";
Upgrade the Database
php maintenance/update.php
Post Restoration
Database Cleanup
Drop the temporary database and user:
DROP DATABASE tmp_mediawiki_db;
DROP USER 'tmp_mediawiki_user'@'localhost';
COMMIT;
TO DEPLETE
DEPLETE and INTEGRATE: Restoring a Wiki into the Same or Newer MediaWiki Version