Tuesday, February 21, 2012

Upgrade a WordPress Blog

SSH into the Linux server.

Change the directory to the blog directory.

Backup the MySQL database by running the following command substituting in your own information (where root is the MySQL root username and [databasename] is the actual WordPress database being used for the site):

mysqldump –u root –p [databasename] > [databasename].sql

Download the latest version of Wordpress by running this command:

wget http://wordpress.org/latest.tar.gz
Unzip the download.

tar -xzvf latest.tar.gz

Make a backup of your data just in case something goes wrong or if you have custom content where blogdirectory is the directory the blog is installed):

tar -czvf blog_backup.tgz blogdirectory/

Overwrite the files, thus upgrading the blog, by running this command (where blogdirectory is the directory the blog is installed):

yes | cp -r wordpress/* blogdirectory/

Now go to your blog admin section and verify everything is correct. You may be asked when viewing the admin section to upgrade the database. Click OK to do so.

Your blog is now upgraded to the latest version.

0 comments:

Post a Comment