Skip to content

Instantly share code, notes, and snippets.

@dharma017
Forked from retlehs/sync-prod.sh
Created December 30, 2016 04:42
Show Gist options
  • Save dharma017/250e259e47d85c419c141edd2d6f5e88 to your computer and use it in GitHub Desktop.
Save dharma017/250e259e47d85c419c141edd2d6f5e88 to your computer and use it in GitHub Desktop.
WP-CLI aliases sync example
read -r -p "Would you really like to reset your development database and pull the latest from production? [y/N] " response
if [[ $response =~ ^([yY][eE][sS]|[yY])$ ]]
then
wp @development db reset --yes
wp @production db export - > sql-dump-production.sql
wp @development db import sql-dump-production.sql
wp @development search-replace https://example.com https://example.dev
else
exit 0
fi
path: web/wp
@production:
ssh: web@example.com/srv/www/example.com/current
@development:
ssh: vagrant@example.dev/srv/www/example.com/current
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment