Why do you need an update script?
MediaWiki is the program behind many wikis. A wiki is a website that many people can edit. When you move to a new MediaWiki version, the new files may need changes in your database. A database is the filing cabinet that holds your wiki pages. The update script makes these changes. If you skip it, your wiki may show errors.
Warning: Take a backup of your wiki files and your database before you start. An update that goes wrong can break the wiki.
Before you start
- Back up the wiki folder and the database. Your hosting control panel has tools for this.
- Download the new MediaWiki package from the official website.
- Copy the new files over the old ones on your server. Keep your old
LocalSettings.phpfile and yourimagesfolder. They hold your settings and uploads.
Steps
- Open your browser.
- Go to your wiki folder address followed by
/mw-config/. For example:https://example.com/wiki/mw-config/ - The installer page shows that a wiki is already installed and offers an upgrade. Click upgrade the existing installation.
- The page asks for an upgrade key. Open
LocalSettings.phpin your file manager. - Find the line that begins with
$wgUpgradeKey. Copy the text inside the quote marks. - Paste it into the browser box and click Continue.
- Follow the screens. Click Continue each time. The script updates the database.
- When you see a message that the upgrade is complete, click the link to open your wiki.
If your file has no $wgUpgradeKey line, the page will tell you where to find or add one. You can also move the LocalSettings.php file away for a moment. Do this only if the page tells you to, and always keep a copy.
After the upgrade
- Open a few pages and make sure they load.
- Try logging in and editing a page.
- Delete or rename the
mw-configfolder if you want, so others cannot open it.
Quick recap
- The update script changes your database to fit a new MediaWiki version.
- Back up first.
- Open
/mw-config/in the browser and click to upgrade. - Enter the key from
$wgUpgradeKeyinLocalSettings.php. - Check your wiki when it finishes.