WordPress Upgrade

Step by step upgrades.

Here we go yet again….. with another exciting wordpress upgrade, or not. 

Step 1.  Backup the wordpress site AND the wordpress database

As every book on the subject states, backup are just in case something goes horribly wrong, even though that’s highly unlikely.  In practice though, life pressures happen and accountants are often in charge, with the result in backups often being skipped or checked, but you can always tell how long someone has been using computers by how frequently they back up stuff.

(a)  Backup the wordpress database.

First we need the name of the wordpress database for the wordpress site being backed up.

This wordpress database name is in the wp-config.php file ( as well as in the mysql  database of course ).  So for this example procedure described here, the wp-config.php file contains –> define(‘DB_NAME’, ‘database1’);

If however, its been awhile and don’t remember where that file is located on the server, its location is dictated by the apache web servers configuation file, which its location can be found by:  httpd -l  ( assuming of course that the name of the apache running is httpd – which shows up in the running list of processes with: ps -ef )

#  cd /var/local/backup1   ( a place to hold the backup )
# mysqldump -u root -p database1 > database1-backup.sql

(b) Backup the current wordpress files for the site.

For this example procedure described here, the current wordpress site is located at “/usr/local/blogs/wordpress-site”

# cd /var/local/backup1
# tar  czf  wordpress-backup.tar.gz   /usr/local/blogs/wordpress-site

Step 2.  Download the latest wordpress files.

# cd /usr/local/src
# wget  https://wordpress.org/latest.tar.gz
# gzip -d latest.tar.gz
# tar xvf latest.tar

The latest wordress files will now be located in /usr/local/src/wordpress, but we do not run them yet, as we need to first merge them wit the older current running version.

Step 3.  Delete the old software wordpress version.

# cd  /usr/local/blogs/wordpress-site
# rm -r  ./wp-includes/*
# rm -r ./wp-admin/*

Step 4.  Copy in some ( but not all ) of the new wordpress software.

#  cd /usr/local/blogs/wordpress-site
# cp  -R   /usr/local/src/wordpress/wp-includes/*  wp-includes 
# cp  -R  /usr/local/src/wordpress/wp-admin/*    wp-admin     
# cp -R  /usr/localsrc/wordpress/wp-content/*  wp-content
# cp /usr/local/src/wordpress/*.php  .  
 ( the current wp-config.php is preserved, as it is not in any new version of wordpress ...
   well, surely not  ).

Step 5.  Update the database ( perhaps ).

http://the web site/wp-admin/upgrade.php

This will either update the database tables, or more likely, will display the following:

Step 6.  Upgrade the existing wordpress plugins, if any say they need upgrading from he dashboard->plugins.

For example, the plugin:  Disable Comments

#  cd    /usr/local/bl;ogs/jhb/wp-content/plugins/
#  wget https://downloads.wordpress.org/plugin/disable-comments.zip
#  unzip disable-comments.zip

© 2017, James Harry Burton. All rights reserved.