Skip to content

Instantly share code, notes, and snippets.

@richlloydmiles
Last active January 29, 2018 04:52
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save richlloydmiles/6ae9b84e4d1cb7e714ea79fbb234a235 to your computer and use it in GitHub Desktop.
Save richlloydmiles/6ae9b84e4d1cb7e714ea79fbb234a235 to your computer and use it in GitHub Desktop.
#/bin/bash
cd _seed
FILENAME=$(find . -maxdepth 1 -name [a-zA-Z0-9]*-migrate-[0-9]*.sql.gz)
gunzip ${FILENAME} -c > temp.sql
read -p "New Domain Name e.g. http://example.com: " replacement
cat temp.sql | sed -e "s@##DEV_URL##@${replacement}@g" > temp2.sql
cat temp2.sql | sed -e "s@##DEV_PATH##@${replacement}@g" > new_db.sql
rm -rf temp.sql
rm -rf temp2.sql
#mysql -u root -proot apolitical < new_db.sql
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment