emersonthis
emersonthis

Reputation: 33378

Running Wordpress updates while in production?

We have a production site powered by Wordpress. In my experience, Wordpress updates tend to go pretty smoothly, but every now an then something goes wrong and so we always run the updates locally or on our dev site first to make sure nothing breaks.

My questions is this: Is it a good practice to commit those changes (from the upgrade) locally and then push the changes to production? ...effectively updating the production site? This seems to work, but I know that sometimes updates include modifications to the database. So my fear is that the update will modify my local DB, but NOT the production DB and then cause problems when the newer code runs (expecting the DB to have been modified).

  1. Is this is valid concern?
  2. Will well-written plugins account for this issue somehow?
  3. Is there an entirely different and better way to do this?

UPDATE: I think the purpose of this question was initially unclear. I know very well that I can run the update locally, test it, commit, then run the update in production, commit, then merge. That's what we currently do but it sucks and I'm not sure if it's even necessary. The point of this question is to figure that out, or learn a better way. For example, if someone knows something definitive about the nature of WP updates and how they handle DB modifications, it would pretty much answer this question.

Upvotes: 0

Views: 641

Answers (4)

Rene Hermenau
Rene Hermenau

Reputation: 343

I prefer a tool like WP Staging to create a test site with a few clicks. Than i update all plugins and if everything is fine, i do the same process on my production site. You find WP Staging on wordpress.org

Upvotes: 1

C13L0
C13L0

Reputation: 611

Even though it takes a few minutes extra, always stick to best practices. Complete updates locally then push to the dev site. On occasion, a plugin will have a database change but not documented properly.

Best Practice:

  1. Wait a day after the update then read the issue queue on the plugin . If other people had problems with the update, you will know ahead of time.
  2. Backup the database
  3. git status/git commit, making sure the branch is clean/make any needed commit
  4. Complete all necessary updates
  5. Clear all cache (twice)
  6. Check to make sure all is running smoothly locally.
  7. If there was a database change from the update Make a new database backup.
  8. Push changes to the dev site
  9. If there was a database change Restore database from #7

edit: Please make sure your local database and code is identical to the dev site before the backup.

Upvotes: 1

datasage
datasage

Reputation: 19563

If you are able to successfully execute the update in a test environment, you should be able to then execute the same update in your production environment. It might be a bit more work, but its going to give you the most information on whether or not an update will work.

If you are in a virtualzied environment, you should be able to copy your production virtual machine to test the upgrade.

Upvotes: 1

rancake
rancake

Reputation: 24

Just make sure you save a copy of your work before doing anything. Also, always check what the update is, sometimes it's just a language add-on which you probably don't need.

Upvotes: -1

Related Questions