Skip to content

Commit

Permalink
Revert "Move Updating How To to new template (github#1242)" (github#1273
Browse files Browse the repository at this point in the history
)

This reverts commit 0e17abb.
  • Loading branch information
Loquacity authored Jul 7, 2022
1 parent f378faa commit 1914961
Show file tree
Hide file tree
Showing 17 changed files with 756 additions and 634 deletions.
19 changes: 0 additions & 19 deletions _partials/_plan_upgrade.mdx

This file was deleted.

59 changes: 21 additions & 38 deletions timescaledb/how-to-guides/page-index/page-index.js
Original file line number Diff line number Diff line change
Expand Up @@ -745,61 +745,44 @@ module.exports = [
],
},
{
title: "Upgrade TimescaleDB",
href: "upgrades",
title: "Update TimescaleDB",
href: "update-timescaledb",
children: [
{
title: "About upgrades",
href: "about-upgrades",
tags: ["upgrade", "update", "timescaledb"],
keywords: ["upgrade", "TimescaleDB"],
excerpt: "Learn about upgrading TimescaleDB",
title: "Update from TimescaleDB 1.x to 2.x",
href: "update-timescaledb-2",
tags: ["upgrade", "1-x", "2-x", "timescaledb"],
keywords: ["upgrade", "1-x", "2-x", "TimescaleDB"],
excerpt: "Upgrade from TimescaleDB 1.x to TimescaleDB 2.x",
},
{
title: "Minor upgrades",
href: "minor-upgrades",
tags: ["upgrade", "update", "timescaledb"],
keywords: ["upgrade", "TimescaleDB"],
title: "Update using Docker",
href: "updating-docker",
tags: ["upgrade", "docker", "1-x", "2-x", "timescaledb"],
keywords: ["upgrade", "docker", "1-x", "2-x", "TimescaleDB"],
excerpt:
"Upgrade to a new minor version of TimescaleDB",
"Upgrade from TimescaleDB 1.x to TimescaleDB 2.x using Docker",
},
{
title: "Major upgrades",
href: "major-upgrades",
tags: ["upgrade", "update", "timescaledb"],
keywords: ["upgrade", "TimescaleDB"],
excerpt:
"Upgrade to a new major version of TimescaleDB",
title: "Upgrade PostgreSQL",
href: "upgrade-postgresql",
tags: ["upgrade", "postregsql", "timescaledb"],
keywords: ["upgrade", "postgresql", "TimescaleDB"],
excerpt: "Upgrade the version of PostgreSQL used by TimescaleDB",
},
{
title: "Downgrade TimescaleDB",
href: "downgrade",
href: "downgrade-timescaledb",
tags: ["downgrade", "timescaledb"],
keywords: ["TimescaleDB", "downgrade"],
excerpt: "Downgrade a TimescaleDB version",
},
{
title: "Upgrade within Docker",
href: "upgrade-docker",
tags: ["upgrade", "update", "docker", "timescaledb"],
keywords: ["upgrade", "docker", "TimescaleDB"],
excerpt:
"Upgrade to a new minor version of TimescaleDB within a Docker container",
},
{
title: "Upgrade PostgreSQL",
href: "upgrade-pg",
tags: ["upgrade", "update", "postgresql", "timescaledb"],
keywords: ["upgrade", "PostgreSQL", "TimescaleDB"],
excerpt:
"Upgrade to a new version of PostgreSQL",
},
{
title: "Troubleshooting upgrades",
title: "Troubleshooting updates",
href: "troubleshooting",
tags: ["tshoot", "upgrade", "update", "timescaledb"],
tags: ["tshoot", "upgrade", "timescaledb"],
keywords: ["troubleshooting", "upgrade", "TimescaleDB"],
excerpt: "Troubleshoot upgrading your TimescaleDB installation",
excerpt: "Troubleshoot updating your TimescaleDB installation",
},
],
},
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Downgrade TimescaleDB versions
If you upgrade your TimescaleDB version and encounter problems, you can
immediately roll back your upgrade. To downgrade to your previous version,
connect to your database and run:
```sql
ALTER EXTENSION timescaledb UPDATE TO '<PREVIOUS_VERSION>';
```

