Skip to content

Commit 42ba205

Browse files
authored
use docker compose service name for db export, rewrite OOBE warning, switch env codeblocks to txt (#21)
* switch env codeblocks to txt to avoid vitepress parser warnings Signed-off-by: Lovinoes <lovinoes@lovinoes.de> * remove Signed-off-by: Lovinoes <lovinoes@lovinoes.de> --------- Signed-off-by: Lovinoes <lovinoes@lovinoes.de>
1 parent 1dfe08f commit 42ba205

2 files changed

Lines changed: 45 additions & 14 deletions

File tree

web/docs/advanced/migrating/instances/calagopus-dockerized.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,3 @@ The database was not imported correctly, or the wrong database was targeted. Sto
201201

202202
**Login fails / encrypted data appears corrupted:**
203203
Your `APP_ENCRYPTION_KEY` in `docker-compose.yml` probably doesn't match the one from your original installation. Stop the stack, correct the key and run `docker compose up -d` again.
204-
205-
**`calagopus-db-1` container not found:**
206-
The container name is generated from your directory name. Check the actual name with `docker compose ps` and adjust the import command accordingly.

web/docs/advanced/migrating/instances/calagopus-standalone.md

Lines changed: 45 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,47 @@ Make sure you have:
1919
- The Calagopus binary installed but not yet configured - you need to land on the OOBE screen and stop there
2020

2121
::: warning Don't click through the OOBE
22+
The OOBE creates database records that can conflict with the import. If you've already clicked through, drop and recreate the database first.
2223
![Calagopus Panel OOBE](../../../panel/oobe.webp)
23-
The binary install needs an empty database to write into on first run. Stop at the OOBE screen and come back here.
24-
:::
24+
25+
::: details I already clicked through - how do I undo it?
26+
You'll need to drop and recreate the database. Pick the matching tab for how Calagopus is installed:
27+
28+
::::tabs
29+
=== APT/RPM, Binary
30+
Stop Calagopus first:
31+
```bash
32+
# Linux
33+
systemctl stop calagopus-panel
34+
35+
# Windows
36+
nssm stop "Calagopus Panel"
37+
```
38+
39+
Connect to Postgres and recreate the database:
40+
```bash
41+
# Linux/MacOS
42+
sudo -u postgres psql
43+
44+
# Windows: see the binary install guide for psql access
45+
# https://calagopus.com/docs/panel/installation/binary#database-configuration
46+
```
47+
```sql
48+
DROP DATABASE panel WITH (FORCE);
49+
CREATE DATABASE panel OWNER calagopus;
50+
GRANT ALL PRIVILEGES ON DATABASE panel TO calagopus;
51+
exit
52+
```
53+
54+
Start Calagopus back up:
55+
```bash
56+
# Linux
57+
systemctl start calagopus-panel
58+
59+
# Windows
60+
nssm start "Calagopus Panel"
61+
```
62+
::::
2563

2664

2765
## Collect values from your existing installation
@@ -48,12 +86,12 @@ Keep both values handy. You'll need them shortly.
4886
Open `/etc/calagopus/.env` on your target host and set the following values.
4987

5088
Set `APP_ENCRYPTION_KEY` to the value copied above:
51-
```env
89+
```txt
5290
APP_ENCRYPTION_KEY=Ab3xZ9qR2mKp7vLw
5391
```
5492

5593
Set `DATABASE_URL` to point at your host PostgreSQL instance. Use the same password from your Docker setup, or a new one if you prefer. Just make sure it matches what you set when creating the database user:
56-
```env
94+
```txt
5795
DATABASE_URL="postgresql://calagopus:yourPassword@localhost:5432/panel"
5896
```
5997

@@ -68,16 +106,15 @@ docker exec calagopus-db-1 pg_dump \
68106
-F c \
69107
-f /tmp/panel.backup
70108
71-
docker cp calagopus-db-1:/tmp/panel.backup ./panel.backup
109+
docker compose cp db:/tmp/panel.backup ./panel.backup
72110
```
73111

74112
This copies the dump out of the container to `./panel.backup` on your host.
75113

76-
::: info
77-
If you're migrating to a different host, copy `panel.backup` to that machine before continuing.
114+
::: info Migrating to a different host?
115+
Copy `panel.backup` to `/opt/calagopus/` on the target machine before continuing.
78116
:::
79117

80-
81118
## Import the database into the host PostgreSQL
82119
First, make sure the database user and database exist. Connect to PostgreSQL:
83120

@@ -134,6 +171,3 @@ The database was not imported correctly. Stop the panel with `systemctl stop cal
134171

135172
**Login fails / encrypted data appears corrupted:**
136173
The `APP_ENCRYPTION_KEY` in `/etc/calagopus/.env` does not match the one from your Docker installation. Stop the panel, correct the key, and start it again.
137-
138-
**`calagopus-db-1` container not found:**
139-
The container name is generated from your compose directory name. Check the actual name with `docker compose ps` and adjust the export command accordingly.

0 commit comments

Comments
 (0)