From 72b4102b167fbbc39e7ed488bdccae2d0b89a7cb Mon Sep 17 00:00:00 2001 From: Muhammad Atif Ali Date: Sun, 21 May 2023 13:08:20 +0300 Subject: [PATCH 1/2] docs: Add steps to migrate from the internal database to an external database --- docs/admin/configure.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/docs/admin/configure.md b/docs/admin/configure.md index ba94371adb1fe..7f864733338d9 100644 --- a/docs/admin/configure.md +++ b/docs/admin/configure.md @@ -65,6 +65,17 @@ coder server postgres-builtin-url psql "postgres://coder@localhost:49627/coder?sslmode=disable&password=feU...yI1" ``` +### Migrating from internal database to external database + +To migrate from the internal database to an external database, follow these steps: + +1. Stop your Coder deployment. +2. Run `coder server postgres-builtin-serve` in a background terminal. +3. Run `coder server postgres-builtin-url` and copy its output command. +4. Run `pg_dump > coder.sql` to dump the internal database to a file. +5. Restore that content to an external database with `psql < coder.sql`. +6. Start your Coder deployment with `CODER_PG_CONNECTION_URL=`. + ## System packages If you've installed Coder via a [system package](../install/packages.md) Coder, you can From f79b55a2aee686ce86e94f48a89559e94ecb9430 Mon Sep 17 00:00:00 2001 From: Muhammad Atif Ali Date: Sun, 21 May 2023 16:25:49 +0300 Subject: [PATCH 2/2] Review suggestions --- docs/admin/configure.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/admin/configure.md b/docs/admin/configure.md index 7f864733338d9..1b98cca383b97 100644 --- a/docs/admin/configure.md +++ b/docs/admin/configure.md @@ -65,14 +65,14 @@ coder server postgres-builtin-url psql "postgres://coder@localhost:49627/coder?sslmode=disable&password=feU...yI1" ``` -### Migrating from internal database to external database +### Migrating from the built-in database to an external database -To migrate from the internal database to an external database, follow these steps: +To migrate from the built-in database to an external database, follow these steps: 1. Stop your Coder deployment. 2. Run `coder server postgres-builtin-serve` in a background terminal. 3. Run `coder server postgres-builtin-url` and copy its output command. -4. Run `pg_dump > coder.sql` to dump the internal database to a file. +4. Run `pg_dump > coder.sql` to dump the internal database to a file. 5. Restore that content to an external database with `psql < coder.sql`. 6. Start your Coder deployment with `CODER_PG_CONNECTION_URL=`.