3

Is there any way one could easily upgrade WordPress to latest version in Linux apart from the traditional way?

Reyan Chougle
  • 4,917
  • 2
  • 30
  • 57

1 Answers1

5

There is one way that I usually prefer when upgrading WordPress but this requires you to be comfortable with Linux shell prompt.

It is basically four step process:

Step 1 : Backup your existing database and WordPress directory

$ mkdir -p /backup/21072016
$ mysqldump -u user -p wp_database > /backup/21072016/wp_database.sql
$ tar -zcvf /backup/21072016/app.tar.gz /var/www/sites/mysite.com/app

Step 2 : Download the latest version from here

$ cd /tmp
$ wget http://wordpress.org/latest.zip
$ unzip latest.zip

Step 3 : Execute below commands

$ cd /var/www/sites/mysite.com/app
$ cp -avr /tmp/wordpress/* .
$ rm -rf /tmp/wordpress /tmp/latest.zip

Step 4 : Open a browser and run upgrade script as http://app.mysite.com/wp-admin/upgrade.php

Step 5 : This is optional, but due to security reasons I prefer renaming the upgrade.php file stored in wp-admin directory

That's it.. You are done..

Reyan Chougle
  • 4,917
  • 2
  • 30
  • 57
  • Step 4 includes a human interaction with a web browser page, and is apparently just to update the DB if required. Can we get rid of that and check for/auto-update the DB from the CLI as well? – TheSatinKnight Mar 19 '18 at 02:49