InfoHeap
Tech
Navigation
  • Home
  • Tutorials
    • CSS tutorials & examples
    • CSS properties
    • Javascript cookbook
    • Linux/Unix Command Line
    • Mac
    • PHP
      • PHP functions online
      • PHP regex
    • WordPress
  • Online Tools
    • Text utilities
    • Online Lint Tools
search

Wordpress How-Tos

  • angularjs in wordpress
  • Convert wordpress page to posts and vice versa
  • Find all user created wordpress custom field keys
  • How to automate wordpress sandbox setup on Linux
  • How to capture php code or included file output in a variable
  • How to check the performance of a plugin using mysql query log
  • How to migrate wordpress from root to sub directory
  • How to upgrade wordpress manually
  • How to view wordpress current version
  • Setup xdebug for remote wordpress debugging
  • Wordpress - disable theme and plugin editing
  • Wordpress - get wpdb class method names
  • Wordpress multisite network vs normal installation
  • display method names from php WP_Query object
  • find if a wordpress page is leaf page
 
  • Home
  • > Tutorials
  • > Wordpress
  • > Wordpress How To

How to upgrade wordpress manually

By admin | Last updated on Mar 20, 2016

Recently I upgraded wordpress from version 3.5.1 to 4.3.1. There are couple of ways you can upgrade wordpress and easiest one is do it using the wordpress ui. It pretty much involves few clicks if things go smoothly. For me it did not work from ui as it got stuck at unpacking stage. These are the quick manual steps which worked for me (on Ubuntu Linux). These were based on the upgrade instructions on wordpress site.

Take code and db backup

Take a backup of your wordpress directory. Assuming it is installed at /var/www/html/wordpress, run the following

$ cd /var/www/html/
$ sudo rsync -a /var/www/html/wordpress /var/www/html/wordpress.bak

rsync -a will ensure file permissions are also preserved.
Now take a backup of mysql db.

$ mysqldump -u root --password=ROOT_PASSWORD -h localhost DBNAME > db.bak

Deactivate all plugins

First deactivate all plugins. Before deactivating, note down any already deactivated plugin. This will be useful when you want to activate these plugins again.

Delete some old wordpress code

Run the following to delete old code

$ cd /var/www/html/wordpress/
$ sudo rm -rf wp-content/cache/*
$ sudo rm -rf wp-includes
$ sudo rm -rf wp-admin
$ sudo rm index.php wp-activate.php wp-activate.php wp-config-sample.php  wp-login.php wp-mail.php wp-blog-header.php license.txt xmlrpc.php wp-signup.php wp-settings.php wp-load.php wp-trackback.php wp-links-opml.php readme.html wp-cron.php wp-comments-post.php

We will keep wp-config.php file and wp-content directory unchanged.

Download latest wordpress

Down the latest wordpress software and unzip it to ~/software/wordpress-latest or some other location. Now copy the relevant files from it to the installation directory of wordpress.

$ cd /var/www/html/wordpress/
$ rsync -a --exclude=wp-content ~/software/wordpress-latest/* ./

Upgrade wordpress

Now visit /wp-admin/upgrade.php in browser and follow instructions to upgrade the wordpress db. You will see a screen as shown below:
wordpress-update-db-screen
Click on “Upgrade WordPress Database” to finish the upgrade.

Now login to /wp-admin and then activate previously deactivated plugins.

Suggested posts:

  1. How to use nc (netcat) to print headers sent by a browser
  2. How to automate wordpress sandbox setup on Linux
  3. Get file size in bytes on Linux
  4. Csslint – quick command-line tutorial and how to use it for pre-deployment sanity check
  5. How to setup wordpress custom query params with pretty url format
  6. Command line – run python webserver
  7. How to install AWStats on Ubuntu Linux
  8. How to install and monitor memcache for php on Ubuntu Linux
Share this article: share on facebook share on linkedin tweet this submit to reddit
Posted in Tutorials | Tagged Linux, Rsync, Tutorials, Wordpress, Wordpress How To
  • Browse content
  • Article Topics
  • Article archives
  • Contact Us
Popular Topics: Android Development | AngularJS | Apache | AWS and EC2 | Bash shell scripting | Chrome developer tools | Company results | CSS | CSS cookbook | CSS properties | CSS Pseudo Classes | CSS selectors | CSS3 | CSS3 flexbox | Devops | Git | HTML | HTML5 | Java | Javascript | Javascript cookbook | Javascript DOM | jQuery | Kubernetes | Linux | Linux/Unix Command Line | Mac | Mac Command Line | Mysql | Networking | Node.js | Online Tools | PHP | PHP cookbook | PHP Regex | Python | Python array | Python cookbook | SEO | Site Performance | SSH | Ubuntu Linux | Web Development | Webmaster | Wordpress | Wordpress customization | Wordpress How To | Wordpress Mysql Queries | InfoHeap Money

Copyright © 2025 InfoHeap.

Powered by WordPress