Last active
August 29, 2015 14:02
-
-
Save alksl/87b98489d6cb98e64b4d to your computer and use it in GitHub Desktop.
This file contains hidden or 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/zsh | |
| if [ "$#" -ne 2 ]; then | |
| echo "Usage: $0 [infile] [outfile]" | |
| exit 1 | |
| fi | |
| export PGPASSWORD=password | |
| pushd gitlab-5-0 | |
| RAILS_ENV=production bundle exec rake db:drop db:create db:migrate | |
| popd | |
| psql -h 10.0.1.11 -U postgres -d gitlabhq_production -f $1 | |
| pushd gitlab-7-0; | |
| RAILS_ENV=production bundle exec rake db:migrate | |
| popd | |
| pg_dump -h 10.0.1.11 \ | |
| -U postgres \ | |
| --no-privileges \ | |
| --no-acl \ | |
| --no-owner \ | |
| --clean \ | |
| gitlabhq_production > $2 | |
This file contains hidden or 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 | |
| if [ "$#" -ne 2 ]; then | |
| echo "Usage: $0 [user] [database]" | |
| exit 1 | |
| fi | |
| echo "UPDATE pg_cast SET castcontext='a' WHERE casttarget = 'boolean'::regtype;" | |
| echo "SET standard_conforming_strings=off;" | |
| echo "SET escape_string_warning=off;" | |
| echo "SET CONSTRAINTS ALL DEFERRED;" | |
| mysqldump --no-create-info \ | |
| --skip-triggers \ | |
| --compatible=postgresql \ | |
| --default-character-set=utf8 \ | |
| --skip-add-locks \ | |
| --single-transaction \ | |
| --skip-comments \ | |
| --ignore-table=${2}.schema_migrations \ | |
| -u $1 -p $2 | |
| echo "UPDATE pg_cast SET castcontext='e' WHERE casttarget = 'boolean'::regtype;" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment