How to upgrade WordPress via shell?

WP-linux

Step 1#

First make backup of the wordpress database and the wordpress blog installation directory :

mysqldump username_DBname > username_DBname.sql

tar -cvf public_html.tar public_html
OR
tar -cvf directoryname.tar directoryname

Step 2#

cd /directoryname (where wordpress installed)

Download latest wordpress CMS
wget http://wordpress.org/latest.tar.gz

follow all the steps as given below :

tar xfz latest.tar.gz
rm -rf ./wp-includes/
rm -rf ./wp-admin/
cd wordpress/
scp -rp * ../
cd ..
rm -rf ./wordpress/
rm -f latest.tar.gz

Step # 3: Change ownership to user now :

cd ..
chown user:user * -R

Step # 4: Run update Script :

Open a browser and run update script such as

http://domainname.com/wp-admin/upgrade.php

OR

http://domainname.com/directoryname/wp-admin/upgrade.php

That’s it !

PrewebHost Hosting Solutions.
Cheap & Affordable Hosting Service Provider Since 2010

Leave a Reply

Your email address will not be published. Required fields are marked *