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
commit for 13.21 RN Q2 PG
* updated major upgrade and RN
Updated the variables with a date awaiting release, updated major upgrade as per pr-1599 and updated RN to include the changes in docs as highlights.
* updated tarball and rn
tarball updated based on Naeem
* Update variables.yml
added release date
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 12.18 to 12.19).
9
+
* Then, perform the major upgrade to your desired version (e.g., from 12.19 to 13.21).
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 12.19 to 12.19).
15
-
* Then, perform the major upgrade to your desired version (e.g., from 12.19 to 13.15).
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"
@@ -31,26 +29,19 @@ Similar to installing, we recommend you to upgrade Percona Distribution for Post
31
29
32
30
The general in-place upgrade flow for Percona Distribution for PostgreSQL is the following:
33
31
34
-
35
32
1. Install Percona Distribution for PostgreSQL 13 packages.
36
33
37
-
38
34
2. Stop the PostgreSQL service.
39
35
40
-
41
36
3. Check the upgrade without modifying the data.
42
37
43
-
44
38
4. Upgrade Percona Distribution for PostgreSQL.
45
39
46
-
47
40
5. Start PostgreSQL service.
48
41
49
-
50
42
6. Execute the **analyze_new_cluster.sh** script to generate statistics
51
43
so the system is usable.
52
44
53
-
54
45
7. Delete old packages and configuration files.
55
46
56
47
The exact steps may differ depending on the package manager of your operating system.
@@ -62,16 +53,18 @@ Run **all** commands as root or via **sudo**:
62
53
63
54
1. Install Percona Distribution for PostgreSQL 13 packages.
64
55
56
+
!!! note
57
+
When installing version 13, if prompted via a pop-up to upgrade to the latest available version, select **No**.
65
58
66
-
*[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)
67
-
68
-
* Enable Percona repository:
59
+
*[Install percona-release](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)
60
+
61
+
* Enable Percona repository
69
62
70
63
```{.bash data-prompt="$"}
71
64
$ sudo percona-release setup ppg-13
72
65
```
73
66
74
-
* Install Percona Distribution for PostgreSQL 13 package:
67
+
* Install Percona Distribution for PostgreSQL 13 package
75
68
76
69
```{.bash data-prompt="$"}
77
70
$ sudo apt install percona-postgresql-13
@@ -85,131 +78,141 @@ Run **all** commands as root or via **sudo**:
85
78
86
79
This stops both Percona Distribution for PostgreSQL 12 and 13.
87
80
88
-
89
81
3. Run the database upgrade.
90
82
83
+
* Log in as the `postgres` user
91
84
92
-
* Log in as the `postgres` user.
93
-
94
-
```{.bash data-prompt="$"}
95
-
$ sudo su postgres
96
-
```
97
-
98
-
99
-
* Change the current directory to the `tmp` directory where logs and some scripts will be recorded:
100
-
101
-
```{.bash data-prompt="$"}
102
-
$ cd tmp/
103
-
```
104
-
105
-
106
-
* Check the ability to upgrade Percona Distribution for PostgreSQL from 12 to 13:
The `--link` flag creates hard links to the files on the old version cluster so you don’t need to copy data.
156
-
157
-
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.
158
-
159
-
160
-
* Go back to the regular user:
161
-
162
-
163
-
```{.bash data-prompt="$"}
164
-
$ exit
165
-
```
166
-
167
-
168
-
* The Percona Distribution forPostgreSQL 12 uses the `5432` port while the Percona Distribution for PostgreSQL 13 is set up to use the `5433` port by default. To start the Percona Distribution for PostgreSQL 13, swap portsin the configuration files of both versions.
169
-
170
-
```{.bash data-prompt="$"}
171
-
$ sudo vim /etc/postgresql/13/main/postgresql.conf
172
-
$ port = 5433 # Change to 5432 here
173
-
$ sudo vim /etc/postgresql/12/main/postgresql.conf
174
-
$ port = 5432 # Change to 5433 here
175
-
```
100
+
```bash
101
+
$ pg_upgradecluster 12 main
102
+
```
176
103
104
+
<details>
105
+
<summary>Sample output (click to expand)</summary>
106
+
```bash
107
+
Upgrading cluster 12/main to 13/main ...
108
+
Stopping old cluster...
109
+
Restarting old cluster with restricted connections...
110
+
...
111
+
Success. Please check that the upgraded cluster works. If it does,
112
+
you can remove the old cluster with:
113
+
pg_dropcluster 12 main
114
+
115
+
Ver Cluster Port Status Owner Data directory Log file
116
+
13 main 5432 online postgres /var/lib/postgresql/13/main /var/log/postgresql/postgresql-13-main.log
117
+
118
+
Sample output:
119
+
Upgrading cluster 12/main to 13/main ...
120
+
Stopping old cluster...
121
+
Restarting old cluster with restricted connections...
122
+
Notice: extra pg_ctl/postgres options given, bypassing systemctl for start operation
Success. Please check that the upgraded cluster works. If it does,
179
+
you can remove the old cluster with
180
+
pg_dropcluster 12 main
181
+
182
+
Ver Cluster Port Status Owner Data directory Log file
183
+
12 main 5433 down postgres /var/lib/postgresql/12/main /var/log/postgresql/postgresql-12-main.log
184
+
Ver Cluster Port Status Owner Data directory Log file
185
+
13 main 5432 online postgres /var/lib/postgresql/13/main /var/log/postgresql/postgresql-13-main.log
186
+
```
187
+
</details>
177
188
178
189
4. Start the `postgreqsl` service.
179
190
180
191
```{.bash data-prompt="$"}
181
192
$ sudo systemctl start postgresql.service
182
193
```
183
194
184
-
185
195
5. Check the `postgresql` version.
186
196
187
197
* Log in as a postgres user
188
-
198
+
189
199
```{.bash data-prompt="$"}
190
200
$ sudo su postgres
191
201
```
192
202
193
203
* Check the database version
194
-
204
+
195
205
```{.bash data-prompt="$"}
196
206
$ psql -c "SELECT version();"
197
207
```
198
208
209
+
6. Delete the old cluster's data files.
199
210
200
-
6. After the upgrade, the Optimizer statistics are not transferred to the new cluster. Run the `vaccumdb`command to analyze the new cluster:
211
+
!!! note
212
+
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.
@@ -264,7 +265,6 @@ Run **all** commands as root or via **sudo**:
264
265
265
266
4. Run the database upgrade.
266
267
267
-
268
268
* Log in as the `postgres` user
269
269
270
270
```{.bash data-prompt="$"}
@@ -304,7 +304,6 @@ Run **all** commands as root or via **sudo**:
304
304
*Clusters are compatible*
305
305
```
306
306
307
-
308
307
* Upgrade the Percona Distribution for PostgreSQL
309
308
310
309
```{.bash data-prompt="$"}
@@ -319,7 +318,6 @@ Run **all** commands as root or via **sudo**:
319
318
The `--link` flag creates hard links to the files on the old version cluster so you don’t need to copy data.
320
319
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.
321
320
322
-
323
321
5. Start the `postgresql` 13 service.
324
322
325
323
```{.bash data-prompt="$"}
@@ -332,10 +330,8 @@ Run **all** commands as root or via **sudo**:
332
330
$ systemctl status postgresql-13
333
331
```
334
332
335
-
336
333
7. After the upgrade, the Optimizer statistics are not transferred to the new cluster. Run the `vaccumdb` command to analyze the new cluster:
337
334
338
-
339
335
* Log in as the postgres user
340
336
341
337
```{.bash data-prompt="$"}
@@ -348,7 +344,6 @@ Run **all** commands as root or via **sudo**:
0 commit comments