-
-
Save serguk89/f607171c56aea83d5a4141f1a8175cbb to your computer and use it in GitHub Desktop.
WP-CLI aliases sync example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
#!/usr/bin/env bash
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 @staging db reset --yes &&
wp db export sql-dump-dev.sql --add-drop-table &&
wp @staging db import - < sql-dump-dev.sql &&
wp @staging search-replace http://strefatradera.l http://strefatradera.ufff.pl
fi