Skip to content

Instantly share code, notes, and snippets.

View kanelv's full-sized avatar
🎯
Focusing

Cuong Le kanelv

🎯
Focusing
View GitHub Profile
@kanelv
kanelv / how-to-copy-aws-rds-to-local.md
Created September 1, 2022 00:46 — forked from syafiqfaiz/how-to-copy-aws-rds-to-local.md
How to copy production database on AWS RDS(postgresql) to local development database.
  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>
  • the database is restored

Keybase proof

I hereby claim:

  • I am levcuong on github.
  • I am cuongkeybase (https://keybase.io/cuongkeybase) on keybase.
  • I have a public key ASDNPqT20481UC7bbiwnxUcXHy1BUTfMT9kPcpa-w9U4vgo

To claim this, I am signing this object:

@kanelv
kanelv / cloudSettings
Last active May 1, 2020 05:58
Undergraduate last game
{"lastUpload":"2020-05-01T05:58:14.297Z","extensionVersion":"v3.4.3"}