Skip to content

Instantly share code, notes, and snippets.

@Sacristan
Created June 10, 2014 19:35
Show Gist options
  • Save Sacristan/27ae5468df425518f94c to your computer and use it in GitHub Desktop.
Save Sacristan/27ae5468df425518f94c to your computer and use it in GitHub Desktop.
DB -> Local
ssh [email protected]
pg_dump --format=c -h localhost --username norden nordenhealth > latest.dump
scp [email protected]:/home/deployer/latest.dump ~/Desktop/
source ~/.bashrc && rake db:drop && rake db:create && pg_restore --verbose --clean --no-acl --no-owner -h localhost -U sac -d nordenhealth_development ~/Desktop/latest.dump
rake db:migrate RAILS_ENV=test && rake db:seed RAILS_ENV=test
Local -> DB
source ~/.bashrc && pg_dump --format=c -h localhost --username sac nordenhealth_development > ~/Desktop/t_latest.dump
scp ~/Desktop/t_latest.dump [email protected]:/home/deployer/t_latest.dump
pg_restore --verbose --clean --no-acl --no-owner -h localhost -U norden -d nordenhealth t_latest.dump
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment