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

3579 feedback page self hostedlatestupgradesminor upgrade #3630

Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion _partials/_install-self-hosted-docker-based.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ In Terminal:
[TimescaleDB Toolkit](https://github.com/timescale/timescaledb-toolkit), and support for PostGIS and Patroni.
The lighter-weight `timescale/timescaledb:latest-pg17` non-ha image uses [Alpine][alpine].

TimescaleDB is pre-created in the default Postgres database in both the -ha and non-ha docker images.
TimescaleDB is pre-created in the default PostgreSQL database in both the -ha and non-ha docker images.
By default, TimescaleDB is added to any new database you create in these images.

1. **Run the container**
Expand Down
2 changes: 1 addition & 1 deletion _partials/_migrate_dump_postgresql.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import MigrationSetupFirstSteps from "versionContent/_partials/_migrate_set_up_database_first_steps.mdx";
import MigrationSetupDBConnectionPostgresql from "versionContent/_partials/_migrate_set_up_align_db_extensions_postgres_based.mdx";
import MigrationProcedureDumpSchemaPostgres from "versionContent/_partials/_migrate_dump_roles_schema_data_postgres.mdx";
import MigrationProcedureDumpSchemaPostgreSQL from "versionContent/_partials/_migrate_dump_roles_schema_data_postgres.mdx";
import MigrationValidateRestartApp from "versionContent/_partials/_migrate_validate_and_restart_app.mdx";

## Prepare to migrate
Expand Down
4 changes: 2 additions & 2 deletions _partials/_migrate_install_psql_ec2_instance.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
```sh
export SOURCE="postgres://<Master username>:<Master password>@<Endpoint>:<Port>/<DB name>"
```
The value of `Master password` was supplied when this Postgres RDS instance was created.
The value of `Master password` was supplied when this PostgreSQL RDS instance was created.

1. Test your connection:
```sh
Expand All @@ -71,4 +71,4 @@
</Procedure>

[about-hypertables]: /use-timescale/:currentVersion:/hypertables/about-hypertables/
[data-compression]: /use-timescale/:currentVersion:/compression/about-compression/
[data-compression]: /use-timescale/:currentVersion:/compression/about-compression/
6 changes: 3 additions & 3 deletions _partials/_migrate_live_setup_connection_strings.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ These variables hold the connection information for the source database and targ
In Terminal on your migration machine, set the following:

```bash
export SOURCE=postgres://<user>:<password>@<source host>:<source port>/<db_name>
export TARGET=postgres://tsdbadmin:<PASSWORD>@<HOST>:<PORT>/tsdb?sslmode=require
export SOURCE="postgres://<user>:<password>@<source host>:<source port>/<db_name>"
export TARGET="postgres://tsdbadmin:<PASSWORD>@<HOST>:<PORT>/tsdb?sslmode=require"
```
You find the connection information for your Timescale Cloud service in the configuration file you
downloaded when you created the service.
downloaded when you created the service.
36 changes: 36 additions & 0 deletions _partials/_migrate_self_postgres_check_versions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<Procedure>

To see the versions of PostgreSQL and TimescaleDB running in a self-hosted database instance:

1. **Set your connection string**

This variable holds the connection information for the database to upgrade:

```bash
export SOURCE="postgres://<user>:<password>@<source host>:<source port>/<db_name>"
```

2. **Retrieve the version of PostgreSQL that you are running**
```shell
psql -X -d $SOURCE -c "SELECT version();"
```
PostgreSQL returns something like:
```shell
-----------------------------------------------------------------------------------------------------------------------------------------
PostgreSQL 17.2 (Ubuntu 17.2-1.pgdg22.04+1) on aarch64-unknown-linux-gnu, compiled by gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0, 64-bit
(1 row)
```

1. **Retrieve the version of TimescaleDB that you are running**
```sql
psql -X -d $SOURCE -c "\dx timescaledb;"
```
PostgreSQL returns something like:
```shell
Name | Version | Schema | Description
-------------+---------+------------+---------------------------------------------------------------------
timescaledb | 2.17.2 | public | Enables scalable inserts and complex queries for time-series data
(1 row)
```

</Procedure>
37 changes: 37 additions & 0 deletions _partials/_migrate_self_postgres_implement_migration_path.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<Procedure>

You cannot upgrade TimescaleDB and PostgreSQL at the same time. You upgrade each product in
the following steps:

1. **Upgrade TimescaleDB**

```sql
psql -X -d $SOURCE -c "ALTER EXTENSION timescaledb UPDATE TO '<version number>';"
```

1. **If your migration path dictates it, upgrade PostgreSQL**

Follow the procedure in [Upgrade PostgreSQL][upgrade-pg]. The version of TimescaleDB installed
in your PostgreSQL deployment must be the same before and after the PostgreSQL upgrade.

1. **If your migration path dictates it, upgrade TimescaleDB again**

```sql
psql -X -d $SOURCE -c "ALTER EXTENSION timescaledb UPDATE TO '<version number>';"
```

1. **Check that you have upgraded to the correct version TimescaleDB**
billy-the-fish marked this conversation as resolved.
Show resolved Hide resolved

```sql
psql -X -d $SOURCE -c "\dx timescaledb;"
```
PostgreSQL returns something like:
```shell
Name | Version | Schema | Description
-------------+---------+--------+---------------------------------------------------------------------------------------
timescaledb | 2.17.2 | public | Enables scalable inserts and complex queries for time-series data (Community Edition)
```

</Procedure>

[upgrade-pg]: /self-hosted/:currentVersion:/upgrades/upgrade-pg/#upgrade-your-postgresql-instance
17 changes: 17 additions & 0 deletions _partials/_migrate_self_postgres_plan_migration_path.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@

import SupportMatrix from "versionContent/_partials/_migrate_self_postgres_timescaledb_compatibility.mdx";

Check the following support matrix against the versions of TimescaleDB and PostgreSQL that you are
running currently and the versions you want to update to, then choose your upgrade path.

For example, to upgrade from TimescaleDB 2.13 on PostgreSQL 13 to TimescaleDB 2.17.2 you need to:
1. Upgrade TimescaleDB to 2.16
1. Upgrade PostgreSQL to 14 or higher
1. Upgrade TimescaleDB to 2.17.2.

If you are currently running versions of TimescaleDB and PostgreSQL that are incompatible,[upgrade PostgreSQL][upgrade-pg]
to a supported version before you upgrade TimescaleDB.

<SupportMatrix />

[upgrade-pg]: /self-hosted/:currentVersion:/upgrades/upgrade-pg/#upgrade-your-postgresql-instance
24 changes: 24 additions & 0 deletions _partials/_migrate_self_postgres_timescaledb_compatibility.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@

| Version number |PostgreSQL 17|PostgreSQL 16|PostgreSQL 15|PostgreSQL 14|PostgreSQL 13|PostgreSQL 12|PostgreSQL 11|PostgreSQL 10|
|---------------------------|-|-|-|-|-|-|-|-|
| TimescaleDB<br/> 2.17.x |&#9989;|&#9989;|&#9989;|&#9989;|&#10060;|&#10060;|&#10060;|&#10060;|&#10060;|
| TimescaleDB<br/> 2.16.x |&#10060;|&#9989;|&#9989;|&#9989;|&#9989;|&#10060;|&#10060;|&#10060;|&#10060;|&#10060;|
| TimescaleDB<br/> 2.15.x |&#10060;|&#9989;|&#9989;|&#9989;|&#9989;|&#10060;|&#10060;|&#10060;|&#10060;|&#10060;|
| TimescaleDB<br/> 2.14.x |&#10060;|&#9989;|&#9989;|&#9989;|&#9989;|&#10060;|&#10060;|&#10060;|&#10060;|&#10060;|
| TimescaleDB<br/> 2.13.x |&#10060;|&#9989;|&#9989;|&#9989;|&#9989;|&#10060;|&#10060;|&#10060;|&#10060;|
| TimescaleDB<br/> 2.12.x |&#10060;|&#10060;|&#9989;|&#9989;|&#9989;|&#10060;|&#10060;|&#10060;|&#10060;|
| TimescaleDB<br/> 2.10.x |&#10060;|&#10060;|&#9989;|&#9989;|&#9989;|&#9989;|&#10060;|&#10060;|&#10060;|
| TimescaleDB<br/> 2.5 - 2.9 |&#10060;|&#10060;|&#10060;|&#9989;|&#9989;|&#9989;|&#10060;|&#10060;|&#10060;|
| TimescaleDB<br/> 2.4 |&#10060;|&#10060;|&#10060;|&#10060;|&#9989;|&#9989;|&#10060;|&#10060;|&#10060;|
| TimescaleDB<br/> 2.1 - 2.3 |&#10060;|&#10060;|&#10060;|&#10060;|&#9989;|&#9989;|&#9989;|&#10060;|&#10060;|
| TimescaleDB<br/> 2.0 |&#10060;|&#10060;|&#10060;|&#10060;|&#10060;|&#9989;|&#9989;|&#10060;|&#10060;
| TimescaleDB<br/> 1.7 |&#10060;|&#10060;|&#10060;|&#10060;|&#10060;|&#9989;|&#9989;|&#9989;|&#9989;|

We recommend not using TimescaleDB with PostgreSQL 17.1, 16.5, 15.9, 14.14, 13.17, 12.21.
These minor versions [introduced a breaking binary interface change][postgres-breaking-change] that,
once identified, was reverted in subsequent minor PostgreSQL versions 17.2, 16.6, 15.10, 14.15, 13.18, and 12.22.
When you build from source, best practice is to build with PostgreSQL 17.2, 16.6, etc and higher.
Users of [Timescale Cloud](https://console.cloud.timescale.com/) and platform packages for Linux, Windows, MacOS,
Docker, and Kubernetes are unaffected.

[postgres-breaking-change]: https://www.postgresql.org/about/news/postgresql-172-166-1510-1415-1318-and-1222-released-2965/
4 changes: 2 additions & 2 deletions _partials/_migrate_set_up_database_first_steps.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
These variables hold the connection information for the source database and target Timescale Cloud service:

```bash
export SOURCE=postgres://<user>:<password>@<source host>:<source port>/<db_name>
export TARGET=postgres://tsdbadmin:<PASSWORD>@<HOST>:<PORT>/tsdb?sslmode=require
export SOURCE="postgres://<user>:<password>@<source host>:<source port>/<db_name>"
export TARGET="postgres://tsdbadmin:<PASSWORD>@<HOST>:<PORT>/tsdb?sslmode=require"
```
You find the connection information for your Timescale Cloud Service in the configuration file you
downloaded when you created the service.
4 changes: 2 additions & 2 deletions _partials/_migrate_set_up_source_and_target.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ databases are referred to as `$SOURCE` and `$TARGET` throughout this guide.
This can be set in your shell, for example:

```bash
export SOURCE=postgres://<user>:<password>@<source host>:<source port>/<db_name>
export TARGET=postgres://<user>:<password>@<target host>:<target port>/<db_name>
export SOURCE="postgres://<user>:<password>@<source host>:<source port>/<db_name>"
export TARGET="postgres://<user>:<password>@<target host>:<target port>/<db_name>"
```
</Highlight>
4 changes: 2 additions & 2 deletions _partials/_migrate_to_upload_to_target.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
These variables hold the connection information for the source database and target Timescale Cloud service:

```bash
export SOURCE=postgres://<user>:<password>@<source host>:<source port>/<db_name>
export TARGET=postgres://tsdbadmin:<PASSWORD>@<HOST>:<PORT>/tsdb?sslmode=require
export SOURCE="postgres://<user>:<password>@<source host>:<source port>/<db_name>"
export TARGET="postgres://tsdbadmin:<PASSWORD>@<HOST>:<PORT>/tsdb?sslmode=require"
```
You find the connection information for your Timescale Cloud Service in the configuration file you
downloaded when you created the service.
Expand Down
14 changes: 6 additions & 8 deletions _partials/_plan_upgrade.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
You can upgrade your self-hosted Timescale installation in-place. This means
that you do not need to dump and restore your data. However, it is still
important that you plan for your upgrade ahead of time.

Before you upgrade:

* Read [the release notes][relnotes] for the Timescale version you are
upgrading to.
* Check which PostgreSQL version you are currently running. You might need to
* Read [the release notes][relnotes] for the version of TimescaleDB that you are upgrading to.
* Check the version TimescaleDB you are currently running, and the version you want to upgrade to
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* Check the version TimescaleDB you are currently running, and the version you want to upgrade to
* Check the version of TimescaleDB you are currently running, and the version you want to upgrade to

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed

against the [upgrade matrix][upgrade-pg]. You may need to up

* You might need to
billy-the-fish marked this conversation as resolved.
Show resolved Hide resolved
[upgrade to the latest PostgreSQL version][upgrade-pg]
before you begin your Timescale upgrade.
* [Perform a backup][backup] of your database. While Timescale
Expand All @@ -15,5 +13,5 @@ Before you upgrade:
case of disaster.

[relnotes]: https://github.com/timescale/timescaledb/releases
[upgrade-pg]: /self-hosted/:currentVersion:/upgrades/upgrade-pg/
[upgrade-pg]: /self-hosted/:currentVersion:/upgrade-pg/#upgrade-your-postgresql-instance
[backup]: /self-hosted/:currentVersion:/backup-and-restore/
2 changes: 1 addition & 1 deletion self-hosted/install/installation-source.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,5 +77,5 @@ And that is it! You have TimescaleDB running on a database on a self-hosted inst
[config]: /self-hosted/:currentVersion:/configuration/
[postgres-download]: https://www.postgresql.org/download/
[cmake-download]: https://cmake.org/download/
[compatibility-matrix]: /self-hosted/:currentVersion:/upgrades/upgrade-pg/
[compatibility-matrix]: /self-hosted/:currentVersion:/upgrades/upgrade-pg/#plan-your-upgrade-path
[postgres-breaking-change]: https://www.postgresql.org/about/news/postgresql-172-166-1510-1415-1318-and-1222-released-2965/
29 changes: 12 additions & 17 deletions self-hosted/page-index/page-index.js
Original file line number Diff line number Diff line change
Expand Up @@ -270,37 +270,32 @@ module.exports = [
href: "upgrades",
children: [
{
title: "About upgrades",
href: "about-upgrades",
excerpt: "Learn about upgrading self-hosted TimescaleDB",
},
{
title: "Minor upgrades",
title: "Upgrade TimescaleDB to a minor version",
href: "minor-upgrade",
excerpt:
"Upgrade to a new minor version of self-hosted TimescaleDB",
"Upgrade self-hosted TimescaleDB to a new minor version",
},
{
title: "Major upgrades",
title: "Upgrade TimescaleDB to a major version",
href: "major-upgrade",
excerpt:
"Upgrade to a new major version of self-hosted TimescaleDB",
},
{
title: "Downgrade self-hosted TimescaleDB",
href: "downgrade",
excerpt: "Downgrade a self-hosted TimescaleDB version",
"Upgrade self-hosted TimescaleDB to a new major version",
},
{
title: "Upgrade within Docker",
title: "Upgrade TimescaleDB running in Docker",
href: "upgrade-docker",
excerpt:
"Upgrade to a new minor version of self-hosted TimescaleDB within a Docker container",
"Upgrade self-hosted TimescaleDB running in a Docker container to a new minor version",
},
{
title: "Upgrade PostgreSQL",
href: "upgrade-pg",
excerpt: "Upgrade to a new version of PostgreSQL",
excerpt: "Upgrade PostgreSQL to a new version",
},
{
title: "Downgrade TimescaleDB to a minor version",
href: "downgrade",
excerpt: "Downgrade self-hosted TimescaleDB to the previous minor version",
},
],
},
Expand Down
2 changes: 1 addition & 1 deletion self-hosted/tooling/install-toolkit.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ The recommended way to install the Toolkit is to use the
To get Toolkit, use the high availability image, `timescaledb-ha`:

```bash
docker pull timescale/timescaledb-ha:pg16
docker pull timescale/timescaledb-ha:pg17
```

For more information on running TimescaleDB using Docker, see the section on
Expand Down
44 changes: 31 additions & 13 deletions self-hosted/upgrades/downgrade.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
---
title: Downgrade to a previous version of TimescaleDB
excerpt: Roll back to an older version of TimescaleDB
excerpt: Downgrade self-hosted TimescaleDB to the previous minor version
products: [self_hosted]
keywords: [upgrades]
---

import ConsiderCloud from "versionContent/_partials/_consider-cloud.mdx";

# Downgrade to a previous version of TimescaleDB
# Downgrade TimescaleDB to a minor version

If you upgrade to a new TimescaleDB version and encounter problems, you can roll
back to a previously installed version. This works in the same way as a minor
Expand Down Expand Up @@ -42,28 +42,41 @@ Before you downgrade:
## Downgrade TimescaleDB to a previous minor version

This downgrade uses the PostgreSQL `ALTER EXTENSION` function to downgrade to
the latest version of the TimescaleDB extension. TimescaleDB supports having
a previous version of the TimescaleDB extension. TimescaleDB supports having
different extension versions on different databases within the same PostgreSQL
instance. This allows you to upgrade and downgrade extensions independently on
different databases. Run the `ALTER EXTENSION` function on each database to
downgrade them individually.

<Highlight type="important">

The downgrade script is tested and supported for single-step downgrades. That
is, downgrading from the current version, to the previous minor version.
Downgrading might not work if you have made changes to your database between
upgrading and downgrading.

</Highlight>

<Procedure>

### Downgrading the TimescaleDB extension
1. **Set your connection string**

This variable holds the connection information for the database to upgrade:

```bash
export SOURCE="postgres://<user>:<password>@<source host>:<source port>/<db_name>"
```

1. Connect to psql using the `-X` flag. This prevents any `.psqlrc` commands
from accidentally triggering the load of a previous TimescaleDB version on
session startup.
1. At the psql prompt, downgrade the TimescaleDB extension. This must be the
first command you execute in the current session:
2. **Connect to your database instance**
```shell
psql -X -d $SOURCE
```

The `-X` flag prevents any `.psqlrc` commands from accidentally triggering the load of a
previous TimescaleDB version on session startup.

1. **Downgrade the TimescaleDB extension**
This must be the first command you execute in the current session:

```sql
ALTER EXTENSION timescaledb UPDATE TO '<PREVIOUS_VERSION>';
Expand All @@ -72,14 +85,19 @@ upgrading and downgrading.
For example:

```sql
ALTER EXTENSION timescaledb UPDATE TO '2.5.1';
ALTER EXTENSION timescaledb UPDATE TO '2.17.0';
```

1. Check that you have downgraded to the correct version of the extension with
the `\dx` command. The output should show the downgraded version number.
1. **Check that you have downgraded to the correct version TimescaleDB**
billy-the-fish marked this conversation as resolved.
Show resolved Hide resolved

```sql
\dx timescaledb
\dx timescaledb;
```
Postgres returns something like:
```shell
Name | Version | Schema | Description
-------------+---------+--------+---------------------------------------------------------------------------------------
timescaledb | 2.17.0 | public | Enables scalable inserts and complex queries for time-series data (Community Edition)
```

</Procedure>
Expand Down
Loading