WordPress 4.7 was just recently released, named “Vaughan” in honor of legendary jazz vocalist Sarah “Sassy” Vaughan. For many websites owners today, upgrading should happen automatically.
Most host providers now automatically update and upgrade WordPress websites hosted with them. For these owners, there’s no need to worry.
However, for those managing their own websites, upgrading is as easy as a single click. When WordPress is installed on a server with correct permissions for files and folder, usually the webserver has full access, upgrading WordPress should be easy.
Logon to the admin dashboard, select Updates on the left menu and upgrade using the Upgrade Now button.
This should upgrade WordPress easily. To configure WordPress to automatically update and upgrade itself so you don’t have to worry about manually upgrading, follow the post below.
Students question – Configuring WordPress to Automatically Update
Upgrading WordPress via SSH command line
In other cases, upgrading WordPress isn’t as simple as clicking the upgrade button from the administrator dashboard. Some WordPress installations are so restrictive, the only way to upgrade is via the commandline.
To use the command line to upgrade, follow the guide below:
Backing Up WordPress content and database
So, before upgrading backup WordPress content and database. From the command line, run the commands below to backup WordPress content
sudo tar -cvzf WordPress.tar /var/www/html/wordpress
This post assumes your WordPress content lives in /var/www/html/wordpress.. please change that location accordingly.
To backup WordPress database, run the commands below
mysqldump -u root -p wordpressdb > wordpressdb.sql
This post assumes your WordPress database is called wordpressdb.. please change accordingly
Deleting WordPress old content
Now that you’ve backed-up WordPress content, using the commands below to delete WordPress old content. The two folders below are all you need to delete.
sudo rm -rf /var/www/html/wordpress/wp-includes
sudo rm -rf /var/www/html/wordpress/wp-admin
Downloading WordPress latest content
After deleting WordPress old content, use the commands below to download WordPress latest content from online.
cd /tm/ && wget https://wordpress.org/latest.zip
Then unzip the content by running the commands below.
Copying the new content and upgrading
Finally, copy the newer content to the root directory and upgrade. Run the commands below to copy WordPress latest content to your site directory.
sudo mv /tmp/wordpress/* /var/www/html/wordpress
After copying the content, open your web browser and browse to the website using the URL below and perform the upgrade
You should see WordPress upgrading its database and in no time you should be able to logon and see the upgraded site. This is how one upgrades WordPress from the command line,