Skip to content

Instantly share code, notes, and snippets.

@JosephMaxwell
Last active April 26, 2016 21:34
Show Gist options
  • Save JosephMaxwell/9a4f0295f7f848b7774f to your computer and use it in GitHub Desktop.
Save JosephMaxwell/9a4f0295f7f848b7774f to your computer and use it in GitHub Desktop.
Make production Magento database into development-ready database
# USAGE: cleanup.sh input-file.sql output-file.sql "www.production-site.com" "dev.production-site.com"
awk '!/INSERT INTO `customer_(entity|address)/' $1 \
| awk '!/INSERT INTO `log_/' \
| awk '!/INSERT INTO `m2epro_/' \
| awk '!/INSERT INTO `sales_/' \
| awk '!/INSERT INTO `report_viewed_/' \
| awk '!/INSERT INTO `load_/' \
| sed "s/$3/$4/; s/http:\/\/$3/http:\/\/$4/; s/https:\/\/$3/http:\/\/$4/" \
> $2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment