Skip to content

PG-2434 - Add Docker upgrade topic#999

Merged
Andriciuc merged 2 commits into
18from
add-docker-upgrade-chapter
Jul 23, 2026
Merged

PG-2434 - Add Docker upgrade topic#999
Andriciuc merged 2 commits into
18from
add-docker-upgrade-chapter

Conversation

@Andriciuc

Copy link
Copy Markdown
Contributor

This PR mentions the docker upgrade image and instructs the user how to upgrade using this image. Furthermore, major upgrade chapter and docker install chapter will have links to this topic.

This PR mentions the docker upgrade image and instructs the user how to upgrade using this image. Furthermore, major upgrade chapter and docker install chapter will have links to this topic.
@mohitj1988

mohitj1988 commented Jul 23, 2026

Copy link
Copy Markdown

Hi @Andriciuc - I am pasting detailed steps for doing a Major upgrade from PG 17 -> PG 18. You can use this to add more details to the documentation page.

Step 1: Create fresh directories for the old and new PostgreSQL clusters
mkdir -p ~/pgupgrade/pg17olddata/postgres
mkdir -p ~/pgupgrade/pg18newdata/postgres

Step 2: Start a PostgreSQL 17 container
docker run -d
--name pg17
-e POSTGRES_PASSWORD=password
-v ~/pgupgrade/pg17olddata/postgres:/data/db
percona/percona-distribution-postgresql:17

Step 3: Wait until PostgreSQL finishes initialization
docker logs pg17

Step 4: Connect to PostgreSQL
docker exec -it pg17 psql -U postgres

Step 5: Create a test database and some data
postgres=# CREATE DATABASE testdb;
postgres=# \c testdb
postgres=# CREATE TABLE t1(a int);
postgres=# INSERT INTO t1 VALUES (100);

Step 6: Stop the PostgreSQL 17 container
docker stop pg17

Step 7: Pull the upgrade image
docker pull percona/percona-distribution-postgresql-upgrade:18.4-17.10-16.14-15.18-14.23-1

Step 8: Run the upgrade
docker run --rm
--name ppg_upgrade_17_18
-e OLD_VERSION=17
-e NEW_VERSION=18
-e OLD_DATABASE_NAME=postgres
-e NEW_DATABASE_NAME=postgres
-v ~/pgupgrade/pg17olddata:/pgolddata
-v ~/pgupgrade/pg18newdata:/pgnewdata
percona/percona-distribution-postgresql-upgrade:18.4-17.10-16.14-15.18-14.23-1

Step 9: Start PostgreSQL 18 using the upgraded data directory
docker run -d
--name pg18
-e POSTGRES_PASSWORD=password
-v ~/pgupgrade/pg18newdata/postgres:/data/db
percona/percona-distribution-postgresql:18

Step 10: Verify PostgreSQL 18 starts successfully
docker logs -f pg18

Step 11: Connect to the upgraded cluster
docker exec -it pg18 psql -U postgres testdb

Step 12: Verify the upgraded data
postgres=# SELECT version();
postgres=# SELECT * FROM t1;

@Andriciuc
Andriciuc temporarily deployed to add-docker-upgrade-chapter - postgresql-docs-preview-18 PR #999 July 23, 2026 11:21 — with Render Destroyed
@Andriciuc
Andriciuc marked this pull request as ready for review July 23, 2026 11:22
@Andriciuc
Andriciuc requested a review from mohitj1988 July 23, 2026 11:22
@Andriciuc
Andriciuc merged commit e917e96 into 18 Jul 23, 2026
1 check passed
@Andriciuc
Andriciuc deleted the add-docker-upgrade-chapter branch July 23, 2026 13:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants