$conf, $runtime; function_exists('chdir') AND chdir(APP_PATH); $r = 'mysql' == $conf['cache']['type'] ? website_set('runtime', $runtime) : cache_set('runtime', $runtime); } function runtime_truncate() { global $conf; 'mysql' == $conf['cache']['type'] ? website_set('runtime', '') : cache_delete('runtime'); } register_shutdown_function('runtime_save'); ?>migration - Migrate Changes from a Staging Site to Production|Programmer puzzle solving
最新消息:Welcome to the puzzle paradise for programmers! Here, a well-designed puzzle awaits you. From code logic puzzles to algorithmic challenges, each level is closely centered on the programmer's expertise and skills. Whether you're a novice programmer or an experienced tech guru, you'll find your own challenges on this site. In the process of solving puzzles, you can not only exercise your thinking skills, but also deepen your understanding and application of programming knowledge. Come to start this puzzle journey full of wisdom and challenges, with many programmers to compete with each other and show your programming wisdom! Translated with DeepL.com (free version)

migration - Migrate Changes from a Staging Site to Production

matteradmin8PV0评论

Is there a tool that allows me to "record" changes to a staging site and later replay them on production?

It is a common usecase for me to set up a staging site (Duplicator is great for that) and implement design changes (including menus, etc.) there for the customer to review. Those changes at some point need to go to production. Works well with files (plugins, themes), but not with the database.

The production system is being used all the time and authors will add content while I'm working on the staging site. Hence I can't simply copy over the whole posts table.

Instead I'd need a solution that records any SQL statement made to selected tables and replays them on production later on. Is there such a solution out there?

Is there a tool that allows me to "record" changes to a staging site and later replay them on production?

It is a common usecase for me to set up a staging site (Duplicator is great for that) and implement design changes (including menus, etc.) there for the customer to review. Those changes at some point need to go to production. Works well with files (plugins, themes), but not with the database.

The production system is being used all the time and authors will add content while I'm working on the staging site. Hence I can't simply copy over the whole posts table.

Instead I'd need a solution that records any SQL statement made to selected tables and replays them on production later on. Is there such a solution out there?

Share Improve this question asked Mar 8, 2019 at 19:48 user153119user153119 1
  • 2 The short answer here is no. Delicious Brains was working on a solution for this called Mergebot and gave up after dumping time and money into it for 2 years. – mrben522 Commented Mar 12, 2019 at 18:36
Add a comment  | 

1 Answer 1

Reset to default 0

Note: This is more a comment than an answer, but I wanted to format it nicely.

I don't know about recording, but I imagine something like the following in SQL could work.

INSERT INTO         DB1.Tbl1 ( id, x, y )
  SELECT            DB2.Tbl1.id, DB2.Tbl1.x, DB2.Tbl1.y
    FROM            DB2.Tbl1  
  ON DUPLICATE KEY  
    UPDATE          x=x, y=y;

Beware, this is completely untested. You have to test it and read up on the documentation yourself.

Post a comment

comment list (0)

  1. No comments so far