Différences
Ci-dessous, les différences entre deux révisions de la page.
| Les deux révisions précédentes Révision précédente Prochaine révision | Révision précédente | ||
| infrastructure:db:postgresql:upgrade [17/12/2024 13:52] – Stéphane Paillet | infrastructure:db:postgresql:upgrade [17/12/2024 14:10] (Version actuelle) – Stéphane Paillet | ||
|---|---|---|---|
| Ligne 1: | Ligne 1: | ||
| ====== Montée de version Postgresql ====== | ====== Montée de version Postgresql ====== | ||
| {{tag> | {{tag> | ||
| + | |||
| + | Lors d'une montée de version de Debian inplace de Bullseye à Bookworm, je suis passé de Postgresql 13 à Postgresql15. Il fallait que je puisse migrer d'une version à l' | ||
| ===== Sauvegarde ===== | ===== Sauvegarde ===== | ||
| Ligne 6: | Ligne 8: | ||
| < | < | ||
| sudo -u postgres pg_dumpall | gzip > peertube-$(date +' | sudo -u postgres pg_dumpall | gzip > peertube-$(date +' | ||
| + | </ | ||
| + | |||
| + | < | ||
| + | pg_lsclusters | ||
| + | Ver Cluster Port Status Owner Data directory | ||
| + | 13 main 5432 online postgres / | ||
| + | 15 main 5433 online postgres / | ||
| + | </ | ||
| + | |||
| + | < | ||
| + | pg_dropcluster 15 main --stop | ||
| + | </ | ||
| + | |||
| + | < | ||
| + | sudo pg_upgradecluster 13 main | ||
| + | </ | ||
| + | |||
| + | < | ||
| + | Stopping old cluster... | ||
| + | Restarting old cluster with restricted connections... | ||
| + | Notice: extra pg_ctl/ | ||
| + | Creating new PostgreSQL cluster 15/main ... | ||
| + | / | ||
| + | The files belonging to this database system will be owned by user " | ||
| + | This user must also own the server process. | ||
| + | |||
| + | The database cluster will be initialized with locale " | ||
| + | The default text search configuration will be set to " | ||
| + | |||
| + | Data page checksums are disabled. | ||
| + | |||
| + | fixing permissions on existing directory / | ||
| + | creating subdirectories ... ok | ||
| + | selecting dynamic shared memory implementation ... posix | ||
| + | selecting default max_connections ... 100 | ||
| + | selecting default shared_buffers ... 128MB | ||
| + | selecting default time zone ... Europe/ | ||
| + | creating configuration files ... ok | ||
| + | running bootstrap script ... ok | ||
| + | performing post-bootstrap initialization ... ok | ||
| + | syncing data to disk ... ok | ||
| + | |||
| + | Copying old configuration files... | ||
| + | Copying old start.conf... | ||
| + | Copying old pg_ctl.conf... | ||
| + | Starting new cluster... | ||
| + | Notice: extra pg_ctl/ | ||
| + | Roles, databases, schemas, ACLs... | ||
| + | | ||
| + | ------------ | ||
| + | |||
| + | (1 row) | ||
| + | |||
| + | | ||
| + | ------------ | ||
| + | |||
| + | (1 row) | ||
| + | |||
| + | | ||
| + | ------------ | ||
| + | |||
| + | (1 row) | ||
| + | |||
| + | | ||
| + | ------------ | ||
| + | |||
| + | (1 row) | ||
| + | |||
| + | Fixing hardcoded library paths for stored procedures... | ||
| + | Upgrading database postgres... | ||
| + | Analyzing database postgres... | ||
| + | Fixing hardcoded library paths for stored procedures... | ||
| + | Upgrading database peertube_prod... | ||
| + | Analyzing database peertube_prod... | ||
| + | Fixing hardcoded library paths for stored procedures... | ||
| + | Upgrading database template1... | ||
| + | Analyzing database template1... | ||
| + | Stopping target cluster... | ||
| + | Stopping old cluster... | ||
| + | Disabling automatic startup of old cluster... | ||
| + | Starting upgraded cluster on port 5432... | ||
| + | |||
| + | Success. Please check that the upgraded cluster works. If it does, | ||
| + | you can remove the old cluster with | ||
| + | pg_dropcluster 13 main | ||
| + | |||
| + | Ver Cluster Port Status Owner Data directory | ||
| + | 13 main 5433 down | ||
| + | Ver Cluster Port Status Owner Data directory | ||
| + | 15 main 5432 online postgres / | ||
| + | </ | ||
| + | |||
| + | < | ||
| + | pg_lsclusters | ||
| + | Ver Cluster Port Status Owner Data directory | ||
| + | 13 main 5433 down | ||
| + | 15 main 5432 online postgres / | ||
| + | </ | ||
| + | |||
| + | < | ||
| + | sudo pg_dropcluster 13 main | ||
| + | </ | ||
| + | |||
| + | < | ||
| + | sudo apt purge postgresql-13 postgresql-client-13 | ||
| </ | </ | ||