Skip to content

Instantly share code, notes, and snippets.

@davidleandro
Last active April 3, 2025 18:31
Show Gist options
  • Save davidleandro/d6b4f2961dd344d16484 to your computer and use it in GitHub Desktop.
Save davidleandro/d6b4f2961dd344d16484 to your computer and use it in GitHub Desktop.

Revisions

  1. davidleandro revised this gist Apr 3, 2025. 1 changed file with 6 additions and 1 deletion.
    7 changes: 6 additions & 1 deletion Baixar banco Heroku
    Original file line number Diff line number Diff line change
    @@ -4,4 +4,9 @@ heroku pg:backups:capture --app APPNAME
    rm -rf latest.dump
    heroku pg:backups:download --app APPNAME
    pg_restore --verbose --clean --no-acl --no-owner -h localhost -d DATABASE latest.dump
    rails db:migrate
    rails db:migrate



    /usr/lib/postgresql/16/bin/pg_dump `heroku config:get DATABASE_URL -a APPNAME` -F p > latest.sql
    psql -h localhost -U davidleandro -d DATABASE < latest.sql
  2. davidleandro revised this gist Feb 25, 2025. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions Baixar banco Heroku
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,7 @@
    dropdb DATABASE
    rails db:create
    heroku pg:backups:capture --app APPNAME
    rm -rf latest.dump
    heroku pg:backups:download --app APPNAME
    pg_restore --verbose --clean --no-acl --no-owner -h localhost -d DATABASE latest.dump
    rails db:migrate
  3. davidleandro revised this gist Feb 21, 2025. 1 changed file with 6 additions and 3 deletions.
    9 changes: 6 additions & 3 deletions Baixar banco Heroku
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,6 @@
    heroku pg:backups capture --app APPNAME
    curl -o latest.dump `heroku pg:backups public-url --app APPNAME`
    pg_restore --verbose --clean --no-acl --no-owner -h localhost -d DATABASE latest.dump
    dropdb DATABASE
    rails db:create
    heroku pg:backups:capture --app APPNAME
    heroku pg:backups:download --app APPNAME
    pg_restore --verbose --clean --no-acl --no-owner -h localhost -d DATABASE latest.dump
    rails db:migrate
  4. davidleandro revised this gist Aug 29, 2022. 1 changed file with 1 addition and 3 deletions.
    4 changes: 1 addition & 3 deletions Baixar banco Heroku
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,3 @@
    heroku pg:backups capture --app APPNAME
    curl -o latest.dump `heroku pg:backups public-url --app APPNAME`
    pg_restore --verbose --clean --no-acl --no-owner -h localhost -d DATABASE latest.dump

    /Applications/Postgres.app/Contents/Versions/12/bin/pg_restore --verbose --clean --no-acl --no-owner -h localhost -d DATABASE latest.dump
    pg_restore --verbose --clean --no-acl --no-owner -h localhost -d DATABASE latest.dump
  5. davidleandro revised this gist May 12, 2020. 1 changed file with 3 additions and 1 deletion.
    4 changes: 3 additions & 1 deletion Baixar banco Heroku
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,5 @@
    heroku pg:backups capture --app APPNAME
    curl -o latest.dump `heroku pg:backups public-url --app APPNAME`
    pg_restore --verbose --clean --no-acl --no-owner -h localhost -d DATABASE latest.dump
    pg_restore --verbose --clean --no-acl --no-owner -h localhost -d DATABASE latest.dump

    /Applications/Postgres.app/Contents/Versions/12/bin/pg_restore --verbose --clean --no-acl --no-owner -h localhost -d DATABASE latest.dump
  6. davidleandro revised this gist Jul 11, 2016. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions Baixar banco Heroku
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,3 @@
    heroku pg:backups capture
    curl -o latest.dump `heroku pg:backups public-url`
    heroku pg:backups capture --app APPNAME
    curl -o latest.dump `heroku pg:backups public-url --app APPNAME`
    pg_restore --verbose --clean --no-acl --no-owner -h localhost -d DATABASE latest.dump
  7. davidleandro revised this gist May 26, 2015. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions Baixar banco Heroku
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,3 @@
    heroku pg:backups capture
    curl -o latest.dump `heroku pg:backups url`
    pg_restore --verbose --clean --no-acl --no-owner -h localhost -d DATABASE latest.dump
    curl -o latest.dump `heroku pg:backups public-url`
    pg_restore --verbose --clean --no-acl --no-owner -h localhost -d DATABASE latest.dump
  8. davidleandro revised this gist Apr 13, 2015. 1 changed file with 3 additions and 3 deletions.
    6 changes: 3 additions & 3 deletions Baixar banco Heroku
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,3 @@
    heroku pgbackups:capture --expire
    curl -o latest.dump `heroku pgbackups:url`
    pg_restore --verbose --clean --no-acl --no-owner -h localhost -d inside_development latest.dump
    heroku pg:backups capture
    curl -o latest.dump `heroku pg:backups url`
    pg_restore --verbose --clean --no-acl --no-owner -h localhost -d DATABASE latest.dump
  9. davidleandro revised this gist Mar 2, 2015. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion Baixar banco Heroku
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,3 @@
    heroku pgbackups:capture
    heroku pgbackups:capture --expire
    curl -o latest.dump `heroku pgbackups:url`
    pg_restore --verbose --clean --no-acl --no-owner -h localhost -d inside_development latest.dump
  10. davidleandro revised this gist Jan 14, 2015. 1 changed file with 0 additions and 2 deletions.
    2 changes: 0 additions & 2 deletions Baixar banco Heroku
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,3 @@
    heroku update
    heroku addons:add pgbackups
    heroku pgbackups:capture
    curl -o latest.dump `heroku pgbackups:url`
    pg_restore --verbose --clean --no-acl --no-owner -h localhost -d inside_development latest.dump
  11. davidleandro created this gist Jun 16, 2014.
    5 changes: 5 additions & 0 deletions Baixar banco Heroku
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,5 @@
    heroku update
    heroku addons:add pgbackups
    heroku pgbackups:capture
    curl -o latest.dump `heroku pgbackups:url`
    pg_restore --verbose --clean --no-acl --no-owner -h localhost -d inside_development latest.dump