-
Notifications
You must be signed in to change notification settings - Fork 44
Description
From wp-cli/wp-cli#3777
There should be a way to see the changes that a search-replace would make. This would be especially valuable to use with
--regexflag, where your changes can get out of control if you don't see what's going on.The current export feature is a bit underpowered because it generates a huge SQL file for the site. There's no easy way to see what exactly is changing.
I think we need a report feature that generates a from/to report for each table (that's changing). I would suggest using something like WP's built-in Text Diff or PHP-diff for a diff column.
There are lots of false-positives. For example, plugins that have had their PHP classes change (new properties). The unserialize will add with the newer properties from the PHP class. It will be "incorrectly" reported as a replacement. This is probably unavoidable since this has to happen at some point. However, number 1 (above) could alleviate the confusion from this.
[...]
The summary is not sufficient. It raises eyebrows for falsepositives (rare case though). I'm always wary of what it is going to replace before I execute the replace.
The idea is coming from in-house BU search-replace script that does diffs using php-diff and outputs them into CSV files. It lacks regex searching. We're in the mode to adopt wp-cli more in the future, hence the feature request.