first of all I have to say this is the most serious issue I’ve ever had with WP until now.
I’ve started using Trellis and Bedrock after I watched this video:
How To Deploy A Bedrock Site with Trellis | WordPress Workflow
This guy mentioned in his video that by using Trellis you get parity for the development & production environment. I followed his instructions and I could set up 3 environments (development, staging and production) without big issues, theme and plugins sync worked fine. What he didn’t mention though, is how the parity of the WP DB works. I have tried several times to accomplish this and I even opened a similar thread some time ago:
The answer of alwaysblank was this:
Those things are probably stored in the database. I don’t believe Trellis includes anything for automated database transfer because reconciling WordPress databases automatically is a hairy problem that AFAIK has not been solved. Generally your options are:
- Manually copy-and-paste over any changes
- Push your entire database, overwriting whatever database exists on the remote server
- Manually resolve database differences in the database itself (which sounds like a nightmare)
I use WP DB Migrate Pro , which is a great plugin, but keep in mind that it is overwriting your databases, not combining them.
The 2nd approach is not a option since there are differences among the DBs.
What I’ve tried so far is create a DB dump from development DB and then try to replace things that are obviously different: user data and urls.
This approach apart from being a big pain and time consuming since normal text editors cannot handle big sql files, it didn’t really work. I’m always ending up with corrupted DBs and some things are getting broken.
I haven’t tried any plugins yet such as the WP DB Migrate Pro or some ansible playbooks related to tellis I found, but I would like to ask again:
How do you guys manage to ensure parity for the WP DB among the different environments?