Topic on Project:Support desk

404 when upgrading from MediaWiki 1.28.2 to 1.29.2

3
N S Christian (talkcontribs)

I have read several dozen webpages regarding upgrading MediaWiki, especially Manual:Upgrading

I followed the instructions but in the end I get:

 404
 The page you are looking for cannot be found.

The current Wiki is here: https://wiki<dot>XXX<dot>com<dot>sg

This is working well.

The upgraded Wiki is at another subdomain: https://mirror<dot>XXX<dot>com<dot>sg

So I changed in LocalSettings.php file:

 $wgServer = "https://mirror<dot>XXX<dot>com<dot>sg";

It is using a duplicated database.

The previous creator of the wiki had used short URLs with .htaccess file.

$wgArticlePath = "/wiki/$1";
$wgUsePathInfo = true;

He had placed all the files at the web document root so

$wgScriptPath = "";

I commented some namespaces that were not used.

Database:

The database is using phpMyAdmin MariaDB10.

The old database dataXXX1 had collation utf8_general_ci

 time mysqldump -h localhost --socket /run/mysqld/mysqld10.sock -u userXXX1 -p --default-character-set=utf8 dataXXX1 -r backup_dataXXX1_`date +%Y-%m-%d_%H_%M`.sql

Then I imported into a new MariaDB10 database with collation utf8_unicode_ci.

In LocalSettings.php file:

# MySQL table options to use during installation or update
$wgDBTableOptions = "ENGINE=InnoDB, DEFAULT CHARSET=binary";

changed to -->

$wgDBTableOptions = "ENGINE=InnoDB, DEFAULT CHARSET=utf8";

I commented:

## Shared memory settings
$wgMainCacheType = CACHE_ACCEL;
$wgMemCachedServers = array();

Copying the required files:

I used the Vector skin, so commented all other skins.

I used the same extensions, all downloaded matching the WikiMedia version 1.29.2.

The images and extensions are placed inside the new wiki.

The .htaccess and new LocalSettings.php are inserted in the new wiki.

I am using Synology NAS.

I set owner and permissions:

time chown -R http.http /web/document/root/
cd /web/document/root/
time find . -type f -exec chmod 664 {} \;
time find . -type d -exec chmod 775 {} \;
time chown http.http /web/document/root
time chown http.http /web/document/root/*
time chown http.http /web/document/root/.*
cd /web/document/root/
chmod 775 *
chmod 775 .*

Running update script:

I transferred the new wiki to online.

I ran the update script in the maintenance directory using the shell command:

php56 update.php

It completed successfully with no errors.

When accessing the new wiki, I get this error page:

 404
 The page you are looking for cannot be found.

The .htaccess file is:

# Expires Caching Start #
## EXPIRES CACHING ##
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/jpg "access 1 year"
ExpiresByType image/jpeg "access 1 year"
ExpiresByType image/gif "access 1 year"
ExpiresByType image/png "access 1 year"
ExpiresByType text/css "access 1 month"
ExpiresByType application/pdf "access 1 month"
ExpiresByType application/javascript "access 1 month"
ExpiresByType application/x-javascript "access 1 month"
ExpiresByType application/x-shockwave-flash "access 1 month"
ExpiresByType image/x-icon "access 1 year"
ExpiresDefault "access 2 days"
## EXPIRES CACHING ##

# Enable the rewrite engine
RewriteEngine On
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-f
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-d
RewriteRule ^/?wiki(/.*)?$ %{DOCUMENT_ROOT}/index.php [L]
RewriteRule ^/*$ %{DOCUMENT_ROOT}/index.php [L]
# Redirect / to Main Page
</IfModule>

I deleted the .htaccess file. I get the same 404 result.

Hope somebody can help.

MarkAHershberger (talkcontribs)

It may be that the mod_expires apache module isn't installed on the new server. What happens if you replace the .htaccess with the following:

# Enable the rewrite engine
RewriteEngine On
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-f
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-d
RewriteRule ^/?wiki(/.*)?$ %{DOCUMENT_ROOT}/index.php [L]
RewriteRule ^/*$ %{DOCUMENT_ROOT}/index.php [L]
# Redirect / to Main Page
N S Christian (talkcontribs)

Thank you very much!!! The upgraded wiki is working now.

I have returned to recommended permissions.

cd web/document/root/
time find . -type f -exec chmod 644 {} \;
time find . -type d -exec chmod 755 {} \;