WordPress Manual Upgrade for Experts: Difference between revisions
m →Upgrade |
mNo edit summary |
||
Line 1: | Line 1: | ||
There ''so many'' websites detailing how to manually upgrade a WordPress Site. The vast majority of them seem to be done by people with very little experience with all of the technologies behind WordPress like Linux (CentOS, Ubunto, etc.), PHP, Apache (Nginx, IIS, or other web servers), mySQL (MariaDB, SQL Server, etc.), and others. I mean no offense to them as they are talented in their own right and just trying to help. | There ''so many'' websites detailing how to manually upgrade a WordPress Site. The vast majority of them seem to be done by people with very little experience with all of the technologies behind WordPress like Linux (CentOS, Ubunto, etc.), PHP, Apache (Nginx, IIS, or other web servers), mySQL (MariaDB, SQL Server, etc.), and others. I mean no offense to them as they are talented in their own right and just trying to help. But it did make me think writing something about a simpler (and safer) way to upgrade a WordPress installation by leveraging more technically adept techniques. So I did. | ||
It also brings up the question, "Why upgrade manually?" For me it was born of a desire to stay within the 4.X.Y series I was using instead of the 5.X.Y version offered. There is a method to change the automatic upgrade method to ignore major version upgrades and only install minor versions (Major#.Medium#.Minor#), but after testing I determined it did not affect the manually triggered upgrade button. | It also brings up the question, "Why upgrade manually?" For me it was born of a desire to stay within the 4.X.Y series I was using instead of the 5.X.Y version offered as there is nothing in the 5 series the 4 series doesn't already provide for me on this particular site. There is a method to change the automatic upgrade method to ignore major version upgrades and only install minor versions (Major#.Medium#.Minor#), but after testing I determined it did not affect the manually triggered upgrade button. | ||
Anyway, onto the detailed steps that leverage the command line and phpMySQL. | Anyway, onto the detailed steps that leverage the command line and phpMySQL. The information also assumes one has command line access to a web server. | ||
==BACKUP!== | ==BACKUP!== | ||
First of all BACK EVERYTHING UP!!! | First of all BACK EVERYTHING UP!!! Assume the upgrade will mess something up and make a backup so you have a functional version to fall back on. For WordPress, that consists of two items: The website files and the database. | ||
===Website Files=== | ===Website Files=== | ||
Move the website files to another version (no need to copy, you'll see just below);<syntaxhighlight lang="text"> | |||
mv WebSiteDirectory WebSiteDirectory.WorkingVersionX.Y.Z | mv WebSiteDirectory WebSiteDirectory.WorkingVersionX.Y.Z | ||
Line 15: | Line 15: | ||
The above is the quickest way to preserve a functional version of the website files (the MV command does not change permissions). | The above is the quickest way to preserve a functional version of the website files (the MV command does not change permissions). | ||
The next step isn't necessary, but if you want to make a copy of the website files and test those | The next step isn't necessary, but if you want to make a copy of the website files and test those copied files for functionality and peace of mind, use the below command;<syntaxhighlight lang="text"> | ||
cp -ax WebSiteDirectory.WorkingVersion.X.Y.Z WebSiteDirectory | cp -ax WebSiteDirectory.WorkingVersion.X.Y.Z WebSiteDirectory | ||
The WebSiteDirectory will need to be erased before copying the new updated WordPress files. | The WebSiteDirectory will need to be erased before copying the new updated WordPress files. | ||
</syntaxhighlight> | </syntaxhighlight> | ||
When testing the functionality of the site, it should be completely functional since the above command copies all files and directories (sub-directories too), retains permissions, retains symbolic links, IE makes an ''exact'' duplicate. | When testing the functionality of the site, it should be completely functional since the above command copies all files and directories (sub-directories too), retains permissions, retains symbolic links, IE makes an ''exact'' duplicate. If you do choose to make a copy, you'll need to delete it or move it so the original directory name can be used for the upgrade files. | ||
===Database=== | ===Database=== | ||
Line 30: | Line 30: | ||
==Upgrade== | ==Upgrade== | ||
*Download whichever version of WordPress you want: https://wordpress.org/download/releases/ | *Download whichever version of WordPress you need / want: https://wordpress.org/download/releases/ | ||
*Extract the files (if downloading a TAR version): tar -xf WhatEverFIleName | *Extract the files (if downloading a TAR version): tar -xf WhatEverFIleName | ||
*Move or copy the files to the web server directory: mv Source Destination | *Move or copy the files to the web server directory: mv Source Destination | ||
*Set the proper ownership and file permissions on the new files (the below example is for Apache on CentOS);<syntaxhighlight lang="text"> | *Set the proper ownership and file permissions on the new files (the below example is for Apache on CentOS);<syntaxhighlight lang="text"> | ||
chown -R apache:apache /var/www/html/ | chown -R apache:apache /var/www/html/WebSiteDirectory | ||
find /var/www/html/WebSiteDirectory -type d -exec chmod 755 {} \; | find /var/www/html/WebSiteDirectory -type d -exec chmod 755 {} \; | ||
find /var/www/html/WebSiteDirectory -type f -exec chmod 644 {} \; | find /var/www/html/WebSiteDirectory -type f -exec chmod 644 {} \; | ||
Line 47: | Line 47: | ||
*Also remember a LOT of extensions make use of an .htaccess file (with Apache and other web servers) to modify the behavior of a WordPress site, so make sure that file from the original version of that file is copied into the upgrade directory (its a hidden file, so make sure). | *Also remember a LOT of extensions make use of an .htaccess file (with Apache and other web servers) to modify the behavior of a WordPress site, so make sure that file from the original version of that file is copied into the upgrade directory (its a hidden file, so make sure). | ||
== Final Thoughts == | ==Final Thoughts== | ||
Depending on the complexity and customization of the WordPress Site, there may be complications. For me, there were two plugins that didn't function at 100%. You'll probably have some issues too. The first best solution after upgrading WordPress is to update extensions too. Make a copy of your upgraded WordPress site in case any extension upgrades mess things up. | Depending on the complexity and customization of the WordPress Site, there may be complications. For me, there were two plugins that didn't function at 100%. You'll probably have some of your own unique issues too. The first best solution after upgrading WordPress is to update extensions too. Make a copy of your upgraded WordPress site in case any extension upgrades mess things up. | ||
=== Magic Zoom === | ===Magic Zoom=== | ||
A great plugin that I really like, called Magic Zoom, which provides a zoom window like a magnifying glass to enlarge images had an 'image cache issue' that I was able to fix with a CHOWN command. | A great plugin that I really like, called Magic Zoom, which provides a zoom window like a magnifying glass to enlarge images had an 'image cache issue' that I was able to fix with a CHOWN command. | ||
=== Image Map Pro === | ===Image Map Pro=== | ||
Image Map Pro, a plugin that allows custom regions to be defined on an image that produce a popup word balloon also wasn't functioning. After some quick troubleshooting I determined it was related to images that had been uploaded before the site had been converted to use HTTPS. The fix was fairly simple: Re-select the same image while connected via HTTPS. | Image Map Pro, a plugin that allows custom regions to be defined on an image that produce a popup word balloon also wasn't functioning. After some quick troubleshooting I determined it was related to images that had been uploaded before the site had been converted to use HTTPS. The fix was fairly simple: Re-select the same image while connected via HTTPS. | ||