Upgrading WordPress software manualy to the latest version.

Hi all.

One of the PCLinuxOS policies is “DO NOT install anything from outside the repo” and I agree with that. Installing anything from outside the repo is the best way of borking Your system. Application from outside PCLinuxOS repository can cause stability issues. It’s also a security risk… BUT in this case we are talking about a blogging software. If You run WordPress on Your own machine and it’s accessible to anyone from outside (the internet) then not keeping it current is like asking someone to use a old vulnerability (exploit): to gain control over Your machine and change it into a spambot, DDOS bee or hack another machine from it…

PCLinuxOS has WordPress in it’s repository…

[andrzejl@icsserver ~]$ apt-cache search wordpress
wordpress – WordPress Open Source Forum (CMS)
[andrzejl@icsserver ~]$

unfortunately it’s not being upgraded very often…

[andrzejl@icsserver ~]$ rpm -qa | grep wordpress
wordpress-3.1.3-1pclos2011
[andrzejl@icsserver ~]$

considering that 3.3 is the latest stable version of WordPress…

How to keep WordPress current?

First of all I am using the rss feed reader Akregator (any other rss feed reader will do just fine) to receive updates about WordPress development. Rss feed address is:

http://wordpress.org/news/feed/

Then whenever I get information about the new release of the WordPress I run this command (just copy / paste it if You are using default PCLinuxOS WordPress setup) from the terminal followed by root password:

su -c "cd /var/www/html/ && wget -c http://wordpress.org/latest.tar.gz && tar xvzf ./latest.tar.gz && rm -f ./latest.tar.gz"

Wordpress Upgrade 001

Command syntax explained:

su -c ""

Run the command inside the “” as a root user.

&&

Wait till previous command finished successfully before going any further.

cd

Enter the folder.

/var/www/html/

Default folder in which WordPress is being installed on PCLinuxOS. If You have changed the location of the WordPress on Your installation You need to amend this part of the command.

wget -c

Download the file with the option to continue later if download got interrupted for whatever reason.

http://wordpress.org/latest.tar.gz

Static address for downloading latest stable release of wordpress in tar.gz file.

Wordpress Upgrade 002

tar xvzf

Extract tar.gz archive.

./latest.tar.gz

Path to the tar.gz archive that we have just downloaded ./ in front of the file name means that it’s in the same directory that we are currently in.

Wordpress Upgrade 003

rm -Rf

Remove without asking for permission.

PLEASE be extremely careful. Guess what happens when

rm -Rf /

is ran? Yeah… Nothing good… You can say buh bye to Your current installation and ALL the files… In other words.. DON’T! 🙂

Wordpress Upgrade 004

After the command finished open Your browser (I am using Firefox 9.0.1 here) and navigate to Your WordPress blog. Right click and choose View Page Source from the drop-down menu.

Wordpress Upgrade 005

You should be able to see similar entry as the one highlighted on the screenshot above. Your WordPress is upgraded to the latest version.

You can also check Your WordPress version in the Dashboard section of Your WordPress Administration Panel.

Sometimes after the upgrade of the WordPress You need to upgrade Your database. You will be asked for it when logging into the Admin’s panel. Nothing to worry about. One click in a browser does it for You. Never had any problems with this.

Wordpress Upgrade 006

This is how I upgrade WordPress software on my server. Brain is needed when following my method. I do not take any responsibility if You bork something.

Hope this helps somebody someday.

Regards.

Andy

Edit: Another reason to keep WordPress updated.

Advertisements