20

I've tried to be as descriptive in the title as possible, and I know this question has been asked in before in various forms but I could not find good answer to it and it's are to imagine that no one has solved this issue.

It's simple, once a WP site is live, if it is not a static one then it keeps updating it's database by having new posts added, new woocommerce orders, new user accounts etc'

If I want to make some major changes and updates to the site, the simplest and easiest way to do this is by making a copy either to a local install or to another development domain, and making all the changes there. Once all the changes are done I want to copy them back to the live site.

If the changes are to files only, like theme and css, that's somewhat easy. However, if the changes involve changes in the database, like adding new plugins and adding content that connects/relate to these plugins, then I no longer can just copy the site back, because it will override any new changes that got added to the live site's database. all new posts, new orders, new image uploads, will all be erased.

Now I know that different case scenarios have different solutions, but isn't there a method that address all cases?

For example, if the only changes that were made to the live site were new posts, then I can export and import the posts to the dev site and then move the entire site over. Same with some other items, but not every kind of item. And the other problem with this is that the export and import function in wordpress is abysmal. It is so rudimentary and you have very little options to select and export only specific items. I've probably tried every "advanced import/export" plugin out there and nothing has yet to solve this issue.

So in another thread, someone pointed out this plugin to basically install and work on a theme on the live site, while the regular users still see the existing theme, but that still doesn't solve all types of changes. because if you want to make changes to content, let's say the footer or nav menu, it is things that will still reflect in the existing viewable theme/site and might look ok on the new test theme but not the live one.

Is there no way to develop a "branch" of a site on the same site/database and then switch? or is there no way to develop on a dev site but then actually merge databases in a non-destructive way? If you know which components and things you affected, wouldn't there be a way to do that? or would you need to be a MySQL master to attempt such a thing.

I can't be the only one having this conundrum. I can't imagine there is no solution for this issue. How can this be done?

Thanks in advance.

  • 3
    Everyone has this problem and there is no simple solution, keep the code in revision control, dump sql often to a staging server, create maintenance lockouts during migrations (5-10min). – Wyck Mar 10 '14 at 1:11
  • I'd disagree. CrowdFavorite's RAMP plugin is a simple solution for those that do need to stage and deploy content. Calling it a "simple solution" might be a stretch, but it's good and any developer should be able to set it up (requires SSH and remote MySQL access etc..) – jb510 Mar 22 '14 at 6:29
  • Has anyone tried sitepush? I don't mind paying $250 for Ramp if it is a better solution but it is hard to see from the outside how well these systems work without full deployment and testing i guess. – James Mar 23 '14 at 16:17
  • Haven't used sitepush. Sounds like it pushes complete DB's though (like Migrate WP DB Pro). It's good for deploying a static site, but fails on a live dynamic (ie. new posts/comments happening). RAMP actually manages difference between DBs and merges, not replaces the live DB. – jb510 Apr 8 '14 at 7:18
  • You might want to use DBV PHP, an open source project, putting your DB under version control. It even has a UI to make management easy. Another option would be to switch to for e.g. Laravel, which has a migration tool built into its CLI app. – kaiser Dec 15 '16 at 22:59
2

Really no easy way to do what you are wanting to do, but what I would do is make a snapshot of your site, implement yoru changes and if anything brakes restore and try again. It might be down for an hour, but I just recently did this when I somehow bricked a site I was working on. This might not be the "right" way to solve the problem however for me it works. Good luck.

  • How can be possible that WP team hasn't think on a profesional way of doing this? it is 2018!! – asael2 Apr 9 '18 at 15:02

protected by Community Dec 15 '16 at 22:56

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.