Compare commits

..

No commits in common. "a6619f05f523ea4588b77743980bcd87d2a4cdc3" and "0e526b24544c1c5ae41419f9d4e81ca8fed7e9c0" have entirely different histories.

2 changed files with 1 additions and 24 deletions

View File

@ -8,7 +8,7 @@ time="$(date +%s)"
echo "backing up to $base_filename" echo "backing up to $base_filename"
ssh "$remote_ssh" mkdir "/tmp/$base_filename" ssh "$remote_ssh" mkdir "/tmp/$base_filename"
ssh "$remote_ssh" tar -czf "/tmp/$base_filename/$base_filename.tar" "$remote_wp_path/wp-content" ssh "$remote_ssh" tar -cvzf "/tmp/$base_filename/$base_filename.tar" "$remote_wp_path/wp-content"
wp db export "/tmp/$base_filename/$base_filename.sql" --ssh="$remote_ssh$remote_wp_path" --add-drop-table wp db export "/tmp/$base_filename/$base_filename.sql" --ssh="$remote_ssh$remote_wp_path" --add-drop-table
scp -r "$remote_ssh:/tmp/$base_filename" . && ssh "$remote_ssh" rm -r "/tmp/$base_filename" scp -r "$remote_ssh:/tmp/$base_filename" . && ssh "$remote_ssh" rm -r "/tmp/$base_filename"

View File

@ -1,23 +0,0 @@
#!/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