Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/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_user} -p${local_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
Add Comment
Please, Sign In to add comment