If you originally installed TimescaleDB using Docker, you can upgrade from within the Docker container. This allows you to upgrade to the latest TimescaleDB version, while retaining your data.
In this section, the examples use a Docker instance called
timescaledb. If you have given your Docker instance a different name, replace it when you issue the commands.
Try for free on Timescale
Timescale is a fully managed service with automatic backup and restore, high availability with replication, seamless scaling and resizing, and much more. You can try Timescale free for thirty days.
When you start your upgraded Docker container, you need to be able to point the new Docker image to the location that contains the data from your previous version. To do this, you need to work out where the current mount point is. The current mount point varies depending on whether your container is using volume mounts, or bind mounts.
Work out what type of mount your Docker container uses by running this command, which returns either
Get the current name or mount path with this command, and record it to use when you perform the upgrade. Make sure you copy the correct command, based on your mount point type.Volume mountBind mount
To upgrade TimescaleDB within Docker, you need to download the upgraded image, stop the old container, and launch the new container pointing to your existing data.
Pull the latest TimescaleDB image. This command pulls the image for PostgreSQL 14. If you're using another PostgreSQL version, look for the relevant tag in the TimescaleDB HA Docker Hub repository.
Stop the old container, and remove it:
Launch a new container with the upgraded Docker image, pointing to the existing mount point. Make sure you copy the correct command, based on your mount point type.
For volume mounts:Volume mountBind mount
Connect to the upgraded instance using
At the psql prompt, use the
ALTERcommand to upgrade the extension:
Update the TimescaleDB Toolkit extension. Toolkit is packaged with TimescaleDB's HA Docker image, and includes additional hyperfunctions to help you with queries and data analysis:
If you have multiple databases, you need to update each database separately.
Found an issue on this page?Report an issue!