Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor upgrades of Deb systems #5856

Merged
merged 11 commits into from
Aug 1, 2024
8 changes: 4 additions & 4 deletions advocacy_docs/security/advisories/cve20244545.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ First Published: 2024/05/09

Last Updated: 2024/05/09

## Summary
## Summary

All versions of EnterpriseDB Postgres Advanced Server (EPAS) from 15.0 and prior to 15.7.0 and from 16.0 and prior to 16.3.0 may allow users using `edbldr` to bypass role permissions from `pg_read_server_files`. This could allow low privilege users to read files to which they would not otherwise have access.

Expand All @@ -27,8 +27,8 @@ CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:N/A:N
## Affected products and versions

* EnterpriseDB Postgres Advanced Server (EPAS)
* All versions from 15.0 and prior to 15.7.0
* All versions from 16.0 and prior to 16.3.0
* All versions from 15.0 and prior to 15.7.0
* All versions from 16.0 and prior to 16.3.0

## Remediation

Expand All @@ -37,7 +37,7 @@ Impacted users must upgrade to a fixed version of EPAS. For questions about upda
| Product | VRMF | Remediation/First Fix |
|---------|------|-----------------------|
| EPAS | All versions from 15.0 and prior to 15.7.0 | [Upgrade EPAS 15 to Minor release](https://www.enterprisedb.com/docs/epas/15/upgrading/04_upgrading_an_installation_with_pg_upgrade/01_performing_an_upgrade/) |
| EPAS | All versions from 16.0 and prior to 16.7.0 | [Upgrade EPAS 16 to Minor release](https://www.enterprisedb.com/docs/epas/16/upgrading/04_upgrading_an_installation_with_pg_upgrade/01_performing_an_upgrade/) |
| EPAS | All versions from 16.0 and prior to 16.7.0 | [Upgrade EPAS 16 to Minor release](https://www.enterprisedb.com/docs/epas/16/upgrading/major_upgrade/01_performing_an_upgrade/) |

!!! Warning
If impacted users are currently relying on non-superusers to run edbldr and read data from the server filesystem without any special permissions, the fixed versions of EPAS could break these workflows. It is recommended that users do one of the following:
Expand Down
8 changes: 4 additions & 4 deletions product_docs/docs/epas/16/upgrading/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ redirects:
- /epas/latest/epas_upgrade_guide/
---

Upgrading EDB Postgres Advanced Server involves:
Upgrading an EDB Postgres Advanced Server installation varies depending on whether you want to perform a major or minor version upgrade.

- Use `pg_upgrade` to perform upgrades between major versions of EDB Postgres Advanced Server.
- Use `dnf`, `apt-get` or StackBuilder Plus to perform upgrades between minor versions of EDB Postgres Advanced Server. The method you use depends on the underlying operating system.

- `pg_upgrade` to upgrade from an earlier version of EDB Postgres Advanced Server to the latest version.
- `yum` to perform a minor version upgrade on a Linux host.
- `StackBuilder Plus` to perform a minor version upgrade on a Windows host.
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
---
title: "Performing an upgrade"
description: "Describes how to upgrade an earlier version of EDB Postgres Advanced Server to the current version"
description: "Describes how to upgrade an earlier version of EDB Postgres Advanced Server to the current version."
redirects:
- /epas/latest/epas_upgrade_guide/04_upgrading_an_installation_with_pg_upgrade/01_performing_an_upgrade/
- /epas/latest/upgrading/04_upgrading_an_installation_with_pg_upgrade/01_performing_an_upgrade
---

To upgrade an earlier version of EDB Postgres Advanced Server to the current version:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
---
title: "Upgrading an installation with pg_upgrade"
description: "Describes using pg_upgrade to migrate from an earlier version of EDB Postgres Advanced Server to the newest version"
title: "Major version upgrade with pg_upgrade"
description: "Describes using pg_upgrade to migrate from an earlier major version of EDB Postgres Advanced Server to the most recent version."
indexCards: simple
navigation:
- 03_limitations
- how_pg_upgrade_works
- 01_performing_an_upgrade
- 02_invoking_pg_upgrade
Expand All @@ -12,12 +13,13 @@ navigation:
- 06_reverting_to_the_old_cluster
redirects:
- /epas/latest/epas_upgrade_guide/04_upgrading_an_installation_with_pg_upgrade/
- /epas/latest/upgrading/04_upgrading_an_installation_with_pg_upgrade
---

<div id="upgrading_an_installation_with_pg_upgrade" class="registered_link"></div>

!!! Note
Review the [upgrade considerations](../03_limitations/) prior to performing an upgrade with the `pg_upgrade` utility.
Review the [upgrade considerations](03_limitations) prior to performing an upgrade with the `pg_upgrade` utility.

While minor upgrades between versions are fairly simple and require only installing new executables, past major version upgrades were both expensive and time consuming. `pg_upgrade` eases migration between any version of EDB Postgres Advanced Server (version 9.0 or later) and any later release of EDB Postgres Advanced Server that's supported on the same platform.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
---
title: "Performing a minor version update of an RPM installation"
description: "For RPM package installs, how to perform a minor version upgrade to a more recent version"
title: "Performing a minor version upgrade on an RPM installation"
description: "For RPM package installs, how to perform a minor version upgrade to a more recent version."
redirects:
- /epas/latest/epas_upgrade_guide/05_performing_a_minor_version_update_of_an_rpm_installation/
---

If you are upgrading a Red Hat Enterprise Linux-based system (or a compatible system such as Rocky Linux, Alma Linux, Oracle Linux), then you used an RPM package to install EDB Postgres Advanced Server. To perform a minor upgrade on these systems, use the `dnf` package manager.

!!! Note
This procedure only performs an update between minor EPAS releases. To upgrade to a later major release, use the [`pg_upgrade` procedure](04_upgrading_an_installation_with_pg_upgrade).
This procedure only performs an upgrade between minor EPAS releases. To upgrade to a later major release, use the [`pg_upgrade` procedure](../major_upgrade/).

1. To list the package updates that are available for your system, open a command line, assume root privileges, and run:

Expand All @@ -34,6 +34,8 @@ If you are upgrading a Red Hat Enterprise Linux-based system (or a compatible sy
dnf update edb*
```

1. Restart your server to complete the upgrade.

For more information about using `dnf` commands and options, enter `dnf --help` at the command line.

!!! Important
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: "Using StackBuilder Plus to perform a minor version update"
description: "How to use the StackBuilder Plus utility to install supporting modules "
title: "Using StackBuilder Plus to perform a minor version upgrade"
description: "How to use the StackBuilder Plus utility to install supporting modules."
redirects:
- /epas/latest/epas_upgrade_guide/06_using_stackbuilder_plus_to_perform_a_minor_version_update/
---
Expand Down
18 changes: 18 additions & 0 deletions product_docs/docs/epas/16/upgrading/minor_upgrade/index.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
title: "Minor version upgrade with package manager"
description: "Describes using a package manager to perfom a minor version upgrade of EDB Postgres Advanced Server."
navigation:
- 05_performing_a_minor_version_update_of_an_rpm_installation
- performing_a_minor_version_update_of_Deb_installation
- 06_using_stackbuilder_plus_to_perform_a_minor_version_update
---

Minor version upgrades are fairly simple and only require updating existing executables and restarting the database server.

Select the minor upgrade method according to the underlying operating system of your database server:

- If you installed an RPM package of EDB Postgres Advanced Server (on RHEL, AlmaLinux, Rocky Linux) with `dnf`, see [Performing a minor version 06_using_stackbuilder_plus_to_perform_a_minor_version_update of an RPM installation](05_performing_a_minor_version_update_of_an_rpm_installation).

- If you installed a Debian package of EDB Postgres Advanced Server (on Ubuntu, Debian) with `apt-get`, see [Performing a minor version upgrade of a Debian installation](performing_a_minor_version_update_of_Deb_installation).

- If you installed EDB Postgres Advanced Server with StackBuilder Plus, see [Using StackBuilder Plus to perform a minor version upgrade](06_using_stackbuilder_plus_to_perform_a_minor_version_update).
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
---
title: "Performing a minor version upgrade on a Debian installation"
description: "For Debian package installs, how to perform a minor version upgrade to a more recent version."
---

If you are upgrading a Debian-based system (or a compatible system such as Ubuntu), then you used a Debian package to install EDB Postgres Advanced Server. To perform a minor upgrade on these systems, use the `apt-get` package manager.

!!! Note
This procedure only performs an upgrade between minor EPAS releases. To upgrade to a later major release, use the [`pg_upgrade` procedure](../major_upgrade/).

1. To list the package updates that are available for your system, open a command line, assume root privileges, and run:

```shell
apt-get install --simulate <package_name>
```

Where `package_name` is the search term for which you want to list available updates. You can include wildcard values in the search to list multiple related packages with a single command. For example, use the following command to list all packages with names that start with `edb`:

```shell
apt-get install --simulate edb*
```

1. After you identify the package(s), update them:

```shell
apt-get install <package_name>
```

Where `package_name` is the name of the package you want to update. You can include wildcard values to update multiple related packages with a single command. For example, use the following command to update all packages with names that start with `edb`:

```shell
apt-get update edb*
```

1. The output asks for confirmation to install the packages:

```console
After this operation, <number> kB of additional disk space will be used.
Do you want to continue? [Y/n] Y
```

1. Confirm by entring the letter `Y` and pressing **Enter**.

1. Restart your server to complete the upgrade.

For more information about using `apt-get` commands and options, enter `apt-get --help` at the command line.

!!! Important

If upgrading to version 15.4 or later, run `edb_sqlpatch`.

The command might respond that it has a number of patches needing to be applied, for example:

```console
* database edb
0 patches were previously applied to this database.
58 patches need to be applied to this database.
```

In this case, you need to run edb_sqlpatch to patch the system catalog:

```shell
edb_sqlpatch -af
```

For more information about using edb_sqlpatch commands and options, see [edb_sqlpatch](/tools/edb_sqlpatch/).

!!!


36 changes: 18 additions & 18 deletions product_docs/docs/pge/16/upgrading/major_upgrade.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ deepToc: true

To perform a major version upgrade, install the new version of EDB Postgres Extended Server, initialize an empty cluster and use pg_upgrade to migrate all data.

If a problem occurs during the upgrade process, you can [revert to the previous version](/epas/latest/upgrading/04_upgrading_an_installation_with_pg_upgrade/06_reverting_to_the_old_cluster/#reverting_to_the_old_cluster).
If a problem occurs during the upgrade process, you can [revert to the previous version](/epas/latest/upgrading/major_upgrade/06_reverting_to_the_old_cluster/#reverting_to_the_old_cluster).

## Overview
## Overview

1. [Prepare your upgrade](#preparing-your-upgrade) by performing a backup of the existing instance.
1. [Install the EDB Postgres Extended Server version](#installing-the-target-edb-postgres-extended-server-version) you're upgrading toward.
Expand All @@ -31,23 +31,23 @@ If a problem occurs during the upgrade process, you can [revert to the previous

This worked example upgrades an EDB Postgres Extended Server 15 database to EDB Postgres Extended Server 16.

!!!note
You can perform major upgrades of EDB Postgres Extended Server instances in the same way you upgrade an EDB Postgres Advanced Server installation. If you need more information about the pg_upgrade utility, command line options, troubleshooting, and more, see [Upgrading an installation with pg_upgrade](/epas/latest/upgrading/04_upgrading_an_installation_with_pg_upgrade/).
!!!note
You can perform major upgrades of EDB Postgres Extended Server instances in the same way you upgrade an EDB Postgres Advanced Server installation. If you need more information about the pg_upgrade utility, command line options, troubleshooting, and more, see [Upgrading an installation with pg_upgrade](/epas/latest/upgrading/major_upgrade/).

### Preparing your upgrade
### Preparing your upgrade

Use [pg_dumpall](https://www.postgresql.org/docs/current/app-pg-dumpall.html), [pgBackRest](/supported-open-source/pgbackrest/), or [Barman](/supported-open-source/barman/) to create a backup of your source server.

### Installing the target EDB Postgres Extended Server version

[Install EDB Postgres Extended Server](../installing/) version 16. Only install the packages. Don't perform any other configurations.

### Creating a target server
### Creating a target server

If you don't want to create a new target instance but want to reuse an existing server with the target EDB Postgres Extended Server version, skip these steps and [ensure the target server is empty](/epas/latest/upgrading/04_upgrading_an_installation_with_pg_upgrade/03_upgrading_to_advanced_server/#step-2---empty-the-target-database).
If you don't want to create a new target instance but want to reuse an existing server with the target EDB Postgres Extended Server version, skip these steps and [ensure the target server is empty](/epas/latest/upgrading/major_upgrade/03_upgrading_to_advanced_server/#step-2---empty-the-target-database).

1. As postgres, create an empty directory for the new server:

```
mkdir /var/lib/edb-pge/16/upgrade_target
```
Expand All @@ -60,7 +60,7 @@ If you don't want to create a new target instance but want to reuse an existing
```

1. As postgres, initialize the new server:

```
/usr/lib/edb-pge/16/bin/initdb -D /var/lib/edb-pge/16/upgrade_target
```
Expand All @@ -75,7 +75,7 @@ If you don't want to create a new target instance but want to reuse an existing
/usr/lib/edb-pge/16/bin/pg_ctl -D /var/lib/edb-pge/16/upgrade_target start
```

!!!note
!!!note
You can also start the server with the `logfile` option enabled to print errors into a logfile:
`/usr/lib/edb-pge/16/bin/pg_ctl -D /var/lib/edb-pge/16/upgrade_target -l logfile start`

Expand All @@ -92,20 +92,20 @@ If you don't want to create a new target instance but want to reuse an existing

### Upgrading to the target server

1. If you have any extensions or component services running in the source cluster, stop them before starting the upgrade. See [Stop all component services and servers](/epas/latest/upgrading/04_upgrading_an_installation_with_pg_upgrade/03_upgrading_to_advanced_server/#step-4---stop-all-component-services-and-servers) for more information
1. If you have any extensions or component services running in the source cluster, stop them before starting the upgrade. See [Stop all component services and servers](/epas/latest/upgrading/major_upgrade/03_upgrading_to_advanced_server/#step-4---stop-all-component-services-and-servers) for more information

1. Stop both the source and target servers:

1. Stop both the source and target servers:

```
/usr/lib/edb-pge/15/bin/pg_ctl -D /var/lib/edb-pge/15/upgrade-source stop
/usr/lib/edb-pge/16/bin/pg_ctl -D /var/lib/edb-pge/16/upgrade-target stop
```

1. To test for incompatibilities, run the `pg_upgrade` command in check mode.

With `-b` and `-B`, specify the source and target BIN directories. With `-d` and `-D`, specify the source and target CONFIG directories:

```
```
/usr/lib/edb-pge/16/bin/pg_upgrade -b /usr/lib/edb-pge/15/bin -B /usr/lib/edb-pge/16/bin -d /var/lib/edb-pge/15/upgrade-source -D /var/lib/edb-pge/16/upgrade-target --check
```

Expand Down Expand Up @@ -134,7 +134,7 @@ If you don't want to create a new target instance but want to reuse an existing

1. Restart the extensions or component services you disabled in the source cluster but in the target cluster.

### Cleaning up after upgrade
### Cleaning up after upgrade

After you verify that pg_upgrade migrated the data successfully, and the services are running as expected, perform a cleanup.

Expand All @@ -150,6 +150,6 @@ After you verify that pg_upgrade migrated the data successfully, and the service
./delete_old_cluster.sh
```

## More information
## More information

Review [Upgrading an installation with pg_upgrade](/epas/latest/upgrading/04_upgrading_an_installation_with_pg_upgrade/) for more information on pg_upgrade options, troubleshooting, and other considerations.
Review [Upgrading an installation with pg_upgrade](/epas/latest/upgrading/major_upgrade/) for more information on pg_upgrade options, troubleshooting, and other considerations.