Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
| postgresql [2023/11/28 12:43] – admin | postgresql [2026/03/08 18:07] (current) – admin | ||
|---|---|---|---|
| Line 3: | Line 3: | ||
| ==== Backup fuelwatcher on PROD ==== | ==== Backup fuelwatcher on PROD ==== | ||
| <code bash> | <code bash> | ||
| - | docker exec -it FW_PostgreSQL | + | docker exec -it FT_PostgreSQL |
| cd / | cd / | ||
| pg_dump -d fuelwatcher > fuelwatcher_RPi64_`date +%Y-%m-%dT%H-%M-%S`.backup | pg_dump -d fuelwatcher > fuelwatcher_RPi64_`date +%Y-%m-%dT%H-%M-%S`.backup | ||
| Line 10: | Line 10: | ||
| <code bash> | <code bash> | ||
| sudo su - | sudo su - | ||
| - | rsync -av / | + | rsync -av / |
| </ | </ | ||
| Line 17: | Line 17: | ||
| Login: | Login: | ||
| <code bash> | <code bash> | ||
| - | docker exec -it FW_PostgreSQL | + | docker exec -it FT_PostgreSQL |
| su - postgres | su - postgres | ||
| Line 28: | Line 28: | ||
| DROP DATABASE fuelwatcher; | DROP DATABASE fuelwatcher; | ||
| - | CREATE DATABASE | + | CREATE DATABASE |
| WITH | WITH | ||
| OWNER = postgres | OWNER = postgres | ||
| Line 40: | Line 40: | ||
| < | < | ||
| cd / | cd / | ||
| - | pg_dump -d fuelwatcher | + | pg_dump -d fueltracker |
| - | psql -d fuelwatcher < fuelwatcher_RPi64_2021-08-01T05-23-25.backup | + | psql -d fuelwatcher < fueltracker_RPi64_2021-08-01T05-23-25.backup |
| </ | </ | ||
| Line 47: | Line 47: | ||
| <code bash> | <code bash> | ||
| pg_dumpall > dev-container_devcontainer_db_1_all_`date +%Y-%m-%dT%H-%M-%S`.backup | pg_dumpall > dev-container_devcontainer_db_1_all_`date +%Y-%m-%dT%H-%M-%S`.backup | ||
| - | cd /workspace/fuelwatcher/ | + | cd /workspace/FuelTracker/ |
| - | cd /workspace/fuelwatcher/ | + | cd /workspace/FuelTracker/ |
| </ | </ | ||
| ===== Data Dictionary export ===== | ===== Data Dictionary export ===== | ||
| For comparison between PROD and DEV. Perform on both: | For comparison between PROD and DEV. Perform on both: | ||
| <code bash> | <code bash> | ||
| - | pg_dump -Cs fuelwatcher | + | pg_dump -Cs fueltracker |
| </ | </ | ||
| ===== Version upgrade ===== | ===== Version upgrade ===== | ||
| Line 89: | Line 89: | ||
| ===== References ===== | ===== References ===== | ||
| - | How to Upgrade Your PostgreSQL Passwords to SCRAM - https://blog.crunchydata.com/blog/how-to-upgrade-postgresql-passwords-to-scram | + | [[https://www.postgresqltutorial.com/postgresql-administration/ |
| - | Postgres dump database schema with or without data - https:// | + | [[https:// |
| + | |||
| + | [[https:// | ||
| [[https:// | [[https:// | ||
| + | |||
| + | [[https:// | ||