Difference between revisions of "Marspedia:Upgrading Mediawiki"
(11 intermediate revisions by the same user not shown) | |||
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 | + | *Copy in the .htaccess file which powers our short URLs and forces SSL mode. |
− | * 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 our favicon.* files in the root. |
+ | |||
+ | |||
+ | *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. | ||
+ | **[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:CheckUser CheckUser] | **[https://www.mediawiki.org/wiki/Extension:CheckUser CheckUser] | ||
− | **[https://www.mediawiki.org/wiki/Extension: | + | **[https://www.mediawiki.org/wiki/Extension:Google_Analytics_Integration googleAnalytics] |
− | |||
− | |||
**[https://www.mediawiki.org/wiki/Extension:Math Math] | **[https://www.mediawiki.org/wiki/Extension:Math Math] | ||
**[https://www.mediawiki.org/wiki/Extension:OpenGraphMeta OpenGraphMeta] | **[https://www.mediawiki.org/wiki/Extension:OpenGraphMeta OpenGraphMeta] | ||
+ | **[https://www.mediawiki.org/wiki/Extension:PageCreationNotif Page Creation Notification] | ||
**[https://www.mediawiki.org/wiki/Extension:RSS RSS feed] | **[https://www.mediawiki.org/wiki/Extension:RSS RSS feed] | ||
**[https://www.mediawiki.org/wiki/Extension:SmiteSpam SmiteSpam] | **[https://www.mediawiki.org/wiki/Extension:SmiteSpam SmiteSpam] | ||
− | **[https://www.mediawiki.org/wiki/Extension: | + | **[https://www.mediawiki.org/wiki/Extension:UserMerge UserMerge] |
− | |||
**[https://www.mediawiki.org/wiki/Extension:VisualEditor VisualEditor] | **[https://www.mediawiki.org/wiki/Extension:VisualEditor VisualEditor] | ||
− | * Copy in the Metrolook and | + | *Copy in the Metrolook, Marspedia and common 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) |
+ | |||
+ | *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== | ==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 92: | Line 100: | ||
+ | ==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: | ||
+ | |||
+ | [https://www.mediawiki.org/wiki/VisualEditor/Installation_on_a_shared_host Install Parsoid on a shared host] | ||
==Troubleshooting Problems== | ==Troubleshooting Problems== | ||
Here's [https://www.mediawiki.org/wiki/Manual:Upgrading Mediawiki's Guide to Upgrade] | Here's [https://www.mediawiki.org/wiki/Manual:Upgrading Mediawiki's Guide to Upgrade] |
Latest revision as of 07:26, 2 July 2020
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.
Contents
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 .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 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 the Metrolook, Marspedia and common 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)
- 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 ~/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. 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