Skip to content
This repository was archived by the owner on Aug 18, 2025. It is now read-only.

Commit a717894

Browse files
committed
colin's feedback
1 parent 035852e commit a717894

File tree

1 file changed

+17
-11
lines changed

1 file changed

+17
-11
lines changed

guides/admin/timescale-migration.md

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
---
2-
title: Migrating data from TimescaleDB
3-
description: Learn how to migrate data from the TimescaleDB to a PostgreSQL
4-
instance.
2+
title: Migrating data from Coder's built-in PostgreSQL database
3+
description: Learn how to migrate data from the built-in PostgreSQL to an
4+
external PostgreSQL instance.
55
---
66

77
## Background
88

9-
By default, Coder will deploy a Timescale database within the installation's
9+
By default, Coder will deploy a built-in database within the installation's
1010
Kubernetes namespace. We recommend using this database _only_ for evaluation
1111
purposes. With this in mind, you might want to migrate the data stored in your
1212
Timescale instance over to an out-of-cluster PostgreSQL database
@@ -15,27 +15,33 @@ Timescale instance over to an out-of-cluster PostgreSQL database
1515

1616
## Migration Steps
1717

18-
1. Access the timescale pod and dump the database into a file:
18+
1. Access the database pod and dump the database into a file:
1919

2020
```console
2121
kubectl exec -it statefulset/timescale -n coder -- pg_dump -U coder -d coder > backup.sql
2222
```
2323

24-
> If your database is large, you can truncate Coder's telemetry, metrics, and
25-
> audit log to reduce the file size.
24+
1. (Optional) If your database is large, you can truncate Coder's telemetry,
25+
metrics, and audit log to reduce the file size:
2626

27-
1. Access your PostgreSQL instance and create user `coder`
27+
```psql
28+
TRUNCATE metric_events;
29+
TRUNCATE environment_stats;
30+
TRUNCATE audit_logs;
31+
```
32+
33+
1. Access your PostgreSQL instance and create user and database `coder`
2834
2935
1. Import the data into your database:
3036
31-
``` console
32-
cat backup.sql > psql -U coder
37+
``` psql
38+
psql -U coder < backup.sql
3339
```
3440

3541
1. Connect your Coder instance to the database:
3642

3743
```console
38-
helm upgrade -n coder coder coder/coder \
44+
helm upgrade --reuse-values -n coder coder coder/coder \
3945
--set postgres.default.enable=false \
4046
--set postgres.host=<HOST_ADDRESS> \
4147
--set postgres.port=<PORT_NUMBER> \

0 commit comments

Comments
 (0)