Support » Fixing WordPress » Managing plugin updates to database with version control

  • We are starting to implement a version control process for our clients’ WP sites. The plan is to have local environments for the sites and repositories for each site that house the theme files and plugin files only. This is pretty standard process from our understanding. We are not using any sort of version control plugin and the staging and local databases will be completely separate because version controlling a database is very hard to manage correctly.

    But a question has come up with when you update a plugin on local, and that plugin makes some modifications to the database. But when we push the changes to the staging server, the old plugin files are simply getting overridden by the push. There is never any update scripts ran like you would if you were to manually update each plugin form the admin panel. So how do you manage a change to the database structure that a plugin makes on update when we’re only pushing files?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Moderator Steve Stern

    (@sterndata)

    Support Team Volunteer

    Plugins *should* check their version and do any necessary updates if necessary. Some, though, put a button on the admin panel if updates are necessary (e.g., WooCommece) so someone has to login to the site and click that button.

    By “checking their version”, you mean just a conditional wrapper around some block code that would or would not work depending on x database field existing?
    Like run this function only if we can successfully query x from the database type thing?
    I think that makes sense. I’ve seen the Woocommerce database update button.

    And if this is the case, we basically have to have our faith in the plugins that they are managing themselves correctly. I don’t think it’s too often that database structure changes that happen, but it definitely does so we need to have a plan.

    Moderator Steve Stern

    (@sterndata)

    Support Team Volunteer

    we basically have to have our faith in the plugins that they are managing themselves correctly

    Yup.

    Read those changelogs carefully.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Managing plugin updates to database with version control’ is closed to new replies.