Compare commits
3 Commits
632795489a
...
cd709d3257
| Author | SHA1 | Date | |
|---|---|---|---|
| cd709d3257 | |||
| 53b3788d30 | |||
| 0f4ec20090 |
@ -2,7 +2,7 @@
|
|||||||
title: Postgres
|
title: Postgres
|
||||||
description:
|
description:
|
||||||
published: true
|
published: true
|
||||||
date: 2025-11-21T17:22:18.109Z
|
date: 2025-11-21T17:28:17.490Z
|
||||||
tags:
|
tags:
|
||||||
editor: markdown
|
editor: markdown
|
||||||
dateCreated: 2025-11-21T17:22:18.109Z
|
dateCreated: 2025-11-21T17:22:18.109Z
|
||||||
@ -16,3 +16,42 @@ stop the running instance
|
|||||||
```
|
```
|
||||||
sudo systemctl stop postgresql
|
sudo systemctl stop postgresql
|
||||||
```
|
```
|
||||||
|
|
||||||
|
install the upgrade tool
|
||||||
|
```
|
||||||
|
sudo pacman -S postgresql-old-upgrade
|
||||||
|
```
|
||||||
|
|
||||||
|
Check where the installed files are with
|
||||||
|
```
|
||||||
|
pacman -Ql postgresql-old-upgrade
|
||||||
|
```
|
||||||
|
|
||||||
|
Initalize the new database
|
||||||
|
```
|
||||||
|
sudo -u postgres initdb -D /var/lib/postgres/data_18 --no-data-checksums
|
||||||
|
```
|
||||||
|
|
||||||
|
Do the upgrade
|
||||||
|
-b previous binaries
|
||||||
|
-d previous data folder
|
||||||
|
```
|
||||||
|
sudo -u postgres \
|
||||||
|
pg_upgrade \
|
||||||
|
-b /opt/pgsql-17/bin/ \
|
||||||
|
-B /usr/bin/ \
|
||||||
|
-d /var/lib/postgres/data \
|
||||||
|
-D /var/lib/postgres/data_18 \
|
||||||
|
-O "-c timescaledb.restoring='on'"
|
||||||
|
```
|
||||||
|
|
||||||
|
Rename the data folder
|
||||||
|
```
|
||||||
|
mv /var/lib/postgres/data /var/lib/postgres/data_old
|
||||||
|
mv /var/lib/postgres/data_18 /var/lib/postgres/data
|
||||||
|
```
|
||||||
|
|
||||||
|
start postgres
|
||||||
|
```
|
||||||
|
sudo systemctl start postgresql
|
||||||
|
```
|
||||||
Loading…
x
Reference in New Issue
Block a user