Update a buggy installation

You have two tasks to solve here: 1. Resolve the time-out problem. 2. Update WordPress.

Resolve the time-out problem

These things don’t just happen because your WP is old. There must be a concrete reason.

The three most common reasons are:

  1. Not enough memory. Maybe your hosting provider has limited the memory?
    Try adding the following line in your wp-config.php above the “Happy blogging” line:

     define('WP_MEMORY_LIMIT', '256M');
    

    If that doesn’t help, ask your provider.

  2. A very large option is stored in your database and fetched on every request. Go to your database management tool, like phpMyAdmin, and sort the wp_options table (assuming your table prefix is wp_ by the size of the value column. If there is any very large option, consider deleting it. But make a database backup first!

  3. Some plugin is making a request to an external source, overriding WordPress’ pre-set time-out, and the remote site doesn’t respond in time. Disable all plugins, and see if that helps. Then re-enable them one after another, until the issue reappears. Deactivate that plugin, and try to find an alternative.

Update WordPress

  1. Make a backup of your database.
  2. Make a backup of your uploads. They shouldn’t be affected by the update, but it’s always nice to have that backup.
  3. If you are using a default theme (named Twenty-X) and made changes to it — which you absolutely shouldn’t — back up that theme too.
  4. Disable all plugins, and switch to a default theme.
  5. Update WordPress.
  6. Re-enable the theme and the plugins, again one by one, check that everything is working as expected. If it doesn’t, you might need your backups to roll everything back, but that’s not very likely.
  7. Update your plugins.

That’s it.

There are tools like Deployer that can help automate this process, and they make it easy to roll back a broken update within seconds to the last working state. You might want to learn using such a tool.