add restore script
This commit is contained in:
parent
114a10445f
commit
a6619f05f5
|
@ -0,0 +1,23 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
. ./config
|
||||||
|
|
||||||
|
[ -z "$1" ] && echo "Error - must supply backup directory" && exit 45
|
||||||
|
! [ -d "$1" ] && echo "Error - '$1' not a directory" && exit 65
|
||||||
|
backup_dir="$1"
|
||||||
|
|
||||||
|
echo "restoring from $backup_dir"
|
||||||
|
|
||||||
|
cat "$backup_dir/$backup_dir.tar" | ssh "$remote_ssh" "cd /; tar zxf -"
|
||||||
|
|
||||||
|
cat "./$backup_dir/$backup_dir.sql" | wp db import --ssh="$remote_ssh$remote_wp_path" -
|
||||||
|
|
||||||
|
wp search-replace "$local_protocol://$local_domain" "$remote_protocol://$remote_domain" \
|
||||||
|
--ssh="$remote_ssh$remote_wp_path" \
|
||||||
|
--skip-columns=guid \
|
||||||
|
--quiet
|
||||||
|
|
||||||
|
wp search-replace "$local_domain" "$remote_domain" \
|
||||||
|
--ssh="$remote_ssh$remote_wp_path" \
|
||||||
|
--skip-columns=guid \
|
||||||
|
--quiet
|
Loading…
Reference in New Issue