How can I sync WordPress plugin settings between environments?

I currently:

  • Have identical environments for development (vagrant) and production (elastic beanstalk).

  • Use git push to deploy code from the development to the production environment.

  • Create posts and pages using the production environment’s WordPress.

  • Import the production database into the development database to stay in sync.


While I know this strategy works, I feel lost when thinking about how to best manage the installation, activation and — most importantly — synchronization of WordPress’ Plugins.

Installing plugins makes sense… Download. Commit. Deploy. And all environments will have the plugin available.

Activating and synchronizing plugin settings isn’t as clear… Do I need to manually activate and setup each plugin on all environments, or can that be synced between them?

I know each plugin can have unique way of storing data, but I would think with both file and database synchronization everything would match up. Am I missing something?

1
1

The reliable two–way sync is simply not something that have happened in WordPress.

The typical way is in line with what you are doing — pulling a copy of production database into development environment. Note that this is commonly the one direction it goes. It’s much more problematic to try sync development back to production.

As far as plugin configuration specifically is concerned:

  1. Call it good enough and treat production as authoritative state
  2. Have codified install/update procedures, which dictate desired state of plugin options
  3. Override plugins’ options storage and/or internal hooks

The practical choice to go with would depend on specific plugins used and how complicated the state of their settings to be captured and/or reproduced is.

Leave a Comment