Notes on Mediawiki Migration

From Mass Pirate Wiki
Jump to navigationJump to search

Outline of MediaWiki Migration

Build a list of all pages to migrate. Provide these as a list to Special:Export. Be sure to include templates and the full history.

MFPL Control panel: create new mediawiki installation + database setup. The wiki lives in a subdirectory of our hosting order, as opposed to a separate hosting order. In the initial installation, the choice of admin user isn't important. We'll change it later.

In include/php5/php.ini, add

 upload_max_filesize = 7M
 post_max_size = 7M
 max_execution_time = 300

Verify that you can log onto wiki.

Mysqldump original user and group tables:

 mysqldump  -u USER -pPASSWD DBNAME \
   --no-create-info --complete-insert --extended-insert=0 \
   mdw_user mdw_user_groups > wiki-user.sql

In the dump file change "INSERT INTO" to "REPLACE INTO". Execute SQL against new mediawiki installation.

After loading new user table, verify that you can log in.

Next, go to Special:Import, and import pages. If you see the error message "Fatal error: Call to undefined method User::isAllowedAny()", then follow the workaround in this support ticket https://support.mayfirst.org/ticket/7017

After import, the Main_Page will be the mediawiki default. Copy the old text of out Main_Page's history, then edit Main_Page and paste it in.

Our old version of mediawiki was 1.16. The new installation uses mediawiki 1.15. The two store user preferences in different formats, so users will need to reset their preferences in the new installation. If you notice that the edit box is really really small, then you'll have to update your preferences.

Mayfirst's mediawiki installation leverages a global baseline configuration. Part of this configuration limits editing to a group called `approved'. When adding new accounts, be sure to put them in the approved group.

Add this to the bottom of LocalSettings.php

 # MassPirates customizations
 require_once(dirname( __FILE__ ) . "/MassPirates.php");

All of our configuration settings go in MassPirates.php

Disable self-serve signups

 $wgGroupPermissions['*']['createaccount'] = false;

Favicon

 $wgFavicon = "/images/MassPiratesFlagIcon.png";

Set up logo

 $wgLogo = 'images/MassPiratesFlagMedium.png';

Rewrite Rules (httpd configuration):

 RewriteEngine on
 RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-f
 RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-d
 RewriteRule ^/?wiki(/.*)?$ %{DOCUMENT_ROOT}/wiki/index.php [L]

Clean URLs

 $wgScriptPath       = "/wiki";
 $wgScriptExtension  = ".php";
 $wgArticlePath = "/wiki/$1";
 $wgUsePathInfo = true;