customization – Applying WP-cli Search & Replace to Static SQL Dump File

Question

I have a wp db dump file inside my site directory. Can someone show me an example of how to use wp-cli search and replace command on the static sql file, not the active db to change my url from “old-example.com” to “new-example.com”

/var/www/html/wp-site.com/dumps/oldexample.com/dumpeddb.sql

/var/www/html/wp-site.com/dumps/newexample.com/ready-for-import.sql

Not quite sure how to apply this to already exported db dump.
$wp search-replace foo bar --export=database.sql

in progress 0
yupthatguy 1 month 2021-10-21T17:21:35-05:00 0 Answer 0 views 0

Answer ( 1 )

    0
    2021-10-23T03:31:47-05:00
    wp search-replace will only work to the current database which is configured in wp-config.php

Leave an answer

Browse
Browse