Guest User

Untitled

a guest
Sep 2nd, 2018
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. #!/bin/bash -v
  2.  
  3. #Remote
  4. remote_user=
  5. remote_ip=
  6. remote_db=
  7. remote_db_user=
  8. remote_db_password=
  9.  
  10. #Local
  11. local_db=
  12. local_db_user=
  13. local_db_password=
  14. home_url=
  15. prefix=wp_
  16.  
  17.  
  18. #Let's go
  19. 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}
  20.  
  21. 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')"
  22.  
  23. cd web
  24.  
  25. wp cache flush
Add Comment
Please, Sign In to add comment