add export-wp-content-db.sh
This commit is contained in:
parent
c107c755fc
commit
c3351b557d
|
@ -0,0 +1,3 @@
|
|||
Exports a local WordPress installation's database and
|
||||
`wp-content/` files to a remote installation.
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
#!/bin/sh
|
||||
|
||||
remote_domain='some.cloudwaysapps.com'
|
||||
remote_ssh='user@some.cloudwaysapps.com'
|
||||
remote_wp_path='/home/some.cloudwaysapps.com/aabbccddee/public_html'
|
||||
|
||||
local_domain='example.local'
|
||||
local_wp_path='/var/www/html/wordpress'
|
||||
|
||||
rsync -azP wp-content/ "$remote_ssh:$remote_wp_path/wp-content" --delete-before
|
||||
|
||||
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"
|
||||
|
||||
wp search-replace "$local_domain" "$remote_domain" \
|
||||
--ssh="$remote_ssh$remote_wp_path" \
|
||||
--skip-columns=guid
|
Loading…
Reference in New Issue