You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* initial commit
initial commit for 14.18 RNs
* updated major upgrade and RN
Updated the Major Upgrade topic with pg-1599 info and updated the release notes with correct links to the latest release + slight date modification to variables pending release
* updated dates and procedures
updated dates for tomorrow's release, updated tarball procedures based on Naeem's feedback
This document describes the in-place upgrade of Percona Distribution for PostgreSQL using the `pg_upgrade`
4
4
tool.
5
5
6
-
!!! important
6
+
To ensure a smooth upgrade path, follow these steps:
7
+
8
+
* Upgrade to the latest minor version within your current major version (e.g., from 13.20 to 13.21).
9
+
* Then, perform the major upgrade to your desired version (e.g., from 13.21 to 14.18).
7
10
11
+
!!! note
8
12
When running a major upgrade on **RHEL 8 and compatible derivatives**, consider the following:
9
13
10
14
Percona Distribution for PostgreSQL 16.3, 15.7, 14.12, 13.15 and 12.18 include `llvm` packages 16.0.6, while its previous versions 16.2, 15.6, 14.11, 13.14, and 12.17 include `llvm` 12.0.1. Since `llvm` libraries differ and are not compatible, the direct major version upgrade from 15.6 to 16.3 may cause issues.
11
15
12
-
To ensure a smooth upgrade path, follow these steps:
13
-
14
-
* Upgrade to the latest minor version within your current major version (e.g., from 13.14 to 13.15).
15
-
* Then, perform the major upgrade to your desired version (e.g., from 13.15 to 14.12).
16
-
17
-
18
16
The in-place upgrade means installing a new version without removing the old version and keeping the data files on the server.
19
17
20
18
!!! admonition "See also"
@@ -29,26 +27,19 @@ Similar to installing, we recommend you to upgrade Percona Distribution for Post
29
27
30
28
The general in-place upgrade flow for Percona Distribution for PostgreSQL is the following:
31
29
32
-
33
30
1. Install Percona Distribution for PostgreSQL 14 packages.
34
31
35
-
36
32
2. Stop the PostgreSQL service.
37
33
38
-
39
34
3. Check the upgrade without modifying the data.
40
35
41
-
42
36
4. Upgrade Percona Distribution for PostgreSQL.
43
37
44
-
45
38
5. Start PostgreSQL service.
46
39
47
-
48
40
6. Execute the **analyze_new_cluster.sh** script to generate statistics
49
41
so the system is usable.
50
42
51
-
52
43
7. Delete old packages and configuration files.
53
44
54
45
The exact steps may differ depending on the package manager of your operating system.
@@ -60,16 +51,18 @@ Run **all** commands as root or via **sudo**:
60
51
61
52
1. Install Percona Distribution for PostgreSQL 14 packages.
62
53
54
+
!!! note
55
+
When installing version 14, if prompted via a pop-up to upgrade to the latest available version, select **No**.
63
56
64
-
*[Install percona-release :octicons-link-external-16:](https://docs.percona.com/percona-software-repositories/installing.html). If you have installed it before, [update it to the latest version](https://docs.percona.com/percona-software-repositories/updating.html)
65
-
66
-
* Enable Percona repository:
57
+
*[Install percona-release :octicons-link-external-14:](https://docs.percona.com/percona-software-repositories/installing.html). If you have installed it before, [update it to the latest version](https://docs.percona.com/percona-software-repositories/updating.html)
58
+
59
+
* Enable Percona repository
67
60
68
61
```{.bash data-prompt="$"}
69
62
$ sudo percona-release setup ppg-14
70
63
```
71
64
72
-
* Install Percona Distribution for PostgreSQL 14 package:
65
+
* Install Percona Distribution for PostgreSQL 14 package
73
66
74
67
```{.bash data-prompt="$"}
75
68
$ sudo apt install percona-postgresql-14
@@ -83,131 +76,141 @@ Run **all** commands as root or via **sudo**:
83
76
84
77
This stops both Percona Distribution for PostgreSQL 13 and 14.
85
78
86
-
87
79
3. Run the database upgrade.
88
80
81
+
* Log in as the `postgres` user
89
82
90
-
* Log in as the `postgres` user.
91
-
92
-
```{.bash data-prompt="$"}
93
-
$ sudo su postgres
94
-
```
95
-
96
-
97
-
* Change the current directory to the `tmp` directory where logs and some scripts will be recorded:
98
-
99
-
```{.bash data-prompt="$"}
100
-
$ cd tmp/
101
-
```
102
-
103
-
104
-
* Check the ability to upgrade Percona Distribution for PostgreSQL from 13 to 14:
The `--link` flag creates hard links to the files on the old version cluster so you don’t need to copy data.
154
-
155
-
If you don’t wish to use the `--link` option, make sure that you have enough disk space to store 2 copies of files for both old version and new version clusters.
156
-
157
-
158
-
* Go back to the regular user:
159
-
160
-
161
-
```{.bash data-prompt="$"}
162
-
$ exit
163
-
```
164
-
165
-
166
-
* The Percona Distribution forPostgreSQL 13 uses the `5432` port while the Percona Distribution for PostgreSQL 14 is set up to use the `5433` port by default. To start the Percona Distribution for PostgreSQL 14, swap portsin the configuration files of both versions.
167
-
168
-
```{.bash data-prompt="$"}
169
-
$ sudo vim /etc/postgresql/14/main/postgresql.conf
170
-
$ port = 5433 # Change to 5432 here
171
-
$ sudo vim /etc/postgresql/13/main/postgresql.conf
172
-
$ port = 5432 # Change to 5433 here
173
-
```
98
+
```bash
99
+
$ pg_upgradecluster 13 main
100
+
```
174
101
102
+
<details>
103
+
<summary>Sample output (click to expand)</summary>
104
+
```bash
105
+
Upgrading cluster 13/main to 14/main ...
106
+
Stopping old cluster...
107
+
Restarting old cluster with restricted connections...
108
+
...
109
+
Success. Please check that the upgraded cluster works. If it does,
110
+
you can remove the old cluster with:
111
+
pg_dropcluster 13 main
112
+
113
+
Ver Cluster Port Status Owner Data directory Log file
114
+
14 main 5432 online postgres /var/lib/postgresql/14/main /var/log/postgresql/postgresql-14-main.log
115
+
116
+
Sample output:
117
+
Upgrading cluster 13/main to 14/main ...
118
+
Stopping old cluster...
119
+
Restarting old cluster with restricted connections...
120
+
Notice: extra pg_ctl/postgres options given, bypassing systemctl for start operation
Success. Please check that the upgraded cluster works. If it does,
177
+
you can remove the old cluster with
178
+
pg_dropcluster 13 main
179
+
180
+
Ver Cluster Port Status Owner Data directory Log file
181
+
13 main 5433 down postgres /var/lib/postgresql/13/main /var/log/postgresql/postgresql-13-main.log
182
+
Ver Cluster Port Status Owner Data directory Log file
183
+
14 main 5432 online postgres /var/lib/postgresql/14/main /var/log/postgresql/postgresql-14-main.log
184
+
```
185
+
</details>
175
186
176
187
4. Start the `postgreqsl` service.
177
188
178
189
```{.bash data-prompt="$"}
179
190
$ sudo systemctl start postgresql.service
180
191
```
181
192
182
-
183
193
5. Check the `postgresql` version.
184
194
185
195
* Log in as a postgres user
186
-
196
+
187
197
```{.bash data-prompt="$"}
188
198
$ sudo su postgres
189
199
```
190
200
191
201
* Check the database version
192
-
202
+
193
203
```{.bash data-prompt="$"}
194
204
$ psql -c "SELECT version();"
195
205
```
196
206
207
+
6. Delete the old cluster's data files.
197
208
198
-
6. After the upgrade, the Optimizer statistics are not transferred to the new cluster. Run the `vaccumdb`command to analyze the new cluster:
209
+
!!! note
210
+
Before deleting the old cluster, verify that the newly upgraded cluster is fully operational. Keeping the old cluster does not negatively affect the functionality or performance of your upgraded cluster.
@@ -262,14 +263,12 @@ Run **all** commands as root or via **sudo**:
262
263
263
264
4. Run the database upgrade.
264
265
265
-
266
266
* Log in as the `postgres` user
267
267
268
268
```{.bash data-prompt="$"}
269
269
$ sudo su postgres
270
270
```
271
271
272
-
273
272
* Check the ability to upgrade Percona Distribution for PostgreSQL from 13 to 14:
274
273
275
274
```{.bash data-prompt="$"}
@@ -303,7 +302,6 @@ Run **all** commands as root or via **sudo**:
303
302
*Clusters are compatible*
304
303
```
305
304
306
-
307
305
* Upgrade the Percona Distribution for PostgreSQL
308
306
309
307
```{.bash data-prompt="$"}
@@ -318,7 +316,6 @@ Run **all** commands as root or via **sudo**:
318
316
The `--link` flag creates hard links to the files on the old version cluster so you don’t need to copy data.
319
317
If you don’t wish to use the `--link` option, make sure that you have enough disk space to store 2 copies of files for both old version and new version clusters.
320
318
321
-
322
319
5. Start the `postgresql` 14 service.
323
320
324
321
```{.bash data-prompt="$"}
@@ -331,10 +328,8 @@ Run **all** commands as root or via **sudo**:
331
328
$ systemctl status postgresql-14
332
329
```
333
330
334
-
335
331
7. After the upgrade, the Optimizer statistics are not transferred to the new cluster. Run the `vaccumdb` command to analyze the new cluster:
336
332
337
-
338
333
* Log in as the postgres user
339
334
340
335
```{.bash data-prompt="$"}
@@ -347,14 +342,12 @@ Run **all** commands as root or via **sudo**:
0 commit comments