WordPress Manual Upgrade for Experts: Difference between revisions

mNo edit summary
Line 1: Line 1:
There are lots of websites detailing how to manually upgrade a WordPress Site.  Most of them seem to be done by people with very little background in Linux or command line usage (no offense to them).  But there is a simpler way if you know some advanced techniques.
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 helpIt did make  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.
 
Why upgrade manually?  For me it was not wanting to upgrade to a 5.X.Y version and instead stay with the latest 4.X.Y version because of a lot of customization based on the 4 series.


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.


Anyway, onto the detailed steps that leverage the command line and phpMySQL...
==BACKUP!==
==BACKUP!==
First of all BACK EVERYTHING UP!!!  Don't take a chance that the upgrade will mess something up, make a backup.  For WordPress, that consists of two items: The website files and the data base.
First of all BACK EVERYTHING UP!!!  Don't take a chance that the upgrade will mess something up, make a backup.  For WordPress, that consists of two items: The website files and the database.


===Website Files===
===Website Files===
Backup the website files (actually make a copy)<syntaxhighlight lang="text">
Backup the website files by making a copy;<syntaxhighlight lang="text">
mv WebSiteDirectory WebSiteDirectory.WorkingVersionX.Y.Z
mv WebSiteDirectory WebSiteDirectory.WorkingVersionX.Y.Z


...The original files will then be used to copy into the directory with the upgrade version, covered a few steps later.
...The original files will then be used to copy into the directory with the upgrade version, covered a few steps later.
</syntaxhighlight>The above is the quickest way to preserve a functional version of the website files (the MV command does not change permissions) also test as you go.
</syntaxhighlight>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 test copy of the website files for peace of mind use the below command;<syntaxhighlight lang="text">
The next step isn't necessary, but if you want to make a copy of the website files and test those copies 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>Now test the web site.  It should be completely functional as the above command copies all files and directories (sub too), retains permissions, retains symbolic links, IE makes an ''exact'' duplicate.
</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.


===Database===
===Database===
For the database, use the command line or phpMyAdmin.  phpMyAdmin makes it really easy.  Select the database, export, simple, Go, save it, done.
For the database, use the command line or phpMyAdmin.  phpMyAdmin makes it really easy.  Select the database in the left pane, Export Tab, "Simple" Radio Button, Go Button, save it to a file, done.


===Other Thoughts===
===Other Thoughts===