MediaWiki Upgrade

From Chorke Wiki
Revision as of 01:53, 2 April 2024 by Shahed (talk | contribs) (Created page with "<syntaxhighlight lang="sql"> sudo su cat << DDL | mysql CREATE USER 'shahed'@'localhost' IDENTIFIED VIA unix_socket; GRANT ALL PRIVILEGES ON *.* TO 'shahed'@'localhost' WITH GRANT OPTION; DDL exit </syntaxhighlight> ---- <syntaxhighlight lang="sql"> cat << DDL | mysql DROP DATABASE IF EXISTS chorke_orgwiki; CREATE DATABASE IF NOT EXISTS chorke_orgwiki; CREATE USER 'chorke_orgwiki'@'%' IDENTIFIED BY 'sadaqah!'; GRANT ALL PRIVILEGES ON chorke_orgwiki.* TO 'chorke_org...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
sudo su
cat << DDL | mysql
CREATE USER 'shahed'@'localhost' IDENTIFIED VIA unix_socket;
GRANT ALL PRIVILEGES ON *.* TO 'shahed'@'localhost' WITH GRANT OPTION;
DDL
exit

cat << DDL | mysql
DROP   DATABASE IF     EXISTS chorke_orgwiki;
CREATE DATABASE IF NOT EXISTS chorke_orgwiki;
CREATE USER 'chorke_orgwiki'@'%' IDENTIFIED BY 'sadaqah!';
GRANT ALL PRIVILEGES ON chorke_orgwiki.* TO 'chorke_orgwiki'@'%';
DDL

mysqldump -h 10.19.83.10 -u chorke_orgwiki -p chorke_orgwiki > wiki_202403152218_bkp.dump 
mysql     -h 10.19.83.10 -u chorke_orgwiki -p chorke_orgwiki < wiki_202403152218_bkp.dump

Download

wget https://releases.wikimedia.org/mediawiki/1.31/mediawiki-1.31.0.tar.gz
wget https://releases.wikimedia.org/mediawiki/1.35/mediawiki-1.35.0.tar.gz
wget https://releases.wikimedia.org/mediawiki/1.39/mediawiki-1.39.0.tar.gz
wget https://releases.wikimedia.org/mediawiki/1.41/mediawiki-1.41.0.tar.gz

Extract

mv weke weke_base_1.29
tar xvzf mediawiki-1.31.0.tar.gz && mv mediawiki-1.31.0 weke_base_1.31
tar xvzf mediawiki-1.35.0.tar.gz && mv mediawiki-1.35.0 weke_base_1.35
tar xvzf mediawiki-1.39.0.tar.gz && mv mediawiki-1.39.0 weke_base_1.39
tar xvzf mediawiki-1.41.0.tar.gz && mv mediawiki-1.41.0 weke_base_1.41

Config

lxc launch ubuntu:22.04 mediawiki
lxc exec mediawiki -- bash
add-apt-repository ppa:ondrej/php
apt update && apt list --upgradable
apt install -y apache2 mariadb-client-core-10.6

lxc file push ./wiki_202403152218_bkp.zip mediawiki/var/www/html/
lxc file pull mediawiki/var/www/html/wiki_202403292337_bkp.zip ./

Config » Base Version 1.29

apt install -y php5.6 php5.6-curl
apt install -y php5.6-mbstring php5.6-xml
apt install -y php5.6-mysql php5.6-pgsql

sudo a2dismod php* 
sudo a2enmod  php5.6
sudo systemctl restart apache2
sudo update-alternatives --config php

ln -s ./weke_base_1.29 weke
vim   ./weke/LocalSettings.php

Config » Base Version 1.31

apt install -y php7.1 php7.1-curl
apt install -y php7.1-mbstring php7.1-xml
apt install -y php7.1-mysql php7.1-pgsql

sudo a2dismod php* 
sudo a2enmod  php7.1
sudo systemctl restart apache2
sudo update-alternatives --config php

rm    ./weke
ln -s ./weke_base_1.31 weke
cp -r ./weke_base_1.29/images/* ./weke/images/
cp    ./weke_base_1.29/LocalSettings.php ./weke/
cp    ./weke_base_1.29/resources/assets/*.png ./weke/resources/assets/

vim ./weke/LocalSettings.php
(cd ./weke && maintenance/update.php)

Config » Base Version 1.35

apt install -y php7.4 php7.4-curl
apt install -y php7.4-mbstring php7.4-xml
apt install -y php7.4-mysql php7.4-pgsql php7.4-intl

sudo a2dismod php* 
sudo a2enmod  php7.4
sudo systemctl restart apache2
sudo update-alternatives --config php

rm    ./weke
ln -s ./weke_base_1.35 weke
cp -r ./weke_base_1.31/images/* ./weke/images/
cp    ./weke_base_1.31/LocalSettings.php ./weke/
cp    ./weke_base_1.31/resources/assets/*.png ./weke/resources/assets/

vim ./weke/LocalSettings.php
(cd ./weke && maintenance/update.php)

Config » Base Version 1.39

apt install -y php7.4 php7.4-curl
apt install -y php7.4-mbstring php7.4-xml
apt install -y php7.4-mysql php7.4-pgsql php7.4-intl

sudo a2dismod php* 
sudo a2enmod  php7.4
sudo systemctl restart apache2
sudo update-alternatives --config php

rm    ./weke
ln -s ./weke_base_1.39 weke
cp -r ./weke_base_1.35/images/* ./weke/images/
cp    ./weke_base_1.35/LocalSettings.php ./weke/
cp    ./weke_base_1.35/resources/assets/*.png ./weke/resources/assets/
cp -r ./weke_base_1.35/extensions/LocalisationUpdate/ ./weke/extensions/

vim ./weke/LocalSettings.php
(cd ./weke && maintenance/update.php)

Config » Base Version 1.41

apt install -y php8.3 php8.3-curl
apt install -y php8.3-mbstring php8.3-xml
apt install -y php8.3-mysql php8.3-pgsql php8.3-intl

sudo a2dismod php* 
sudo a2enmod  php8.3
sudo systemctl restart apache2
sudo update-alternatives --config php

rm    ./weke
ln -s ./weke_base_1.41 weke
cp -r ./weke_base_1.39/images/* ./weke/images/
cp    ./weke_base_1.39/LocalSettings.php ./weke/
cp    ./weke_base_1.39/resources/assets/*.png ./weke/resources/assets/

# cp -r ./weke_base_1.29/extensions/PDFEmbed ./weke/extensions/
cp -r ./weke_base_1.39/extensions/LocalisationUpdate/ ./weke/extensions/
# (cd   ./weke/extensions/;git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/DarkMode)

vim ./weke/LocalSettings.php
(cd ./weke && maintenance/run update.php)

References