I’ve been looking for a way to optimise the WordPress development workflow we use at Digital Leap and have constantly hit walls when it comes to managing database changes from dev machines to staging, production, and then all the way back (as we make changes to code and content at each stage).
When it comes to managing code changes, using version control tools like Git or
SVN (actually, don’t use SVN) is quite common and there are robust and reliable. When it comes to database changes, on the other hand, merging databases from multiple places is quite tricky. There are a few projects that try and allow for syncing of production and live sites (WP Migrate Pro is a great example) but, from what I understand, it doesn’t cater for merge conflicts.
If you imagine a basic workflow in a team environment, a developer would do some custom code in his dev environment whilst the front-end dev is busy with setting up the theme and pages. Once they’re both done, they have to synchronise and merge what they’ve done and put it onto a staging site for someone to do some QA on it. The major issue is when the person makes changes on the staging site and a developer and / or designer has made changes in their dev environments. This is where VersionPress comes into the picture.
Possible WordPress Development Workflow with VersionPress
At this stage, I’m not sure if it is possible – I’ll be honest with you. VersionPress is still very young and because of that, it’s still lacking very important features. However, the major functionality of merging database changes is there which, I would say, is the most important part of a solution.
At this stage, you can easily merge changes using WP-CLI (this makes it less of a user-friendly solution) and also clone a WordPress website into another staging site on the same server. The fundamental part that is missing, is being able to do this across environments like production, staging (on another server) and dev machines.
I think a possible solution (this is where my limited knowledge of Git shows) is to allow the VersionPress Git repo (yes, it is reliant on Git) to have a remote to your central Git server like Github, Bitbucket etc. Although, I could imagine that this carries its own complexities.
This is no solution but it’s definitely a couple of steps forward and at least allows developers to develop features into websites whilst still being able to bounce back into production copies.
If you’re reading this and going “There is a much easier way to do this!” then I’d love to hear from you!