I have a MediaWiki 1.32.0 website which I want to upgrade, hosted on a CentOS "Shared Server" environment.
It is an all-core website with no added extensions, skins and images (besides logo)
To upgrade I need to change generally all files in the website's directory to those inside a directory of a newer version's MediaWiki installment (available inside a tartball) by a general overriding operation.
To download a latest MediaWiki tarball containing such directory (as of 13/08/19) one could execute:
wget https://releases.wikimedia.org/mediawiki/1.33/mediawiki-1.33.0.tar.gz
In my existing website directory, there are these files I already edited and shouldn't override:
LocalSettings.php
robots.txt
.htaccess
example.com.png
(logo image)googlec69e044fede13fdc.html
(Google search console verification file)
How could I download, and extract all files from directory in tarball to override a my current MediaWiki directory to override all files besides listed exceptions (such as the files listed above)?
I do plan to backup the old directory before changes manually as priming part of the script; adding a condition to continue only of the backup was done might be a nice idea; all of this, aside from having automatic daily backups).
Best Answer
Extracting the tarball you have in your question will create the directory
mediawiki-1.33.0
which contains the following sub-directories:Assuming these are also the directories you need in a proper mediawiki installation, all you need to do is:
Backup the files you want to keep, using
-p
to keep the permissions, ownership and timestamps unchanged.Extract the tarball
Copy the files to wherever they should be
This will overwrite any existing files.
Copy the backups back to their original locations