Postgres - DB dump 및 restore
Postgres에서 모든 DB에 대해 dump와 restore 하는 방법을 간단히 작성해 보았다.
Postgres - DB dump 및 restore
Postgres 15.4
Host
CLI
개요
MariaDB
와 거의 같다고 봐도 된다.
백업 및 복구
1. 백업(dump)
- DB 전체 백업
1
pg_dumpall -U [username] > ./dumpfile.sql
2. 복구(restore)
1
psql -U {postgres_user} < ./dumpfile.sql
This post is licensed under CC BY 4.0 by the author.