How do you push database changes to server?


(Damith) #1

After you finish building a WP site, it isn’t hard to move to the server. You need to just add files to server and you can export the DB. You need to run a plugin like domain changer.

But how did you guys do for already build sites.

Let say, I have build a site for a client with using plugin like Elementor, ACF, etc. After a few month client request new changes. I may have to add custom fields, custom post types, build some pages using page builder, etc.

So change happens in both theme files and database… Moving theme files to server isn’t hard. But how do I update the database?


#2

It depends on the size of the site, and how many users, content updates, etc.

For a small site I might just build everything on the production site. We can keep content unpublished, that kind of thing.

Larger projects get one or more staging sites, where the work is done.

But my work doesn’t normally change the database. If you are building content (text and assets), then you might consider using the WordPress export/import. It works fine with CPTs.


(Leland Fiegel) #3

You would have to do something like:

  • Import production database to your staging/development site.
  • Do the work
  • Import staging/development database to production site.

Now, if there are changes made on the production site during the “do the work” phase, things get a bit trickier.

This is an ongoing painpoint with WordPress sites. There was something called Mergebot that helped in these situations but they shut down.

Without that, you would need to discuss with the client to maybe “freeze” content updates so databases didn’t get too out of sync.


(Damith) #4

Thanks. Currently, I extractly do the way you provide. But it is not easy. I mean it may missing comments, worst case orders. :frowning: Sure i can make it to maintenance mode. But clients are not like it :frowning: