29 lines
957 B
Bash
29 lines
957 B
Bash
|
#!/bin/sh
|
||
|
|
||
|
remote_protocol='https'
|
||
|
remote_domain='wordpress-453075-1468300.cloudwaysapps.com'
|
||
|
remote_ssh='test123@wordpress-453075-1468300.cloudwaysapps.com'
|
||
|
remote_wp_path='/home/453075.cloudwaysapps.com/mhhusspndh/public_html'
|
||
|
|
||
|
local_protocol='http'
|
||
|
local_domain='thecampsitebible.home'
|
||
|
local_wp_path='/var/www/html/wordpress'
|
||
|
|
||
|
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
|