• I’m using wp search-replace <old-value> <new-value> to update the url and home-directory during migrations.
    I just encountered a case where fo home-directory it missed to identify and replace one of the matching records in wp_options table. Here is the sample of the command I use:

    
    wp search-replace \
       "/Users/webdev/workspace/website" \
       "/home/website/live.website.io" \
       --dry-run --report-changed-only --precise
    

    I tried with and without quotes, both single and double quotes, with and without --precise and --recurse-objects, but the same problem.

    To verify that it is not a problem in my input, I use the following command to search database and it does return that record (this is only a problem when using wp search-replace):
    wp db search "/Users/webdev/workspace/website"

    I’m on macOS 11.6 with wp-cli 2.5.0, and for what it might worth the target WP installation is latest version 5.8.2.

    • This topic was modified 4 years, 4 months ago by hanvari.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Hello,

    I don’t know what --report-changed-only but I usually use

    
    wp search-replace \
       "/Users/webdev/workspace/website" \
       "/home/website/live.website.io" \
       --dry-run --all-tables --precise
    

    Does this help ?

    • This reply was modified 4 years, 4 months ago by Sebastien SERRE. Reason: try to format code
    Thread Starter hanvari

    (@hanvari)

    The --report-changed-only is not a functional switch, it just limits the report to the tables that have changed record.

    I have already tried the command you suggested and no success.
    It is a weird thing happening.
    wp db search finds the values, but wp search-replace does not.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘wp search-replace missing some occurences’ is closed to new replies.