Difference between revisions of "Lunarpedia:Upgrading Mediawiki"

From Lunarpedia
Jump to: navigation, search
 
Line 65: Line 65:
 
*Copy in any Extensions we have installed.  As of this writing, here's our current list.  Each one should be downloaded from Mediawiki.org to ensure we have the latest version that matches the latest version of Mediawiki.
 
*Copy in any Extensions we have installed.  As of this writing, here's our current list.  Each one should be downloaded from Mediawiki.org to ensure we have the latest version that matches the latest version of Mediawiki.
 
**[https://www.mediawiki.org/wiki/Extension:CheckUser CheckUser]
 
**[https://www.mediawiki.org/wiki/Extension:CheckUser CheckUser]
 +
**[https://www.mediawiki.org/wiki/Extension:Cite Cite]
 
**[https://www.mediawiki.org/wiki/Extension:ConfirmAccount ConfirmAccount]
 
**[https://www.mediawiki.org/wiki/Extension:ConfirmAccount ConfirmAccount]
 
**[https://www.mediawiki.org/wiki/Extension:Google_Analytics_Integration Google Analytics Integration]
 
**[https://www.mediawiki.org/wiki/Extension:Google_Analytics_Integration Google Analytics Integration]

Latest revision as of 18:59, 5 February 2019

Below are the exact procedures for making upgrades to Lunarpedia's software, which is based on the Mediawiki software package.

This guide was written in February 2019 by James Burk.


Set up your environment

  • You will need to have SSH permissions on the Mars Foundation server. Contact James Burk (backup: Bruce Mackenzie) for help on setting this up for yourself. You will also need the Lunarpedia database user password which is obfuscated on this page.
  • You will need to use a tool that can SSH into our shell account. On Windows 10, we use Windows Subsystem for Linux and am able to run Ubuntu and all of its command line tools natively. For older versions of Windows, you can install Putty or other tools like MingW or Cygwin.
  • You will need to have several gigabytes of space available on your machine to hold the backups.
  • It's also easy to use an FTP client like Filezilla to do the filesystem backups, but you could also use rsync on the command line.


Backup everything

  • Login to our VPS using SSH:
 $ ssh mfmarspedia@lunarpedia.org


  • Change into the database backup directory
 $ cd backup_db_permanent


  • Run this command to backup the main database
 $ mysqldump --host="mysql.lunarpedia.org" --user="lunarpedia_www" --password=PASSWORD_GOES_HERE lunarpedia_prod > backup_lunarpedia_prod_20190205.sql


  • Backup all of the files in ~/marspedia.org

I use Filezilla to do this, copying the entire tree onto my laptop. The most important ones are LocalSettings.php, Env-LocalSettings.php, and the entire /images directory. Those will be needed on the upgraded install.

If you use Filezilla, be sure to use S/FTP (port 22) just to be safe.


Prepping the new install

  • Download the latest version of Mediawiki from their site.
  • Unzip the files

I often do these two steps on the server itself, but you can do it locally then copy up to the server using S/FTP.


  • Put all of the files into a new directory such as ~/lunarpedia.new


  • Copy in the LocalSettings.php and Env-LocalSettings.php files which include our configurations including database location & credentials.


  • Copy in the .htaccess file which powers our short URLs and forces SSL mode.


  • Copy in our favicon.* files in the root.


  • Copy in the entire /images directory.


  • Copy in the Metrolook and common skin directories. (The Marspedia skin is no longer used but holds some asset files which we reference.)
  • For the Metrolook theme, be sure to copy in the customized theme.less file which is in /skins/Metrolook/components/custom


Deploying the new Install

  • Rename the current webroot from ~/lunarpedia.org to ~/lunarpedia.old
  • Rename the new webroot from ~/lunarpedia.new to ~/lunarpedia.org
  • Run the DB Update script using these commands:
 $ cd ~/lunarpedia.org/maintenance
 $ php update.php


Installing Parsoid

Parsoid is a Node.js service that enables the VisualEditor. Pay attention to the versions of Parsoid and VisualEditor as one may require the other.

The version we have running on Heroku was cloned on June 24, 2018. It should be good for awhile. We are using that instance for Marspedia, Lunarpedia, and Spacepedia.

Here's the install instructions Parsoid on Heroku:

Install Parsoid on a shared host


Troubleshooting Problems

Here's Mediawiki's Guide to Upgrade