Difference between revisions of "Marspedia:Upgrading Mediawiki"

From Marspedia
Jump to: navigation, search
Line 6: Line 6:
 
==Set up your environment==
 
==Set up your environment==
  
* You will need to use a tool that can SSH into our shell account.  On Windows 10, I 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 use a tool that can SSH into our shell account.  On Windows 10, I 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.
+
*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.
+
*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==
 
==Backup everything==
  
* Login to our VPS using SSH:
+
*Login to our VPS using SSH:
  
 
   $ ssh mfmarspedia@marspedia.org
 
   $ ssh mfmarspedia@marspedia.org
  
  
* Change into the database backup directory
+
*Change into the database backup directory
  
 
   $ cd backup_db
 
   $ cd backup_db
  
  
* Our server is set to automatically backup the DB every day.  However, you can confirm that it's running ok by listing the contents of this directory and confirming all files are larger than 0.
+
*Our server is set to automatically backup the DB every day.  However, you can confirm that it's running ok by listing the contents of this directory and confirming all files are larger than 0.
  
 
   $ ls -la
 
   $ ls -la
  
  
* If you need to run a manual backup, this is the command to back up the database.  Be sure to put in the real password and the real date at the end of the filename (at end of command).
+
*If you need to run a manual backup, this is the command to back up the database.  Be sure to put in the real password and the real date at the end of the filename (at end of command).
  
 
   $ mysql -h mysql.marspedia.org -u marspediaorg_www -pPASSWORD_GOES_HERE marspediaorg_www > backup_marspediaorg_www_YYYYMMDD.sql
 
   $ mysql -h mysql.marspedia.org -u marspediaorg_www -pPASSWORD_GOES_HERE marspediaorg_www > backup_marspediaorg_www_YYYYMMDD.sql
  
  
* Backup all of the files in ~/marspedia.org
+
*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.
 
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.
Line 44: Line 44:
 
==Prepping the new install==
 
==Prepping the new install==
  
* Download the latest version of Mediawiki from [https://www.mediawiki.org/wiki/Download their site].
+
*Download the latest version of Mediawiki from [https://www.mediawiki.org/wiki/Download their site].
  
* Unzip the files
+
*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.
 
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 ~/marspedia.org.new
+
*Put all of the files into a new directory such as ~/marspedia.org.new
  
  
* Copy in the LocalSettings.php and Env-LocalSettings.php files which include our configurations including database location & credentials.
+
*Copy in the LocalSettings.php and Env-LocalSettings.php files which include our configurations including database location & credentials.
  
  
* Copy in the entire /images directory.
+
*Copy in the entire /images directory.
  
  
* 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:ArticleToCategory2 Add Article to Category 2]
 
**[https://www.mediawiki.org/wiki/Extension:ArticleToCategory2 Add Article to Category 2]
 
**[https://www.mediawiki.org/wiki/Extension:ConfirmAccount ConfirmAccount]
 
**[https://www.mediawiki.org/wiki/Extension:ConfirmAccount ConfirmAccount]
Line 74: Line 74:
  
  
* Copy in the Metrolook and Marspedia skin directories.  (The Marspedia skin is no longer used but holds some asset files which we reference.)
+
*Copy in the Metrolook and Marspedia skin directories.  (The Marspedia skin is no longer used but holds some asset files which we reference.)
  
  
* Copy in any other customizations or custom Extensions we have.  (As of this writing we are working on a "Category Picker" which will be a fork of the one in VisualEditor)
+
*Copy in any other customizations or custom Extensions we have.  (As of this writing we are working on a "Category Picker" which will be a fork of the one in VisualEditor)
  
  
 
==Deploying the new Install==
 
==Deploying the new Install==
  
* Rename the current webroot from ~/marspedia.org to ~/marspedia.org.old
+
*Rename the current webroot from ~/marspedia.org to ~/marspedia.org.old
  
* Rename the new webroot from ~/marspedia.org.new to ~/marspedia.org
+
*Rename the new webroot from ~/marspedia.org.new to ~/marspedia.org
  
* Run the DB Update script using these commands:
+
*Run the DB Update script using these commands:
  
 
   $ cd ~/marspedia.org/maintenance
 
   $ cd ~/marspedia.org/maintenance
Line 94: Line 94:
 
==Installing Parsoid==
 
==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.  Here's how to install Parsoid on Marspedia:
+
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. 
 +
 
 +
Here's how to install Parsoid for Marspedia:
  
 
[https://www.mediawiki.org/wiki/VisualEditor/Installation_on_a_shared_host Install Parsoid on a shared host]
 
[https://www.mediawiki.org/wiki/VisualEditor/Installation_on_a_shared_host Install Parsoid on a shared host]
 
  
  

Revision as of 09:49, 24 June 2018

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

This guide was written in June 2018 by James Burk.


Set up your environment

  • You will need to use a tool that can SSH into our shell account. On Windows 10, I 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@marspedia.org


  • Change into the database backup directory
 $ cd backup_db


  • Our server is set to automatically backup the DB every day. However, you can confirm that it's running ok by listing the contents of this directory and confirming all files are larger than 0.
 $ ls -la


  • If you need to run a manual backup, this is the command to back up the database. Be sure to put in the real password and the real date at the end of the filename (at end of command).
 $ mysql -h mysql.marspedia.org -u marspediaorg_www -pPASSWORD_GOES_HERE marspediaorg_www > backup_marspediaorg_www_YYYYMMDD.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 ~/marspedia.org.new


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


  • Copy in the entire /images directory.



  • Copy in the Metrolook and Marspedia skin directories. (The Marspedia skin is no longer used but holds some asset files which we reference.)


  • Copy in any other customizations or custom Extensions we have. (As of this writing we are working on a "Category Picker" which will be a fork of the one in VisualEditor)


Deploying the new Install

  • Rename the current webroot from ~/marspedia.org to ~/marspedia.org.old
  • Rename the new webroot from ~/marspedia.org.new to ~/marspedia.org
  • Run the DB Update script using these commands:
 $ cd ~/marspedia.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.

Here's how to install Parsoid for Marspedia:

Install Parsoid on a shared host


Troubleshooting Problems

Here's Mediawiki's Guide to Upgrade