Reputation: 33378
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).
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
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
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:
edit: Please make sure your local database and code is identical to the dev site before the backup.
Upvotes: 1
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
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