Created
January 11, 2020 14:34
-
-
Save dionedomingo/0aa5a57a2f021d79fb93e19a5534110b to your computer and use it in GitHub Desktop.
Database Sync
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
HTTPAUTH_USER='root' | |
HTTPAUTH_PASS='root' | |
HTTPD_DUMP_URL= | |
wget --user={$HTTPAUTH_USER} --password={$HTTPAUTH_PASS} -O /tmp/dump.sql.gz {$HTTPD_DUMP_URL}/latest.sql.gz | |
mysql -uroot -proot --silent --skip-column-names -e "SHOW TABLES" staging | xargs -L1 -I% echo 'DROP TABLE `%`;' | sudo mysql -uroot -proot -v staging | |
gunzip /tmp/dump.sql.gz | |
sudo mysql -u root staging < /tmp/dump.sql -v | |
sudo rm /tmp/dump.sql | |
# sudo rm /tmp/dump.sql.gz | |
cd /var/www/staging/ | |
drush cr | |
drush cim |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment