Tech:Removing an extension
If a decision has been made to remove an extension from Miraheze for whatever reason (i.e., it's unmaintained, it isn't compatible with the current version of MediaWiki, etc.) the following procedure should be followed when removing an extension. Any user can create a pull request to remove an extension, but it has to be merged and deployed by a system administrator.
The steps below must be done in this order:
- Generate a list of all wikis using the extension with
/srv/mediawiki/w/extensions/MirahezeMagic/maintenance/generateExtensionDatabaseList.php --wiki=loginwiki --extension=extension
. This will create a JSON list in your home directory called/home/<you>/extension.json
- Run
sudo -u www-data /usr/local/bin/foreachwikiindblist /home/<you>/extension.json /srv/mediawiki/w/extensions/ManageWiki/maintenance/toggleExtension.php --disable extension
- Remove any settings configured using
sudo -u www-data /usr/local/bin/foreachwikiindblist /srv/mediawiki/cache/databases.json /srv/mediawiki/w/extensions/ManageWiki/maintenance/populateWikiSettings.php --wgsetting=wgSettingName --sourcelist=false --remove
- Remove any existing configuration from ManageWikiExtensions.php, LocalSettings.php, and GlobalSettings.php. (Note: If the extension has extra settings in ManageWikiSettings.php, make sure to remove that too)
- Remove the submodule from the MediaWiki repository after the settings above have been successfully removed.
On mwtask141 and test131:
- run
sudo -u www-data rm -rf /srv/mediawiki-staging/w/{submodule_path}
- run
deploy-mediawiki --world --config --l10n --extension-list --servers=all
Globally disabling extensions[edit | edit source]
If it is not appropriate to fully remove an extension, but the extension should not be active on any wikis (e.g., in the event of a security vulnerability with a particular extension), it can be globally disabled without disrupting any related configuration that users have set in ManageWiki by adding the extension to the $disabledExtensions
array found at the bottom of LocalSettings.php.