Last active
September 2, 2018 13:58
-
-
Save 4selin/e944fd930498bace0b1dcb576a0c7b65 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -v | |
#Remote | |
remote_user= | |
remote_ip= | |
remote_db= | |
remote_db_user= | |
remote_db_password= | |
#Local | |
local_db= | |
local_db_user= | |
local_db_password= | |
home_url= | |
prefix=wp_ | |
#Let's go | |
ssh ${remote_user}@${remote_ip} "mysqldump -u${remote_db_user} -p${remote_db_password} ${remote_db} | gzip -3 -c" | gunzip | mysql -u${local_db_user} -p${local_db_password} ${local_db} | |
mysql -u${local_db_user} -p${local_db_password} -e "UPDATE ${local_db}.${prefix}options SET option_value = '${home_url}' WHERE option_name IN ('siteurl','home')" | |
cd web | |
wp cache flush |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment