Skip to content

Instantly share code, notes, and snippets.

@collymore
Last active August 29, 2015 14:18
Show Gist options
  • Save collymore/a7bfe2bae1c1d788e0f7 to your computer and use it in GitHub Desktop.
Save collymore/a7bfe2bae1c1d788e0f7 to your computer and use it in GitHub Desktop.
grep 'user\|dbname\|pass' local.xml | tr -d '\n' | sed 's/<username><\!\[CDATA\[\(.*\)\]\]><\/username>.*<password><\!\[CDATA\[\(.*\)\]\]><\/password>.*<dbname><\!\[CDATA\[\(.*\)\]\]><\/dbname>/ mysqldump -u\1 -p\2 \3 > \3.sql/g' | sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment