How to upgrade mediawiki: Difference between revisions
(changed headings) |
(→The Upgrade Process: composer must be updated before running update.php, because update.php depends on file that came from Compower) |
||
Line 34: | Line 34: | ||
# Backup the database | # Backup the database | ||
# upgrade code | # upgrade code | ||
# update composer's dependencies | |||
# run maintenance/update.php | # run maintenance/update.php | ||
# resolve any changes to configuration variables. | # resolve any changes to configuration variables. | ||
Revision as of 10:31, 10 August 2019
Background
Our wiki installation is cloned from mediawiki's git repository. Mediawiki has branches for each release; we have branches that track mediawiki branches.
In general, the Masspirates mediawiki is the standard mediawiki distribution, plus a couple of commits (for changes to LocalSettings.php and such).
For example:
$ git status On branch mapp-1.28 Your branch is ahead of 'origin/REL1_28' by 2 commits. (use "git push" to publish your local commits)
$ git branch * mapp-1.28 master
Above, mapp-1.28 is based on mediawiki's REL1_28 branch, and there are a few changes on top. Upgrading follows one of two procedures:
- Pulling in changes from the same branch. In this case, just rebase
- Switching to a new branch. Here, we want to make a new (local) branch off the new upstream release, and cherry pick
That's the overview. I'll go into more detail below.
The Upgrade Process
With that said, the upgrade involves five steps.
- Backup the database
- upgrade code
- update composer's dependencies
- run maintenance/update.php
- resolve any changes to configuration variables.
We'll go through these steps one at a time
Database Backup
mysqldump --verbose -uUSER -pPASSWD --complete-insert=1 DBNAME | gzip -9 > masspira_mdw1.$(date +%F).sql.gz mv *.sql.gz backup
Update Code
Rebasing from the same branch
git status # should be no outstanding changes git remote update git rebase origin/REL1_28
Above, substitute "origin/REL1_28" with the actual upstream branch.
Having done this,
git log --oneline origin/REL1_28..HEAD
lists the local changes we've made.
Switching to a new Release branch
(to be written)
Running Maintainance Scripts
$ php maintenance/update.php
Update composer dependencies
$ ~/bin/composer update
Resolving Changes to Configuration Variables
For this step, look at the "UPGRADE" and "RELEASE-NOTES" files in mediawiki's root directory. It's a good idea to look through these files anyway, to see what changes are in the new release.