For example:
```sql
ALTER EXTENSION timescaledb UPDATE TO '2.5.1';
```

<highlight type="important">
If you're connecting to your database with `psql`,
connect with the `-X` flag. This prevents any commands in `.psqlrc` from loading
another TimescaleDB version.
</highlight>

You can verify that the downgrade worked by running `\dx timescaledb` to see the
version number of the extension.

## Limitations
Downgrading might not be supported for all versions. Where possible, downgrades
between patch versions and between consecutive minor versions are supported. For
example, you can downgrade from TimescaleDB 2.5.2 to 2.5.1, or from 2.5.0 to
2.4.2. However, some versions might not support downgrading. To check whether
you can downgrade from a specific version, see the [release
notes](https://docs.timescale.com/timescaledb/latest/overview/release-notes/).

Where supported, the downgrade script is tested for a single-step downgrade from
the current version to the previous version. Multi-step downgrades may work but
have not been tested. Downgrading might not work if you make changes to your
database between upgrading and downgrading.
122 changes: 122 additions & 0 deletions timescaledb/how-to-guides/update-timescaledb/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
# Update TimescaleDB versions

Update your TimescaleDB version with an in-place update. By updating in-place,
you don't need to dump and restore your data. Automated migration scripts handle
conversion of internal states where needed.

<highlight type="cloud" header="Make upgrades automatic" button="Try Timescale Cloud for free">
Timescale Cloud avoids the manual work involved in updating your TimescaleDB version.
Updates take place automatically during a maintenance window picked by you.
[Learn more](https://docs.timescale.com/cloud/latest/service-operations/maintenance/)
about automatic version updates in Timescale Cloud.
</highlight>

<highlight type="important">
Follow these instructions to update TimescaleDB within the same major release
version. For example, you can update from TimescaleDB 2.1 to 2.2, or from 1.7 to
1.7.4. To update from 1.x to 2.x, see the [section on updating to TimescaleDB
2.x](https://docs.timescale.com/timescaledb/latest/how-to-guides/update-timescaledb/update-timescaledb-2/).
</highlight>

## TimescaleDB release compatibility

TimescaleDB supports the following PostgreSQL releases. If you aren't running a
compatible release, update PostgreSQL before updating TimescaleDB. To learn
more, see the sections on updating PostgreSQL in
[Timescale Cloud][cloud-update-pg],
[Managed Service for TimescaleDB][mst-update-pg], and
[self-hosted TimescaleDB][self-hosted-update-pg].

| TimescaleDB release | Supported PostgreSQL releases |
| ------------------- | ----------------------------- |
| 1.7 | 9.6, 10, 11, 12 |
| 2.0 | 11, 12 |
| 2.1-2.3 | 11, 12, 13 |
| 2.4 | 12, 13 |
| 2.5+ | 12, 13, 14 |

<highlight type="important">
To make sure your update completes properly, update PostgreSQL and TimescaleDB
separately. Keep PostgreSQL and TimescaleDB versions compatible throughout the
process. If your update spans multiple versions, this could require several steps.

For example, if you're currently running PostgreSQL 10 and TimescaleDB 1.7.5,
and you want to update to PostgreSQL 13 and TimescaleDB 2.2:

1. Upgrade PostgreSQL 10 to PostgreSQL 12
1. Update TimescaleDB 1.7.5 to TimescaleDB 2.2 on PostgreSQL 12
1. Upgrade PostgreSQL 12 to PostgreSQL 13 with TimescaleDB 2.2 installed

</highlight>

## Update TimescaleDB

Update TimescaleDB by using PostgreSQL's `ALTER EXTENSION` command. You can run
different TimescaleDB versions on different databases within the same PostgreSQL
instance. You can also update your extensions independently on different
databases.

<highlight type="important">
Before updating, check the [release
notes](https://docs.timescale.com/timescaledb/latest/overview/release-notes/)
for the version you want to update to. Specific versions might have different
update requirements that add additional steps.
</highlight>

<procedure>

### Updating TimescaleDB

1. [Back up][backup] your database with [`pg_dump`][pg_dump].
1. [Install][install] the latest version of the TimescaleDB extension.
1. Connect to your database with a PostgreSQL client. This example uses `psql`,
but any client works. If you're using `psql`, connect with the `-X` flag.
This prevents any commands in `.psqlrc` from loading a previous TimescaleDB
version on session startup.
```bash
psql -X "postgres://<USERNAME>:<PASSWORD>@<HOST>:<PORT>/<DB_NAME>?sslmode=require"
```
Do not run any other commands before continuing to the next step.
1. At the `psql` prompt, upgrade TimescaleDB to the latest installed version:
```sql
ALTER EXTENSION timescaledb UPDATE;
```
This upgrades TimescaleDB to the latest installed version, even if you're
several versions behind. To update to a version that's not the latest
installed version, specify the version number, like this:
```sql
ALTER EXTENSION timescaledb UPDATE TO '2.5.1';
```
1. Verify that the upgrade worked by running `\dx timescaledb` to see the
version number of the extension.

```sql
\dx timescaledb
Name | Version | Schema | Description
------------+---------+------------+---------------------------------------------------------------------
timescaledb | x.y.z | public | Enables scalable inserts and complex queries for time-series data
(1 row)
```

</procedure>

## Downgrade TimescaleDB

If you encounter a problem immediately after upgrading, you can roll back your
upgrade. To learn more, see the [section on downgrading TimescaleDB][downgrade].

[backup]: /how-to-guides/backup-and-restore/
[changes-in-2.0]: /overview/release-notes/changes-in-timescaledb-2/
[cloud-update-pg]: cloud/:currentVersion:/maintenance/#upgrade-to-a-new-postgresql-version
[downgrade]: /how-to-guides/update-timescaledb/downgrade-timescaledb/
[install]: /install/:currentVersion:/
[mst-update-pg]: https://kb-managed.timescale.com/en/articles/5368016-perform-a-postgresql-major-version-upgrade
[pg_dump]: https://www.postgresql.org/docs/current/app-pgdump.html
[pg_upgrade]: https://www.postgresql.org/docs/current/static/pgupgrade.html
[self-hosted-update-pg]: /timescaledb/:currentVersion:/how-to-guides/update-timescaledb/upgrade-postgresql/
[telemetry]: /administration/telemetry/
[update-docker]: /how-to-guides/update-timescaledb/updating-docker/
[update-timescaledb]: /how-to-guides/update-timescaledb/update-timescaledb/
[update-tsdb-2]: /how-to-guides/update-timescaledb/update-timescaledb-2/
[upgrade-pg]: /how-to-guides/update-timescaledb/upgrade-postgresql/
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,8 @@ with updating your TimescaleDB installation.
* Copy this comment at the top of every troubleshooting page
-->

## Upgrading fails with an error saying `no update path`
In some cases, when you use the `ALTER EXTENSION timescaledb UPDATE` command to
upgrade, it might fail with an error like this:
## Updating fails with an error saying `no update path`
In some cases, when you use the `ALTER EXTENSION timescaledb UPDATE` command to update, it might fail with an error like this:

```sql
ERROR: extension "timescaledb" has no update path from version "2.5.2" to version "2.6.1"
Expand All @@ -23,5 +22,5 @@ ERROR: extension "timescaledb" has no update path from version "2.5.2" to versio
This occurs if the list of available extensions does not include the version you
are trying to upgrade to, and it can occur if the package was not installed
correctly in the first place. To correct the problem, install the upgrade
package, restart PostgreSQL, verify the version, and then attempt the upgrade
package, restart PostgreSQL, verify the version, and then attempt the update
again.
Loading

0 comments on commit 1914961

Please sign in to comment.