Updating a TimescaleDB Docker installation
The following steps should be taken with a docker installation to upgrade to the latest TimescaleDB version, while retaining data across the updates.
The following instructions assume that your docker instance is named . If not, replace this name with the one you use in the subsequent commands.
Step 1: Pull new image
Install the current TimescaleDB 1.7.4 image:
Step 2: Determine mount point used by old container
There are two types of mounts. To find which mount type your old container is using you can run the following command:
This command will return either volume
or bind
, corresponding to the two options below.
Volumes — to get the current volume name use:
— to get the current mount path use:
/path/to/data
Step 3: Stop old container
Step 4: Start new container
Launch a new container with the updated docker image, but pointing to the existing mount point. This will again differ by mount type.
For volume mounts you can use:
If using bind-mounts, you need to run:
Step 5: Run ALTER EXTENSION
Finally, connect to this instance via psql
(with the -X
flag) and execute the command as above in order to update the extension to the latest version:
docker exec -it timescaledb psql -U postgres -X
# within the PostgreSQL instance
ALTER EXTENSION timescaledb UPDATE;