-
Notifications
You must be signed in to change notification settings - Fork 80
add timescale migration & clean up postgres stuff #607
Conversation
|
This pull request has been linked to Shortcut Story #12923: Document process of migrating PostgreSQL database. |
guides/admin/timescale-migration.md
Outdated
| 1. Import the data into your database: | ||
|
|
||
| ``` console | ||
| cat backup.sql > psql -U coder |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| cat backup.sql > psql -U coder | |
| psql -U coder < backup.sql |
guides/admin/timescale-migration.md
Outdated
| > If your database is large, you can truncate Coder's telemetry, metrics, and | ||
| > audit log to reduce the file size. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would probably be better to give specific examples for truncating
TRUNCATE metric_events;
TRUNCATE environment_stats;
TRUNCATE audit_logs;
guides/admin/timescale-migration.md
Outdated
| > If your database is large, you can truncate Coder's telemetry, metrics, and | ||
| > audit log to reduce the file size. | ||
|
|
||
| 1. Access your PostgreSQL instance and create user `coder` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| 1. Access your PostgreSQL instance and create user `coder` | |
| 1. Access your PostgreSQL instance and create user and database `coder` |
guides/admin/timescale-migration.md
Outdated
| 1. Connect your Coder instance to the database: | ||
|
|
||
| ```console | ||
| helm upgrade -n coder coder coder/coder \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| helm upgrade -n coder coder coder/coder \ | |
| helm upgrade --reuse-values -n coder coder coder/coder \ |
guides/admin/timescale-migration.md
Outdated
| title: Migrating data from TimescaleDB | ||
| description: Learn how to migrate data from the TimescaleDB to a PostgreSQL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Referring to the built-in database as TimescaleDB is a bit confusing because we no longer use Timescale, and it's just a regular database. Maybe we just refer to it as the built-in Postgres or bundled Postgres.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
makes sense - thing is, the default db is still referred to as timescale-0 in the cluster. so it could get confusing for those not familiar with timescale.
|
✨ Coder.com for PR #607 deployed! It will be updated on every commit.
|
deansheather
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Colin's review is spot on
guides/admin/timescale-migration.md
Outdated
| TRUNCATE audit_logs; | ||
| ``` | ||
|
|
||
| 1. Access your PostgreSQL instance and create user and database `coder` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm a bit confused by this; they should create a coder user AND a database coder?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, PostgreSQL has user, database, and schema. Multiple users can have access to a database, and database can have multiple schemas. So yes, people should create a user name coder that has access to a database, also named coder
|
@khorne3 - let me know if we're good to merge. Thanks! |
|
@ericpaulsen sorry for the delay! just waiting for the preview and if it looks ok, we can ship! |
|
No worries! Appreciate your wordsmithing. |
adding a guide for migrating data out of timescale and into an external postgreSQL instance. also includes cleans up existing db docs.
[ch12923]