dev-scripts/scripts/wordpress/export-wp-content-db.sh

22 lines
689 B
Bash
Raw Normal View History

2020-09-09 09:33:51 +00:00
#!/bin/sh
2020-09-09 10:54:46 +00:00
. ./config
2020-09-09 09:33:51 +00:00
2020-09-09 10:50:37 +00:00
rsync -azP "$local_wp_path/wp-content/" "$remote_ssh:$remote_wp_path/wp-content" --delete-before
2020-09-09 09:33:51 +00:00
echo "DB size before:"
wp db size --ssh="$remote_ssh$remote_wp_path"
wp db export --path="$local_wp_path" --add-drop-table - | wp db import --ssh="$remote_ssh$remote_wp_path" -
echo "DB size after:"
wp db size --ssh="$remote_ssh$remote_wp_path"
2020-09-09 10:50:37 +00:00
wp search-replace "$local_protocol://$local_domain" "$remote_protocol://$remote_domain" \
--ssh="$remote_ssh$remote_wp_path" \
--skip-columns=guid
--quiet
2020-09-09 09:33:51 +00:00
wp search-replace "$local_domain" "$remote_domain" \
--ssh="$remote_ssh$remote_wp_path" \
--skip-columns=guid
2020-09-09 10:50:37 +00:00
--quiet