Skip to content

Instantly share code, notes, and snippets.

@guisehn
Forked from wrburgess/gist:5528649
Last active June 2, 2021 11:08
Show Gist options
  • Select an option

  • Save guisehn/6648c8fdcd1102a22a22 to your computer and use it in GitHub Desktop.

Select an option

Save guisehn/6648c8fdcd1102a22a22 to your computer and use it in GitHub Desktop.

Revisions

  1. guisehn revised this gist Apr 7, 2016. 1 changed file with 5 additions and 13 deletions.
    18 changes: 5 additions & 13 deletions gistfile1.md
    Original file line number Diff line number Diff line change
    @@ -1,19 +1,11 @@
    ## Grab new backup of database
    ## Grab new backup

    Command: ```heroku pg:backups capture -a app```

    Response: ```>>> HEROKU_POSTGRESQL_COLOR_URL (DATABASE_URL) ----backup---> a712```
    Command: ```heroku pg:backups capture -a [app_name]```

    ## Get url of backup download
    ## Download

    Command: ```curl -o latest.dump `heroku pg:backups public-url -a app` ```

    ## Download backup dump file

    Command: ```curl "http://[url]" > production.dump```

    Example: ```curl "https://s3.amazonaws.com/hkpgbackups/[email protected]/a712.dump?AWSAccessKeyId=XXXXXXXXXXXXXX&Expires=1367876175&Signature=XXXXXXX%EEEEEEEYWWWWWWW%3D" > production.dump```
    Command: ```curl -o latest.dump `heroku pg:backups public-url -a [app_name]` ```

    ## Restore backup dump into local db

    Command: ```pg_restore --verbose --clean --no-acl --no-owner -h localhost -d [db_name] production.dump```
    Command: ```pg_restore --verbose --clean --no-acl --no-owner -h localhost -d [db_name] latest.dump```
  2. guisehn revised this gist Apr 7, 2016. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion gistfile1.md
    Original file line number Diff line number Diff line change
    @@ -6,7 +6,7 @@ Response: ```>>> HEROKU_POSTGRESQL_COLOR_URL (DATABASE_URL) ----backup---> a71

    ## Get url of backup download

    Command: ```curl -o latest.dump `heroku pg:backups public-url -a app````
    Command: ```curl -o latest.dump `heroku pg:backups public-url -a app` ```

    ## Download backup dump file

  3. guisehn revised this gist Apr 7, 2016. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion gistfile1.md
    Original file line number Diff line number Diff line change
    @@ -6,7 +6,7 @@ Response: ```>>> HEROKU_POSTGRESQL_COLOR_URL (DATABASE_URL) ----backup---> a71

    ## Get url of backup download

    Command: ```curl -o latest.dump `heroku pg:backups public-url -a app```
    Command: ```curl -o latest.dump `heroku pg:backups public-url -a app````

    ## Download backup dump file

  4. guisehn revised this gist Apr 7, 2016. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion gistfile1.md
    Original file line number Diff line number Diff line change
    @@ -6,7 +6,7 @@ Response: ```>>> HEROKU_POSTGRESQL_COLOR_URL (DATABASE_URL) ----backup---> a71

    ## Get url of backup download

    Command: ```heroku pg:backups public-url -a app```
    Command: ```curl -o latest.dump `heroku pg:backups public-url -a app```

    ## Download backup dump file

  5. guisehn revised this gist Apr 7, 2016. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion gistfile1.md
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,6 @@
    ## Grab new backup of database

    Command: ```heroku pgbackups:capture --remote production```
    Command: ```heroku pg:backups capture -a app```

    Response: ```>>> HEROKU_POSTGRESQL_COLOR_URL (DATABASE_URL) ----backup---> a712```

  6. guisehn revised this gist Apr 7, 2016. 1 changed file with 1 addition and 5 deletions.
    6 changes: 1 addition & 5 deletions gistfile1.md
    Original file line number Diff line number Diff line change
    @@ -6,11 +6,7 @@ Response: ```>>> HEROKU_POSTGRESQL_COLOR_URL (DATABASE_URL) ----backup---> a71

    ## Get url of backup download

    Command: ```heroku pgbackups:url [db_key] --remote production```

    Example: ```heroku pgbackups:url a712 --remote production```

    ```>>> "https://s3.amazonaws.com/hkpgbackups/[email protected]/a712.dump?AWSAccessKeyId=XXXXXXXXXXXXXX&Expires=1367876175&Signature=XXXXXXX%EEEEEEEYWWWWWWW%3D" ```
    Command: ```heroku pg:backups public-url -a app```

    ## Download backup dump file

  7. @wrburgess wrburgess revised this gist Nov 12, 2014. 1 changed file with 4 additions and 4 deletions.
    8 changes: 4 additions & 4 deletions gistfile1.md
    Original file line number Diff line number Diff line change
    @@ -1,23 +1,23 @@
    Grab new backup of database
    ## Grab new backup of database

    Command: ```heroku pgbackups:capture --remote production```

    Response: ```>>> HEROKU_POSTGRESQL_COLOR_URL (DATABASE_URL) ----backup---> a712```

    Get url of backup download
    ## Get url of backup download

    Command: ```heroku pgbackups:url [db_key] --remote production```

    Example: ```heroku pgbackups:url a712 --remote production```

    ```>>> "https://s3.amazonaws.com/hkpgbackups/[email protected]/a712.dump?AWSAccessKeyId=XXXXXXXXXXXXXX&Expires=1367876175&Signature=XXXXXXX%EEEEEEEYWWWWWWW%3D" ```

    Download backup dump file
    ## Download backup dump file

    Command: ```curl "http://[url]" > production.dump```

    Example: ```curl "https://s3.amazonaws.com/hkpgbackups/[email protected]/a712.dump?AWSAccessKeyId=XXXXXXXXXXXXXX&Expires=1367876175&Signature=XXXXXXX%EEEEEEEYWWWWWWW%3D" > production.dump```

    Restore backup dump into local db
    ## Restore backup dump into local db

    Command: ```pg_restore --verbose --clean --no-acl --no-owner -h localhost -d [db_name] production.dump```
  8. @wrburgess wrburgess revised this gist May 6, 2013. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions gistfile1.md
    Original file line number Diff line number Diff line change
    @@ -1,8 +1,8 @@
    Grab new backup of database

    ```heroku pgbackups:capture --remote production```
    Command: ```heroku pgbackups:capture --remote production```

    ```>>> HEROKU_POSTGRESQL_COLOR_URL (DATABASE_URL) ----backup---> a712```
    Response: ```>>> HEROKU_POSTGRESQL_COLOR_URL (DATABASE_URL) ----backup---> a712```

    Get url of backup download

  9. @wrburgess wrburgess revised this gist May 6, 2013. 1 changed file with 3 additions and 3 deletions.
    6 changes: 3 additions & 3 deletions gistfile1.md
    Original file line number Diff line number Diff line change
    @@ -2,15 +2,15 @@ Grab new backup of database

    ```heroku pgbackups:capture --remote production```

    >>> ```HEROKU_POSTGRESQL_COLOR_URL (DATABASE_URL) ----backup---> a712```
    ```>>> HEROKU_POSTGRESQL_COLOR_URL (DATABASE_URL) ----backup---> a712```

    Get url of backup download

    Command: ```heroku pgbackups:url [db_key] --remote production```

    Example: ```heroku pgbackups:url a712 --remote production```

    >>> ``` "https://s3.amazonaws.com/hkpgbackups/[email protected]/a712.dump?AWSAccessKeyId=XXXXXXXXXXXXXX&Expires=1367876175&Signature=XXXXXXX%EEEEEEEYWWWWWWW%3D" ```
    ```>>> "https://s3.amazonaws.com/hkpgbackups/[email protected]/a712.dump?AWSAccessKeyId=XXXXXXXXXXXXXX&Expires=1367876175&Signature=XXXXXXX%EEEEEEEYWWWWWWW%3D" ```

    Download backup dump file

    @@ -20,4 +20,4 @@ Example: ```curl "https://s3.amazonaws.com/hkpgbackups/[email protected]/a7

    Restore backup dump into local db

    Command: ```pg_restore --verbose --clean --no-acl --no-owner -h localhost -d [db_name] production.dump```
    Command: ```pg_restore --verbose --clean --no-acl --no-owner -h localhost -d [db_name] production.dump```
  10. @wrburgess wrburgess created this gist May 6, 2013.
    23 changes: 23 additions & 0 deletions gistfile1.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,23 @@
    Grab new backup of database

    ```heroku pgbackups:capture --remote production```

    >>> ```HEROKU_POSTGRESQL_COLOR_URL (DATABASE_URL) ----backup---> a712```
    Get url of backup download

    Command: ```heroku pgbackups:url [db_key] --remote production```

    Example: ```heroku pgbackups:url a712 --remote production```

    >>> ``` "https://s3.amazonaws.com/hkpgbackups/[email protected]/a712.dump?AWSAccessKeyId=XXXXXXXXXXXXXX&Expires=1367876175&Signature=XXXXXXX%EEEEEEEYWWWWWWW%3D" ```
    Download backup dump file

    Command: ```curl "http://[url]" > production.dump```

    Example: ```curl "https://s3.amazonaws.com/hkpgbackups/[email protected]/a712.dump?AWSAccessKeyId=XXXXXXXXXXXXXX&Expires=1367876175&Signature=XXXXXXX%EEEEEEEYWWWWWWW%3D" > production.dump```

    Restore backup dump into local db

    Command: ```pg_restore --verbose --clean --no-acl --no-owner -h localhost -d [db_name] production.dump```