Skip to navigation
Import and find and replace via docker wordpress database
29.07.20
#!/bin/bash # set here your settings: db_server=foo db_user=foo db_pass=barbar db_name=foodb name="$( uname -n)" from='https://www.foo.com' to='http://127.0.0.1' echo "...import from init to " docker run -i --rm --net=host salamander1/mysql -h 127.0.0.1 --user=$db_user -p$db_pass $db_name < init/$db_name.sql echo "...replace wordpress from ${from} to ${to}" docker run --add-host $db_server:127.0.0.1 --net=host -v "$(dirname "$(pwd)")":`pwd` -w `pwd` -i --rm wordpress:cli wp search-replace "${from}"
https://wp-cli.org/
Reply
Anonymous
Information Epoch 1732585571
Design for simplicity, add complexity only where you must.
Home
Notebook
Contact us