dev-scripts/tools/wp-content-db/import-wp-content-db.sh

22 lines
650 B
Bash
Raw Normal View History

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