style: fix prettier formatting for postgres migration guide

This commit is contained in:
nishanthabimanyu 2026-03-10 03:50:02 +00:00
parent 15648342dd
commit 5191d1965d

View file

@ -6,29 +6,34 @@ Upgrading PostgreSQL from version 13 to 15 is a major version jump. Since Postgr
1. **Backup Existing Data (Version 13):** 1. **Backup Existing Data (Version 13):**
Before updating your compose file, ensure your containers are running and perform a dump of all databases. Before updating your compose file, ensure your containers are running and perform a dump of all databases.
```bash ```bash
docker exec -it <project_name>-db-1 pg_dumpall -U postgres > full_dump.sql docker exec -it <project_name>-db-1 pg_dumpall -U postgres > full_dump.sql
``` ```
2. **Stop and Remove Containers:** 2. **Stop and Remove Containers:**
```bash ```bash
docker compose down docker compose down
``` ```
3. **Delete Old Data Volume:** 3. **Delete Old Data Volume:**
PostgreSQL 15 cannot read data created by version 13. You must remove the existing volume (Warning: this deletes the old data directory). PostgreSQL 15 cannot read data created by version 13. You must remove the existing volume (Warning: this deletes the old data directory).
```bash ```bash
docker volume rm <project_name>_db-data docker volume rm <project_name>_db-data
``` ```
4. **Update Image and Start (Version 15):** 4. **Update Image and Start (Version 15):**
Update your `overrides/compose.postgres.yaml` (or pull the latest changes) and start the containers. Update your `overrides/compose.postgres.yaml` (or pull the latest changes) and start the containers.
```bash ```bash
docker compose up -d docker compose up -d
``` ```
5. **Restore Data:** 5. **Restore Data:**
Restore the dump into the new PostgreSQL 15 instance. Restore the dump into the new PostgreSQL 15 instance.
```bash ```bash
cat full_dump.sql | docker exec -i <project_name>-db-1 psql -U postgres cat full_dump.sql | docker exec -i <project_name>-db-1 psql -U postgres
``` ```