Migrate Mediawiki: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
| Line 1: | Line 1: | ||
ssh cc | |||
sudo su | sudo su | ||
| Line 71: | Line 73: | ||
Migrate the database | Migrate the database | ||
Following this: https://www.mediawiki.org/wiki/Manual:Restoring_a_wiki_from_backup | Following this: https://www.mediawiki.org/wiki/Manual:Restoring_a_wiki_from_backup and https://www.mediawiki.org/wiki/Manual:Upgrading (as we are upgrading from 1.39 to 1.45) | ||
Worked | Worked | ||
Revision as of 09:48, 16 January 2026
ssh cc
sudo su
apt install mariadb-server imagemagick
mysql
CREATE USER 'wiki'@'localhost' IDENTIFIED BY 'INSERTPASSWORDHERE';
CREATE DATABASE wikidb;
GRANT ALL PRIVILEGES ON wikidb.* TO 'wiki'@'localhost';
FLUSH PRIVILEGES;
EXIT;
apt install php php-fpm php-mysql php-xml php-intl php-mbstring php-gd php-curl
Download Mediawiki from the website, following this: https://www.mediawiki.org/wiki/Manual:Upgrading#Command_line
cd /var/www/ wget https://releases.wikimedia.org/mediawiki/1.45/mediawiki-1.45.1.tar.gz tar xvzf mediawiki-1.45.1.tar.gz rm mediawiki-1.45.1.tar.gz
rename the unzipped folder to wiki
mv mediawiki-1.45.1 wiki
change the permissions
chown -R www-data:cc /var/www/wiki/ chmod -R 755 /var/www/wiki/
Configure nginx
# ---------------------------------------------------
# WIKI
# Handling for the article path (pretty URLs)
location /wiki {
index index.php;
rewrite ^/wiki/(?<pagename>.*)$ /wiki/index.php;
}
# Images
location /wiki/images/deleted {
# Deny access to deleted images folder
deny all;
}
# MediaWiki assets (usually images)
location ~ ^/wiki/resources/(assets|lib|src) {
try_files $uri 404;
add_header Cache-Control "public";
expires 7d;
}
# Assets, scripts and styles from skins and extensions
location ~ ^/wiki/(skins|extensions)/.+\.(css|js|gif|jpg|jpeg|png|svg|wasm)$ {
try_files $uri 404;
add_header Cache-Control "public";
expires 7d;
}
# License and credits files
location ~ ^/wiki/(COPYING|CREDITS)$ {
default_type text/plain;
}
Migrate the database
Following this: https://www.mediawiki.org/wiki/Manual:Restoring_a_wiki_from_backup and https://www.mediawiki.org/wiki/Manual:Upgrading (as we are upgrading from 1.39 to 1.45)
Worked
Then this error appeared: Class "Wikimedia\Parsoid\DOM\HTMLDocument" not found
Followed this: https://phabricator.wikimedia.org/T409283
Worked!
Done