Update WordPress

Update popular blogging and CMS engine WordPress on fortrabbit.

There are many ways to deploy and develop WordPress. Depending on your work-flow, the way you'll update WordPress and deploy the update might be different. Minor patch versions of WordPress might be updated automatically.

With WordPress, except when using Bedrock or the like, most likely you will just use the update functionality provided by the WordPress admin. Log in to wp-admin: when an update is available, it will inform you and display an "update" button you can click. That will trigger the update. See also the official WordPress docs on updating.

# Update locally first

We recommend to have a local development environment and do the updates locally first and then deploy the changes to fortrabbit. That way you can make sure that everything works in development before doing something in production. While updating the WordPress core, it's likely that the database design will change. The update script will do a migration, converting the tables to the new design while keeping their contents. When you run the installer in your local development and then deploy the new files only, the database version and the file versions do not match. Most likely you will see a warning in "wp-admin" to run the migration from there.

# Parallel updates

To avoid migration struggles you can also keep your local and your remote version of WordPress in sync by running the updates in both environments, one by one. You might start with the local version and when successful, run the installer again on the environment itself.

# Updating plugins and themes

So far we have covered updating the WordPress core, but WordPress wouldn't be WordPress without the eco-system of themes and plugins. Those can and have to be updated as well. The same mechanisms as above apply.

# Keeping your environments in sync

WordPress is a Content can be Managed in that System. So in consequence that means that content is likely to be added and edited on the system — the environment — itself. This content could be blog posts, pages and also media like images. Maybe you are adding them, maybe the client, maybe the editors. Now, if you have been following our recommendation to have a local development environment. WordPress stores the text content of posts and pages in the MySQL database, uploads are stored on the file system. So you need to sync two things:

  1. For the database, check our MySQL article for import/export.
  2. For the files you can either use SFTP or have a look at rsync to synchronize certain folders.

The techniques described work in both directions. Most likely you want to get the newest contents from the environment into your local development environment, but maybe have you local changes that you would like to see on the environment as well.

Found a tpyo?Edit