Created
August 16, 2014 23:44
-
-
Save westonruter/a70723378a847271db36 to your computer and use it in GitHub Desktop.
Script to help transfer databases from Varying Vagrant Vagrants (VVV) 1.1 to 1.2
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
#!/bin/bash | |
cd /srv/www | |
mkdir vvv-upgrade-backups | |
find /etc/nginx/custom-sites/ -name '*.conf' | xargs grep -h 'root' | grep '/' | sed 's:\s*root\s\s*::' | sed 's:;$::' > roots.txt | |
for root in $(cat roots.txt); do | |
echo $root; | |
cd $root; | |
filename=$( echo $root | sed 's:/srv/www/::' | sed 's:/:-:g' ).sql; | |
wp db export /srv/www/vvv-upgrade-backups/$filename; | |
done; | |
cd /srv/www |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment