Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

General Discussion

Ian Hempsell
Ian Hempsell
Courses Plus Student 37,036 Points

WordPress Workflow - Database Sync Issue

I use GIT for my WP file deployment which works well with my development/staging/production server environments but I've run into a db issue while developing new features.

This is my typical workflow when developing a new feature:

  1. Pull the production db to development via Migrate DB ( free version )
  2. Develop feature
  3. Push to staging server for acceptance
  4. Push to production server... SYNC ISSUE HERE!

At step 4, I keep finding myself in the situation where the production db has grown since the initial development Pull due to the client adding more content or new members singing up etc. I'm stuck.

I can't Push the development/staging db to production because the new production data will be overwritten and lost. Equally, I can't Pull the production db back to development/staging because all the new feature work will be overwritten and lost.

How do you WP Guru's handle this everyday situation?

( It might be worth mentioning that I have a core list of plugins that effect the tables within my db which may or may not require updating due to the feature development: ACF, Gravity Forms ( plus add-ons ), s2member )

2 Answers

Zac Gordon
Zac Gordon
Treehouse Guest Teacher

Unfortunately, there is not a universal good resolution for the very common problem you're describing. I would say though that Brad Touesnard the developer of the WP Migrate DB plugin has done the most work in this area. I was looking to see if there were any talks of his on WordCamp.tv, but I didn't see any. You may want to look into if the Pro version and the live sync can help you do what you need.

Ian Hempsell
Ian Hempsell
Courses Plus Student 37,036 Points

Hey Zac, thanks for your response.

Unfortunately, I have already tried the Migrate DB plugin and it is a brilliant tool for straight push / pull's but it doesn't handle the merge issue that I'm experiencing now that my site is live with frequent user / content updates.

Maybe this could be a topic your further discussion in the future as students will inevitably come across this difficult situation.

Keep up the good work, Ian.