Created
November 13, 2018 16:20
-
-
Save morungos/c12d2c1e0f11238f505b664d8048bedf to your computer and use it in GitHub Desktop.
Stuart's script for grabbing MySQL data over ssh and dumping into sqlite3
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
ssh aps1.cluster.turalt.com mysqldump --complete-insert --compatible=ansi --no-create-db --no-create-info --ignore-table=turalt.knex_migrations --ignore-table=turalt.knex_migrations_lock --skip-opt -uturalt -pturalt turalt | sed -e 's/\\\"/"/g' | sed -e "s/\\\'/''/g" > ~/compatible-ansi.sql | |
rm dev.sqlite3 | |
npx knex migrate:latest | |
sqlite3 dev.sqlite3 | |
sqlite> begin transaction; | |
sqlite> .read /Users/stuart/compatible-ansi.sql | |
sqlite> commit; | |
sqlite> .quit |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment