Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save khoa-lucents/31fcb25ac94c767fb2c7ef8f2d681f68 to your computer and use it in GitHub Desktop.
Save khoa-lucents/31fcb25ac94c767fb2c7ef8f2d681f68 to your computer and use it in GitHub Desktop.

Revisions

  1. @syafiqfaiz syafiqfaiz revised this gist Jan 9, 2018. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion how-to-copy-aws-rds-to-local.md
    Original file line number Diff line number Diff line change
    @@ -7,7 +7,8 @@
    3. Restore that dump file to your local database.
    * but you might need to drop the database and create it first
    * ```$ psql -U <postgresql username> -d <database name> -f <dump file that you want to restore>```
    * the database is restored
    * the database is restored
    4. ```pg_restore -h <host> -U <username> -c -d <database name> <filename to be restored>```

    #####ref
    1. http://stackoverflow.com/questions/31881786/how-to-pg-dump-an-rds-postgres-database
  2. @syafiqfaiz syafiqfaiz revised this gist Apr 1, 2016. 1 changed file with 9 additions and 9 deletions.
    18 changes: 9 additions & 9 deletions how-to-copy-aws-rds-to-local.md
    Original file line number Diff line number Diff line change
    @@ -1,14 +1,14 @@
    1. Change your database RDS instance security group to allow your machine to access it.
    Add your ip to the security group to acces the instance via Postgres.
    * Add your ip to the security group to acces the instance via Postgres.
    2. Make a copy of the database using pg_dump
    `$ pg_dump -h <public dns> -U <my username> -f <name of dump file .sql> <name of my database>`
    you will be asked for postgressql password.
    a dump file(.sql) will be created
    3. Restore that dump file to your local database.
    but you might need to drop the database and create it first
    `$ psql -U <postgresql username> -d <database name> -f <dump file that you want to restore>`
    the database is restored
    * ```$ pg_dump -h <public dns> -U <my username> -f <name of dump file .sql> <name of my database>```
    * you will be asked for postgressql password.
    * a dump file(.sql) will be created
    3. Restore that dump file to your local database.
    * but you might need to drop the database and create it first
    * ```$ psql -U <postgresql username> -d <database name> -f <dump file that you want to restore>```
    * the database is restored

    ref
    #####ref
    1. http://stackoverflow.com/questions/31881786/how-to-pg-dump-an-rds-postgres-database
    2. http://www.thegeekstuff.com/2009/01/how-to-backup-and-restore-postgres-database-using-pg_dump-and-psql/
  3. @syafiqfaiz syafiqfaiz revised this gist Apr 1, 2016. 1 changed file with 5 additions and 5 deletions.
    10 changes: 5 additions & 5 deletions how-to-copy-aws-rds-to-local.md
    Original file line number Diff line number Diff line change
    @@ -1,14 +1,14 @@
    1) Change your database RDS instance security group to allow your machine to access it.
    1. Change your database RDS instance security group to allow your machine to access it.
    Add your ip to the security group to acces the instance via Postgres.
    2) Make a copy of the database using pg_dump
    2. Make a copy of the database using pg_dump
    `$ pg_dump -h <public dns> -U <my username> -f <name of dump file .sql> <name of my database>`
    you will be asked for postgressql password.
    a dump file(.sql) will be created
    3) restore that dump file to your local database.
    3. Restore that dump file to your local database.
    but you might need to drop the database and create it first
    `$ psql -U <postgresql username> -d <database name> -f <dump file that you want to restore>`
    the database is restored

    ref
    1) http://stackoverflow.com/questions/31881786/how-to-pg-dump-an-rds-postgres-database
    2) http://www.thegeekstuff.com/2009/01/how-to-backup-and-restore-postgres-database-using-pg_dump-and-psql/
    1. http://stackoverflow.com/questions/31881786/how-to-pg-dump-an-rds-postgres-database
    2. http://www.thegeekstuff.com/2009/01/how-to-backup-and-restore-postgres-database-using-pg_dump-and-psql/
  4. @syafiqfaiz syafiqfaiz renamed this gist Apr 1, 2016. 1 changed file with 2 additions and 2 deletions.
    Original file line number Diff line number Diff line change
    @@ -1,12 +1,12 @@
    1) Change your database RDS instance security group to allow your machine to access it.
    Add your ip to the security group to acces the instance via Postgres.
    2) Make a copy of the database using pg_dump
    $ pg_dump -h <public dns> -U <my username> -f <name of dump file .sql> <name of my database>
    `$ pg_dump -h <public dns> -U <my username> -f <name of dump file .sql> <name of my database>`
    you will be asked for postgressql password.
    a dump file(.sql) will be created
    3) restore that dump file to your local database.
    but you might need to drop the database and create it first
    $ psql -U <postgresql username> -d <database name> -f <dump file that you want to restore>
    `$ psql -U <postgresql username> -d <database name> -f <dump file that you want to restore>`
    the database is restored

    ref
  5. @syafiqfaiz syafiqfaiz revised this gist Mar 31, 2016. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions how-to-copy-aws-rds-to-local.txt
    Original file line number Diff line number Diff line change
    @@ -1,12 +1,12 @@
    1) Change your database RDS instance security group to allow your machine to access it.
    Add your ip to the security group to acces the instance via Postgres.
    2) Make a copy of the database using pg_dump
    `$ pg_dump -h <public dns> -U <my username> -f <name of dump file .sql> <name of my database>`
    $ pg_dump -h <public dns> -U <my username> -f <name of dump file .sql> <name of my database>
    you will be asked for postgressql password.
    a dump file(.sql) will be created
    3) restore that dump file to your local database.
    but you might need to drop the database and create it first
    `$ psql -U <postgresql username> -d <database name> -f <dump file that you want to restore>`
    $ psql -U <postgresql username> -d <database name> -f <dump file that you want to restore>
    the database is restored

    ref
  6. @syafiqfaiz syafiqfaiz revised this gist Mar 31, 2016. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions how-to-copy-aws-rds-to-local.txt
    Original file line number Diff line number Diff line change
    @@ -1,12 +1,12 @@
    1) Change your database RDS instance security group to allow your machine to access it.
    Add your ip to the security group to acces the instance via Postgres.
    2) Make a copy of the database using pg_dump
    '$ pg_dump -h <public dns> -U <my username> -f <name of dump file .sql> <name of my database>'
    `$ pg_dump -h <public dns> -U <my username> -f <name of dump file .sql> <name of my database>`
    you will be asked for postgressql password.
    a dump file(.sql) will be created
    3) restore that dump file to your local database.
    but you might need to drop the database and create it first
    '$ psql -U <postgresql username> -d <database name> -f <dump file that you want to restore>'
    `$ psql -U <postgresql username> -d <database name> -f <dump file that you want to restore>`
    the database is restored

    ref
  7. @syafiqfaiz syafiqfaiz revised this gist Mar 31, 2016. 1 changed file with 7 additions and 2 deletions.
    9 changes: 7 additions & 2 deletions how-to-copy-aws-rds-to-local.txt
    Original file line number Diff line number Diff line change
    @@ -1,9 +1,14 @@
    1) Change your database RDS instance security group to allow your machine to access it.
    Add your ip to the security group to acces the instance via Postgres.
    2) Make a copy of the database using pg_dump
    $ pg_dump -h <public dns> -U <my username> -f <name of dump file .sql> <name of my database>
    '$ pg_dump -h <public dns> -U <my username> -f <name of dump file .sql> <name of my database>'
    you will be asked for postgressql password.
    a dump file(.sql) will be created
    3) restore that dump file to your local database.
    but you might need to drop the database and create it first
    $ psql -U <postgresql username> -d <database name> -f <dump file that you want to restore>
    '$ psql -U <postgresql username> -d <database name> -f <dump file that you want to restore>'
    the database is restored

    ref
    1) http://stackoverflow.com/questions/31881786/how-to-pg-dump-an-rds-postgres-database
    2) http://www.thegeekstuff.com/2009/01/how-to-backup-and-restore-postgres-database-using-pg_dump-and-psql/
  8. @syafiqfaiz syafiqfaiz created this gist Mar 31, 2016.
    9 changes: 9 additions & 0 deletions how-to-copy-aws-rds-to-local.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,9 @@
    1) Change your database RDS instance security group to allow your machine to access it.
    Add your ip to the security group to acces the instance via Postgres.
    2) Make a copy of the database using pg_dump
    $ pg_dump -h <public dns> -U <my username> -f <name of dump file .sql> <name of my database>
    you will be asked for postgressql password.
    a dump file(.sql) will be created
    3) restore that dump file to your local database.
    but you might need to drop the database and create it first
    $ psql -U <postgresql username> -d <database name> -f <dump file that you want to restore>