Skip to content

Instantly share code, notes, and snippets.

@marushu
Created June 1, 2017 02:38
Show Gist options
  • Save marushu/d7649395fb8067bd146ca3e7bc311823 to your computer and use it in GitHub Desktop.
Save marushu/d7649395fb8067bd146ca3e7bc311823 to your computer and use it in GitHub Desktop.
Backup from remote datas.
#!/bin/sh
# Important!! Run this command in the vccw directory.
# Backup from remote
# - Login to vagrant
# - Fire wordmove pull -tup
# - Make backup.sql
# - Download backup.sql using scp.
# - Fire wp db import and search-replace.
vagrant ssh -c "cd /vagrant && wordmove pull -tpu" && ssh nickname -t "cd /path/to/wordpress && /path/to/wp-cli db export backup.sql" && scp nickname:/path/to/wordpress/backup.sql . && cd /path/to/wordpress && wp db import /path/to/backup.sql && wp search-replace 'remote(old)' 'local(new)'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment