Home | About Me
| | | | | | | | | |

How to upgrade Wordpress? Best and safest way to upgrade

Random | 19 Aug 2017

Upgrading wordpress can be a bit of a hassle especially if you are doing so using the wp-admin section. Here is the list of possible issues you may encounter during the core upgrade and quick ways to resolve these issues:

The easiest and most preferable way to perform an update would be by having shell access to your host.  I would recommend downloading the latest version of the wordpress. After this wordpress files should be extracted to substitute the existing files and update.php script should be executed from your domain name. Do not forget to backup your existing code and database before the upgrade!

Follow the instructions below to upgrade your wordpress:

  1. Backup your existing files and database:
    mkdir /tmp/backup
    cd /tmp/backup
    tar czf backup.tgz /var/www/[your site directory]
    mysqldump -uroot -p [database name] > database.sql
  2. Download and extract the contents of the latest wordpress code
    cd /tmp
    wget http://wordpress.org/latest.zip
    unzip latest.zip
    cd /var/www/[your site directory]
    cp -avr /tmp/wordpress/* .
    rm -rf /tmp/wordpress /tmp/latest.zip
  3. Run the upgrade script:
    http://[your wordpress site]/wp-admin/upgrade.php

If something goes wrong, you can always locate your backup files in /tmp/backup , extract them , recover the database dump and go back to the previous state.

During the migration process and for other cases of wordpress troubleshooting it may be useful to turn on debugging. This can be achieved by switching these parameters in wp-config.php file:

// turns on debugging, output is displayed on the web page
define('WP_DEBUG', true);

// the debug log will be saved to wp-content/debug.log
define( 'WP_DEBUG_LOG', false);

Hope this helps :) enjoy migrating your wordpress site successfully !