Currently we pull the database from a production page to develop environment.
After import we run this commmand to update to local urls
wp search-replace production_url local_url
The problem seems to be the way Gutenberg stores values.
URLs are escaped and become:
https:\/\/www.domain.com
So I ask myself: should wp cli run twice or use two wp search-replace commands?
wp search-replace https://www.production_url https://local_url
wp search-replace https:\/\/www.production_url https:\/\/local_url
Can confirm. These escaped urls are definitely causing problems for my sync script.
Running the command twice seems to be the best way to go for now, but note that I had to wrap things in double quotes in order for the command to work:
wp search-replace "https:\/\/www.production_url" "https:\/\/local_url"
I ran into the same issue. I can confirm that using double quotes around the urls are necessary for the command to work.
Will simple quotes work here too or they need to be double ones?
Most helpful comment
Can confirm. These escaped urls are definitely causing problems for my sync script.
Running the command twice seems to be the best way to go for now, but note that I had to wrap things in double quotes in order for the command to work:
wp search-replace "https:\/\/www.production_url" "https:\/\/local_url"