WordPress Manual Upgrade for Experts: Difference between revisions

mNo edit summary
mNo edit summary
 
(10 intermediate revisions by the same user not shown)
Line 8: Line 8:


===Website Files===
===Website Files===
Move the website files to another version (no need to copy, you'll see just below);<syntaxhighlight lang="text">
Move the website files to another version (no need to copy, you'll understand, explained below);<syntaxhighlight lang="text">
mv WebSiteDirectory WebSiteDirectory.WorkingVersionX.Y.Z
mv WebSiteDirectory WebSiteDirectory.WorkingVersionX.Y.Z


Line 26: Line 26:
===Database===
===Database===
For the database, use the mySQL (MariaDB, etc.) command line or phpMyAdmin.  phpMyAdmin makes it much easier.  Select the database in the left pane, Export Tab, "Simple" Radio Button, Go Button, save it to a file, done.
For the database, use the mySQL (MariaDB, etc.) command line or phpMyAdmin.  phpMyAdmin makes it much easier.  Select the database in the left pane, Export Tab, "Simple" Radio Button, Go Button, save it to a file, done.
For the command line;
* Export: mysqldump -u WhatEverUserName -p <mark>WhatEverDataBaseName</mark> > WhatEverFileName<mark>.sql</mark>
* Create
** CREATE DATABASE WhatEverDatabaseName;
** GRANT ALL ON WhatEverDatabaseName.* TO 'WhatEverUserName'@'localhost' IDENTIFIED BY 'WhatEverPassword';
** FLUSH PRIVILEGES;
* Import: mysql -u WhatEverUserName-p WhatEverDatabaseName< <mark>WhatEverFileName.sql</mark>
<br />


===Other Thoughts===
===Other Thoughts===
Line 32: Line 43:
==Upgrade==
==Upgrade==


*Download whichever version of WordPress you need / want: https://wordpress.org/download/releases/
*Download whichever version of WordPress you need / want from here (Minor version upgrades are the safest, IE 4.9.13 to 4.9.16): https://wordpress.org/download/releases/
*Extract the files (if downloading a TAR version);
*Extract the files (if downloading a TAR version)
 
AND
 
*Move or copy the ''extracted'' files to a directory of the same name as the ''original'' web server directory (IE, after the above MV command when backing up the WordPress Site, the original Directory containing the site should not exist (or at least be empty)): mv Source Destination
<syntaxhighlight lang="text">
<syntaxhighlight lang="text">
tar -xf WhatEverFIleName
tar -xf WhatEverFileName
mv WhatEverFileName NewFileName (to rename from the default WordPress Directory name)
 
OR
 
tar -xvzf wordpress-w.x.yz.tar.gz -C /var/www/html/WhatEverDirectory (Don't worry about making a mess with a lot of files as the TAR File's first item is a Directory, as it should be)
</syntaxhighlight>
</syntaxhighlight>


*Move or copy the ''extracted'' files to the ''original'' 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)
*Set the proper ownership and file permissions on the new files (the below example is for Apache on CentOS)
<syntaxhighlight lang="text">
<syntaxhighlight lang="text">
Line 54: Line 73:
</syntaxhighlight>
</syntaxhighlight>


*Make sure the wp-config.php file is in the upgrade directory (The "original / working" version of the file should be copied with the above CP command as it does not typically exist in a newly extracted version of WordPress (it's generated))
*Make sure the original wp-config.php file is in the upgrade directory (The "original / working" version of the file should be copied with the above CP command as it does not typically exist in a newly extracted version of WordPress (it's generated))
*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 the .htaccess file from the original version of that file is copied into the upgrade directory''' (it is a hidden file, so double check that).  And after it was promptly forgotten by the author of this article, looked it up and found this reference too: https://tompai.pro/wordpress/solved-404-on-posts-and-pages-after-wordpress-update-to-4-9-8/ (it applies to other versions than the one noted in that article).


===Plugins===
===Plugins===
Line 61: Line 80:
cp -ax WhatEverExtension WhatEverExtension.BackUp
cp -ax WhatEverExtension WhatEverExtension.BackUp
</syntaxhighlight>
</syntaxhighlight>
===Database===
The website database may also need to be updated.  Navigate to: https://www.riseofthesaltonsea.com/wp-admin/upgrade.php and it will prompt to update the database if necessary.


==Final Thoughts==
==Final Thoughts==